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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 640px;
}

h1 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #a78bfa;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.card {
    background: #16213e;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #0f3460;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: #a78bfa;
    font-weight: 500;
}

select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #0f3460;
    background: #1a1a2e;
    color: #eee;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

select:focus,
textarea:focus {
    outline: none;
    border-color: #a78bfa;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #666;
}


.btn-download {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: #0f3460;
    color: #60a5fa;
    border: 1px solid #1e5aa8;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #1e5aa8;
}

.row {
    display: flex;
    gap: 1rem;
}

.row .form-group {
    flex: 1;
}

.btn-generate {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-generate:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-generate:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
}

.status.loading {
    display: block;
    background: #1e3a5f;
    color: #60a5fa;
    text-align: center;
}

.status.error {
    display: block;
    background: #3b1f1f;
    color: #f87171;
}

.status.success {
    display: block;
    background: #1a3a2a;
    color: #4ade80;
}

.audio-player {
    margin-top: 1rem;
    display: none;
}

.audio-player audio {
    width: 100%;
    border-radius: 8px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.model-status {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
}

.model-status .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.dot.online { background: #4ade80; }
.dot.offline { background: #f87171; }

/* Nav */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    background: #0f0f23;
    border-bottom: 1px solid #0f3460;
    padding: 0.6rem 1rem;
    z-index: 100;
}

.nav-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: #eee;
    background: #16213e;
}

.nav-link.active {
    color: #a78bfa;
    background: #1e1e3a;
}

.nav-logout {
    margin-left: auto;
    background: none;
    border: 1px solid #444;
    color: #888;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.nav-logout:hover {
    color: #f87171;
    border-color: #f87171;
}

.radio-group {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #aaa;
    font-size: 0.9rem;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: #a78bfa;
}

input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #0f3460;
    background: #0f0f23;
    color: #eee;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
}

input[type="text"]:focus {
    border-color: #a78bfa;
}

body {
    padding-top: 3rem;
}

/* Docs */
.docs-container {
    max-width: 780px;
}

.docs-section {
    margin-bottom: 1.5rem;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.method {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method.get { background: #1a3a2a; color: #4ade80; }
.method.post { background: #3b1f4a; color: #c084fc; }
.method.info { background: #1e3a5f; color: #60a5fa; }

code.path {
    font-size: 0.95rem;
    color: #eee;
    font-family: "SF Mono", "Fira Code", monospace;
}

.endpoint-desc {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.docs-section h4 {
    font-size: 0.8rem;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.docs-section h4:first-of-type {
    margin-top: 0;
}

.docs-section pre {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

.docs-section pre code {
    font-size: 0.82rem;
    color: #c4d4f0;
    font-family: "SF Mono", "Fira Code", monospace;
    white-space: pre;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
}

.docs-table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #0f3460;
    color: #888;
    font-weight: 500;
}

.docs-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #1e2a4a;
    color: #ccc;
}

.docs-table code {
    font-size: 0.78rem;
    color: #a78bfa;
    background: #1a1a2e;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

td.yes { color: #4ade80; font-weight: 600; }
td.no { color: #666; }

.tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #1a3a2a;
    color: #4ade80;
}

.tag-warn { background: #3a2a1a; color: #fbbf24; }
.tag-err { background: #3b1f1f; color: #f87171; }

.small-note {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 0.4rem;
}

/* Image output */
.image-output {
    margin-top: 1rem;
}

.image-output img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #0f3460;
    margin-bottom: 0.75rem;
}

/* Video output */
.video-output {
    margin-top: 1rem;
}

.video-output video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #0f3460;
    margin-bottom: 0.75rem;
}

/* Checkbox group */
.checkbox-group {
    margin-bottom: 1.25rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    accent-color: #a78bfa;
    width: 16px;
    height: 16px;
}

/* Upload area */
.upload-area {
    border: 2px dashed #0f3460;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #a78bfa;
    background: #1e1e3a;
}

.upload-content .upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Log container */
.log-container {
    margin-top: 1.25rem;
}

.log-header {
    font-size: 0.8rem;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.log-body {
    background: #0f0f23;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.78rem;
    color: #7dd3fc;
}

.log-line {
    padding: 0.15rem 0;
    border-bottom: 1px solid #1a2a40;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line:last-child {
    border-bottom: none;
}
