@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-dark: #022742;
    --primary-teal: #2f8b85;
    --primary-teal-hover: #267973;
    --primary-teal-light: rgba(47, 139, 133, 0.1);
    --background: #f5f7fa;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 2px 8px rgba(2, 39, 66, 0.1);
    --shadow-md: 0 4px 16px rgba(2, 39, 66, 0.15);
    --shadow-lg: 0 8px 32px rgba(2, 39, 66, 0.2);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

.container {
    background: var(--primary-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    padding: 16px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 10px;
}

.hlogo {
    margin-bottom: 6px;
}

.hlogo img {
    max-width: 70px;
    height: auto;
}

h1 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Password Display */
.password-display {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    border: 2px solid rgba(47, 139, 133, 0.2);
    transition: var(--transition);
}

.password-display:hover {
    border-color: rgba(47, 139, 133, 0.4);
}

.password-wrapper {
    flex: 1;
    margin-right: 10px;
    overflow: hidden;
}

#result {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    word-break: break-all;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.btn-icon {
    background: var(--primary-teal);
    border: none;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(47, 139, 133, 0.3);
}

.btn-icon:hover {
    background: var(--primary-teal-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 139, 133, 0.4);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon:focus {
    outline: 3px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
}

/* Notification */
.notification {
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
    max-height: 0;
    overflow: hidden;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 60px;
}

.notification.success {
    background: rgba(47, 139, 133, 0.2);
    border: 1px solid var(--primary-teal);
    color: var(--text-primary);
}

.notification.error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #ff6b7a;
}

/* Settings Card */
.settings-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-group {
    margin-bottom: 10px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

/* Length Slider */
.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.length-value {
    background: var(--primary-teal);
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 14px;
    min-width: 35px;
    text-align: center;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-teal);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(47, 139, 133, 0.4);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-teal-hover);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-teal);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(47, 139, 133, 0.4);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-teal-hover);
}

.slider:focus::-webkit-slider-thumb {
    outline: 3px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
}

.slider:focus::-moz-range-thumb {
    outline: 3px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
}

/* Divider */
.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

/* Custom Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
    position: relative;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked~.checkbox-custom {
    background: var(--primary-teal);
    border-color: var(--primary-teal);
}

.checkbox-label input[type="checkbox"]:checked~.checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus~.checkbox-custom {
    outline: 3px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
}

.checkbox-text {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 400;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-hover) 100%);
    border: none;
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(47, 139, 133, 0.3);
    margin-bottom: 10px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 139, 133, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:focus {
    outline: 3px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
}

.btn-generate i {
    font-size: 14px;
}

/* Bulk Export Section */
.bulk-export-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.bulk-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.bulk-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bulk-header i:first-child {
    font-size: 14px;
    color: var(--primary-teal);
}

.bulk-header span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.bulk-header.active .toggle-icon {
    transform: rotate(180deg);
}

.bulk-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 12px;
}

.bulk-content.show {
    max-height: 150px;
    padding: 0 12px 12px 12px;
}

.bulk-input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bulk-input-group label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 400;
}

.bulk-input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    border-radius: 5px;
    font-size: 13px;
    text-align: center;
    transition: var(--transition);
}

.bulk-input:focus {
    outline: 2px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
    border-color: var(--primary-teal);
}

.btn-export {
    width: 100%;
    background: rgba(47, 139, 133, 0.2);
    border: 1px solid var(--primary-teal);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-export:hover {
    background: rgba(47, 139, 133, 0.3);
    transform: translateY(-1px);
}

.btn-export:active {
    transform: translateY(0);
}

.btn-export:focus {
    outline: 2px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
}

.btn-export i {
    font-size: 13px;
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 0;
}

.footer p {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.footer a {
    color: var(--primary-teal);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.footer a:hover {
    color: #4db8b0;
    border-bottom-color: #4db8b0;
}

.footer a:focus {
    outline: 2px solid rgba(47, 139, 133, 0.4);
    outline-offset: 2px;
    border-radius: 2px;
}

.footer .heart {
    color: #ff6b6b;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 14px;
        max-height: calc(100vh - 20px);
    }

    h1 {
        font-size: 18px;
    }

    .password-display {
        padding: 10px;
        min-height: 48px;
    }

    #result {
        font-size: 13px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .settings-card {
        padding: 10px;
    }

    .checkbox-text {
        font-size: 12px;
    }

    .btn-generate {
        padding: 9px 14px;
        font-size: 13px;
    }

    .bulk-header {
        padding: 7px 10px;
        font-size: 12px;
    }

    .bulk-input {
        width: 65px;
        font-size: 12px;
    }

    .btn-export {
        padding: 7px 12px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 12px;
    }

    h1 {
        font-size: 17px;
    }

    .hlogo img {
        max-width: 65px;
    }

    #result {
        font-size: 12px;
    }

    .bulk-input-group label {
        font-size: 11px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
    }

    .btn-icon,
    .btn-generate {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        border: 2px solid var(--text-primary);
    }

    .checkbox-custom {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .footer .heart {
        animation: none;
    }
}
