* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1b2e;
    min-height: 100vh;
    color: #c8ccd4;
    display: flex;
    flex-direction: column;
}


.site-header {
    background: rgba(22, 23, 38, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    color: #e2e6ec;
    font-size: 1.3em;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo:hover {
    color: #fff;
}

.header-nav {
    display: flex;
    gap: 6px;
    flex: 1;
}

.nav-links {
    display: flex;
    gap: 6px;
}

.nav-extras {
    display: none;
}

.nav-link {
    color: rgba(200, 204, 212, 0.6);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #e2e6ec;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: #e2e6ec;
    background: rgba(91, 106, 191, 0.2);
    font-weight: 600;
}

.header-actions-desktop {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-socials {
    display: flex;
    gap: 8px;
}

.support-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.15) 0%, rgba(255, 20, 147, 0.12) 100%);
    border: 1px solid rgba(255, 105, 180, 0.25);
    border-radius: 8px;
    color: #ff69b4;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.support-btn:hover {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.22) 0%, rgba(255, 20, 147, 0.18) 100%);
    border-color: rgba(255, 105, 180, 0.35);
    color: #ff8cc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.15);
}

.social-link {
    color: rgba(200, 204, 212, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    transition: all 0.2s;
}

.social-link:hover {
    color: #e2e6ec;
    background: rgba(255, 255, 255, 0.08);
}

.nav-socials {
    display: flex;
    gap: 8px;
}

.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
    flex-shrink: 0;
}

.burger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #e2e6ec;
    border-radius: 2px;
    transition: all 0.3s;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}


.hero {
    text-align: center;
    padding: 44px 40px 24px;
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 8px;
    color: #e2e6ec;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.1em;
    color: #7a8194;
}


.container {
    max-width: 1200px;
    margin: 20px auto;
    background: #212337;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    flex: 1;
    width: calc(100% - 40px);
}

main {
    padding: 0 40px 40px;
}


.settings-panel,
.results-panel,
.save-panel {
    background: #1a1b2e;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-panel h2,
.results-panel h2,
.save-panel h2 {
    margin-bottom: 18px;
    color: #e2e6ec;
    font-size: 1.5em;
    font-weight: 600;
}


.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.setting-item {
    display: flex;
    flex-direction: column;
}

.setting-item label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #7a8194;
    font-size: 0.9em;
}

.setting-item input {
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #161726;
    color: #c8ccd4;
}

.setting-item input:focus {
    outline: none;
    border-color: #5b6abf;
    box-shadow: 0 0 0 3px rgba(91, 106, 191, 0.2);
}

.generate-btn {
    width: 100%;
    padding: 14px;
    background: #5b6abf;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.generate-btn:hover {
    background: #6d7bd4;
    transform: translateY(-1px);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.word-count {
    background: #5b6abf;
    color: #fff;
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9em;
}

.words-container {
    background: #161726;
    border-radius: 10px;
    padding: 18px;
    min-height: 180px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.placeholder {
    text-align: center;
    color: #4a4f64;
    font-style: italic;
    padding: 40px;
}

.word-item {
    display: inline-block;
    background: #2a2d45;
    color: #c8ccd4;
    padding: 8px 16px;
    margin: 6px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.word-item:hover {
    background: #3a3d5c;
    transform: scale(1.04);
    border-color: rgba(91, 106, 191, 0.3);
}


.save-form {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.save-input {
    flex: 1;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #161726;
    color: #c8ccd4;
}

.save-input:focus {
    outline: none;
    border-color: #4a9c6d;
    box-shadow: 0 0 0 3px rgba(74, 156, 109, 0.2);
}

.save-btn {
    padding: 13px 26px;
    background: #3d8b5a;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.save-btn:hover:not(:disabled) {
    background: #4a9c6d;
    transform: translateY(-1px);
}

.save-btn:active:not(:disabled) {
    transform: translateY(0);
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-hint {
    color: #5a6078;
    font-size: 0.85em;
    font-style: italic;
    margin: 0;
}

.save-hint.api-info {
    margin-top: 10px;
    font-style: normal;
    font-size: 0.82em;
    color: #4a4f64;
    line-height: 1.5;
}

.save-hint.api-info a {
    color: #7a8194;
    text-decoration: underline;
    text-decoration-color: rgba(122, 129, 148, 0.3);
    text-underline-offset: 2px;
}

.save-hint.api-info a:hover {
    color: #a8b0c4;
}

.save-validation-info {
    margin-top: 24px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.save-validation-info h3 {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #e2e6ec;
}

.save-validation-info p {
    color: rgba(200, 204, 212, 0.7);
    font-size: 0.9em;
    line-height: 1.7;
    margin: 0 0 12px 0;
}

.save-validation-info p:last-child {
    margin-bottom: 0;
}

.save-validation-info ul {
    color: rgba(200, 204, 212, 0.7);
    font-size: 0.9em;
    line-height: 1.8;
    margin: 12px 0;
    padding-left: 24px;
}

.save-validation-info li {
    margin-bottom: 6px;
}

.save-validation-info a {
    color: #7a8add;
    text-decoration: none;
    transition: color 0.2s;
}

.save-validation-info a:hover {
    color: #8b9aff;
    text-decoration: underline;
}

.save-validation-info strong {
    color: #c8ccd4;
    font-weight: 600;
}


.actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.action-btn:first-child {
    background: #4a7abf;
    color: #fff;
}

.action-btn:first-child:hover:not(:disabled) {
    background: #5a8ad4;
    transform: translateY(-1px);
}

.action-btn:last-child {
    background: #b05050;
    color: #fff;
}

.action-btn:last-child:hover:not(:disabled) {
    background: #c45e5e;
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}


.site-footer {
    background: #111220;
    margin-top: auto;
    position: relative;
}

.footer-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 106, 191, 0.4), rgba(91, 106, 191, 0.15), transparent);
}

.footer-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: rgba(200, 204, 212, 0.25);
}

.footer-logo {
    color: rgba(200, 204, 212, 0.6);
    font-weight: 700;
    white-space: nowrap;
}

.footer-desc {
    color: rgba(200, 204, 212, 0.2);
    font-size: 0.92em;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-nav a {
    color: rgba(200, 204, 212, 0.3);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: rgba(200, 204, 212, 0.7);
}

.footer-creator,
.footer-copy {
    white-space: nowrap;
}

.creator-name {
    color: rgba(145, 130, 210, 0.55);
    font-weight: 600;
}

.footer-dot {
    color: rgba(200, 204, 212, 0.1);
    user-select: none;
}

.footer-socials {
    display: flex;
    gap: 6px;
    margin-left: 4px;
}

.footer-socials a {
    color: rgba(200, 204, 212, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.footer-socials a:hover {
    color: rgba(200, 204, 212, 0.65);
    background: rgba(91, 106, 191, 0.12);
}

.footer-support-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.12) 0%, rgba(255, 20, 147, 0.1) 100%);
    border: 1px solid rgba(255, 105, 180, 0.2);
    border-radius: 8px;
    color: #ff69b4;
    text-decoration: none;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.footer-support-btn:hover {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.18) 0%, rgba(255, 20, 147, 0.15) 100%);
    border-color: rgba(255, 105, 180, 0.3);
    color: #ff8cc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.12);
}

.footer-support-btn .support-icon {
    font-size: 1em;
    line-height: 1;
}

.footer-support-btn .support-text {
    font-size: 0.85em;
}


.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.notification.success {
    background: #667eea;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #667eea;
}

.notification.slide-out {
    animation: slideOut 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}


.words-container::-webkit-scrollbar {
    width: 8px;
}

.words-container::-webkit-scrollbar-track {
    background: #161726;
    border-radius: 8px;
}

.words-container::-webkit-scrollbar-thumb {
    background: #2a2d45;
    border-radius: 8px;
}

.words-container::-webkit-scrollbar-thumb:hover {
    background: #3a3d5c;
}


@media (max-width: 900px) {
    .footer-bar {
        gap: 10px;
    }

    .footer-desc {
        display: none;
    }
}

@media (max-width: 900px) {
    .header-actions-desktop .header-socials {
        display: none;
    }

    .logo {
        font-size: 1.15em;
    }

    .header-inner {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .site-header {
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        z-index: 1000; /* Ensure header is on top */
        backdrop-filter: none;
        background: #161726;
    }

    .header-inner {
        position: relative;
        z-index: 1002; /* Content above menu */
        background: inherit;
    }

    body {
        padding-top: 60px;
    }

    .header-nav {
        display: none !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: auto; /* Allow content to be seen below */
        max-height: calc(100vh - 80px); /* Limit height to allow seeing page bottom */
        background: rgba(22, 23, 38, 0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        z-index: 1001;
        overflow-y: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border-radius: 0 0 20px 20px;
    }

    .header-nav.open {
        display: flex !important;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 1em;
        border-radius: 8px;
    }

    .nav-extras {
        display: flex !important;
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .nav-extras .support-btn {
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .nav-socials {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    .nav-socials .social-link {
        width: 40px;
        height: 40px;
    }

    .header-actions-desktop {
        display: none !important;
    }

    .burger-btn {
        display: flex !important;
    }

    .hero h1 {
        font-size: 1.8em;
    }

    .container {
        width: calc(100% - 16px);
        margin-top: 10px;
        margin-bottom: 10px;
        border-radius: 12px;
    }

    main {
        padding: 0 18px 18px;
    }

    .hero {
        padding: 24px 18px 16px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .save-form {
        flex-direction: column;
    }

    .footer-bar {
        padding: 20px 16px;
        gap: 8px;
        font-size: 0.78em;
    }

    .footer-support-btn {
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1em;
    }

    .header-inner {
        padding: 0 12px;
        gap: 8px;
    }

    .footer-bar {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.72em;
    }

    .footer-dot {
        display: none;
    }
}


.page-header {
    text-align: center;
    padding: 40px 20px 30px;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.5em;
    color: #e2e6ec;
    margin-bottom: 12px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 1.1em;
    color: #8b92a8;
    margin: 0;
}


.info-section {
    margin-top: 50px;
    padding: 30px 0;
}

.info-section h2 {
    font-size: 2em;
    color: #e2e6ec;
    margin-bottom: 30px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.info-icon {
    font-size: 2.5em;
    margin-bottom: 16px;
    display: block;
}

.info-card h3 {
    font-size: 1.3em;
    color: #e2e6ec;
    margin-bottom: 12px;
    font-weight: 600;
}

.info-card p {
    color: #8b92a8;
    line-height: 1.6;
    margin: 0;
}

.info-card a {
    color: #6b9fff;
    text-decoration: none;
    transition: color 0.2s;
}

.info-card a:hover {
    color: #8bb3ff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2em;
    }

    .page-subtitle {
        font-size: 1em;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-card {
        padding: 20px;
    }
}
