/* geist-mono-latin-wght-normal */
@font-face {
    font-family: 'Geist Mono Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/geist-mono:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* sora-latin-wght-normal */
@font-face {
  font-family: 'Sora Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/sora:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
html, body {
    margin: 0;
    height: 100%;
}
body {
    font-family: 'Geist Mono Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
header {
    background-color: transparent;
    text-align: center;
    padding: 20px 0;
}

/* Hide the title until JS reveals it to prevent flashing the original text */
#title {
    visibility: hidden;
}

/* Generator UI styles */
.container {
    max-width: 1100px;
    margin: 10px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}
.panel {
    background: rgba(0,0,0,0.02);
    padding: 18px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}
.controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.controls label {
    font-size: 0.9rem;
    color: #333;
}
.controls input[type="text"] {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
}
.options {
    display: flex;
    gap: 12px;
    font-size: 0.9rem;
}


.use-case { display:flex; flex-direction:column; gap:6px; }
.use-case select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}
.length-controls { display:flex; gap:12px; align-items:center; }
.length-controls label { font-size:0.9rem; color:#333; }
.length-controls input[type="number"] { width:84px; padding:6px 8px; border-radius:6px; border:1px solid #ddd; }
.controls textarea {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 56px;
}


.taken-list { margin-top: 10px; border-top: 1px dashed #eee; padding-top: 10px; }
.taken-header { display:flex; justify-content:space-between; align-items:center; font-size:0.9rem; color:#444; margin-bottom:6px; }
.taken-chips { display:flex; gap:6px; flex-wrap:wrap; }
.taken-chip { background:#f5f5f5; padding:6px 8px; border-radius:16px; border:1px solid #e2e2e2; font-size:0.9rem; display:flex; gap:6px; align-items:center; }
.taken-chip button { background:transparent; border:none; color:#888; cursor:pointer; padding:0 4px; }
.taken-add { display:flex; gap:8px; margin-top:8px; }
.clearBtn { background:transparent; border:1px solid #ddd; padding:6px 8px; border-radius:6px; cursor:pointer; color: #333; }
.actions { display:flex; gap:8px; margin-top:8px; }
button { background: #111; color:#fff; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-family: inherit; }
button#randomBtn { background: #444; }

.tooltip-container { position: relative; display: inline-block; }
.tooltip-text {
    visibility: hidden; width: max-content; max-width: 260px; background-color: #333; color: #fff;
    text-align: center; border-radius: 6px; padding: 6px 10px; position: absolute;
    z-index: 10; bottom: 125%; left: 50%; transform: translateX(-50%);
    opacity: 0; transition: opacity 0.2s; font-size: 0.8rem; pointer-events: none;
    line-height: 1.3; font-weight: normal; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }

.suggestions { display: grid; grid-template-columns: repeat(auto-fill,minmax(350px,1fr)); align-content: start; gap: 12px; flex: 1; overflow-y: auto; padding-right: 10px; margin-top: 14px; }
.suggestion {
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    overflow: hidden;
}
.suggestion .text {
    font-weight: 700;
    color: #111;
    display: block;
    white-space: nowrap;
    overflow-x: auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 12px;
    font-size: 1.05rem;
}
.copyBtn {
    background: #fff;
    color: #111;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 56px;
    text-align: center;
    white-space: nowrap;
    flex: 0 0 auto;
}
.suggestion-actions { display:flex; gap:8px; align-items:center; flex: 0 0 auto; }
.suggestion.copied { transform: scale(0.995); opacity: 0.95; border-color: #cfeecf; }
.hint { font-size: 0.85rem; color: #666; margin-top: 18px; text-align: center; }



.selected-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    font-weight: 700;
    color: #111;
    display: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.error { color: #b00020; font-size: 0.9rem; }

footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 80px;
    width: max-content;
    color: #888;
    font-size: 0.9rem;
    background-color: #f7f7f7;
    border-top: 1px solid #eee;
    border-radius: 250px 250px 0 0;
    margin: auto auto 0 auto;
    position: relative;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 769px) {
    footer:hover {
        padding-top: 45px;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    }
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

@media (min-width: 769px) {
    footer:hover .footer-inner {
        transform: scale(1.05) translateY(-3px);
    }
}

footer p {
    margin: 0;
    font-family: 'Sora Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
}

#themeToggleBtn {
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

#themeToggleBtn:hover {
    background: #eee;
}

.info-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 12px;
    padding: 6px 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-btn:hover {
    background: #eee;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fca5a5;
    background-color: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.4rem;
    color: #111;
}

.modal-content p, .modal-content ul {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-content ul {
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 8px;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    color: #888;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #111;
}

/* Dark Theme */
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}
body.dark-theme .controls label, body.dark-theme .length-controls label {
    color: #bbb;
}
body.dark-theme .panel {
    background: rgba(255,255,255,0.05);
}
body.dark-theme input[type="text"], body.dark-theme input[type="number"], body.dark-theme select, body.dark-theme select option {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #333;
}
body.dark-theme .suggestion {
    background: #1e1e1e;
    border-color: #333;
}
body.dark-theme .suggestion .text {
    color: #e0e0e0;
}
body.dark-theme .copyBtn {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}
body.dark-theme button {
    background: #e0e0e0;
    color: #121212;
}
body.dark-theme .clearBtn {
    background: transparent;
    border-color: #555;
    color: #e0e0e0;
}
body.dark-theme button#randomBtn {
    background: #bbb;
}
body.dark-theme .taken-chip {
    background: #2a2a2a;
    border-color: #444;
}
body.dark-theme .taken-header, body.dark-theme .hint {
    color: #bbb;
}
body.dark-theme footer {
    background-color: #1a1a1a;
    border-top-color: #222;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
body.dark-theme #themeToggleBtn {
    border-color: #444;
    color: #bbb;
    background: transparent;
}
body.dark-theme #themeToggleBtn:hover {
    background: #333;
}
body.dark-theme .info-btn {
    border-color: #444;
    color: #bbb;
    background: transparent;
}
body.dark-theme .info-btn:hover {
    background: #333;
}
body.dark-theme .modal-content {
    background-color: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
body.dark-theme .modal-content h2 {
    color: #e0e0e0;
}
body.dark-theme .modal-content p, body.dark-theme .modal-content ul {
    color: #bbb;
}
body.dark-theme .close-btn {
    color: #888;
}
body.dark-theme .close-btn:hover {
    color: #fff;
}
body.dark-theme .selected-preview {
    background: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    main {
        overflow: visible;
    }
    header h1 {
        font-size: 1.8rem;
    }
    .container {
        height: auto;
        min-height: auto;
    }
    .panel {
        max-height: none;
        height: auto;
        overflow: visible;
    }
    .suggestions {
        overflow-y: visible;
        height: auto;
        flex: none;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        margin-top: 20px;
    }
    .options {
        flex-direction: column;
        gap: 12px;
    }
    .length-controls {
        flex-direction: column;
        align-items: stretch !important;
        gap: 16px;
    }
    .length-controls > div {
        justify-content: space-between;
    }
    footer {
        width: 100%;
        box-sizing: border-box;
        padding: 24px;
        border-radius: 40px 40px 0 0;
    }
    .footer-inner {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    body {
        overflow: auto;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .container {
        padding: 0 10px;
    }
    .length-controls > div {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .length-controls input[type="number"] {
        width: 100%;
        box-sizing: border-box;
    }
    .actions {
        flex-direction: column;
    }
    .actions button {
        width: 100%;
    }
    .tooltip-container {
        width: 100%;
    }
    .suggestions {
        grid-template-columns: 1fr;
    }
    .suggestion {
        flex-direction: column;
        padding: 16px 12px;
    }
    .suggestion .text {
        margin-right: 0;
        margin-bottom: 12px;
        text-align: center;
        width: 100%;
        white-space: normal;
        word-break: break-all;
    }
    .suggestion-actions {
        width: 100%;
        justify-content: center;
    }
    .suggestion-actions > * {
        flex: 1;
    }
    footer {
        padding: 20px 16px;
        border-radius: 30px 30px 0 0;
    }
    footer p {
        font-size: 0.95rem;
        text-align: center;
    }
}
