/* ============================================================
   COMPONENTS — Reusable UI Elements
   Relies on global.css being loaded first.
   ============================================================ */

/* ── Container ── */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}


/* ── Back Button ── */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    background: var(--color-surface-base);
    padding: 10px 20px;
    border-radius: var(--radius-button);
    text-decoration: none;
    color: var(--color-primary);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
    transition: all 150ms ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    color: var(--color-primary-hover);
}


/* ── Cards ── */
.card {
    background: var(--color-surface-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 32px 24px 28px;
    text-align: center;
    transition: all 150ms ease;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
}

.card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-card-hover), 0 0 0 3px var(--color-primary-glow);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: var(--color-primary-light);
}

.card-icon img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
}

.card-title {
    font-family: var(--font-ui);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.card-desc {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: auto;
}


/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.badge--live {
    background: var(--color-success);
    color: #FFFFFF;
}

.badge--beta {
    background: var(--color-warning);
    color: #FFFFFF;
}

.badge--soon {
    background: var(--color-text-tertiary);
    color: #FFFFFF;
}


/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    min-width: 120px;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius-button);
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 150ms ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-button);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-button);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-surface-section);
    color: var(--color-text-primary);
}

.btn--ghost:active {
    background: var(--color-surface-input);
}

.btn--secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}

.btn--secondary:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

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

.btn--disabled {
    background: var(--color-surface-input);
    color: var(--color-text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

.btn--disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Standalone button variants (used outside .btn base) */
.btn-primary {
    background: var(--color-primary);
    color: #FFFFFF;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-button);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 150ms ease;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    padding: 10px 20px;
    border-radius: var(--radius-button);
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-secondary:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(255, 59, 48, 0.08);
    color: var(--color-error);
    border: 1.5px solid rgba(255, 59, 48, 0.25);
    padding: 8px 16px;
    border-radius: var(--radius-button);
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.15);
    border-color: var(--color-error);
    transform: translateY(-1px);
}

.btn-small {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: all 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-ui);
}


/* ── Footer ── */
.footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 400;
    margin-top: auto;
    background: var(--color-surface-base);
}

.footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}


/* ── SVG Icons ── */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
}

.icon-large {
    width: 48px;
    height: 48px;
}


/* ── Modal ── */
.modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 22, 34, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: comp-fadeIn 200ms ease;
}

.modal.hidden,
.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--color-surface-base);
    border-radius: 20px;
    max-width: 850px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: comp-slideUp 300ms ease;
    position: relative;
    border: 1px solid var(--color-border);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--color-surface-section);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
    z-index: 10;
    padding: 0;
    box-shadow: none;
}

.modal-close-btn:hover {
    background: var(--color-error);
    color: #FFFFFF;
    border-color: var(--color-error);
    transform: rotate(90deg);
}

.modal-header {
    background: var(--color-primary-light);
    padding: 32px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    border-radius: 20px 20px 0 0;
}

.modal-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(123, 0, 212, 0.15));
}

.modal-header h2 {
    font-family: var(--font-display);
    color: var(--color-text-primary);
    font-size: 24px;
    font-weight: 800;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-header p {
    color: var(--color-text-secondary);
    font-size: 15px;
}

.modal-body {
    padding: 28px 32px;
    background: var(--color-surface-base);
}

.modal-footer {
    padding: 20px 32px 28px;
    text-align: center;
    background: var(--color-surface-section);
    border-top: 1px solid var(--color-border);
    border-radius: 0 0 20px 20px;
}

.modal-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 32px;
}

.modal-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-tertiary);
}


/* ── Setup Form Fields ── */
.setup-field {
    margin-bottom: 20px;
}

.setup-field label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.setup-field input[type="text"],
.setup-field input[type="number"],
.setup-field input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-input);
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--color-text-primary);
    background: var(--color-surface-base);
    transition: all 150ms ease;
}

.setup-field input:focus,
.setup-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.setup-field small {
    display: block;
    margin-top: 6px;
    color: var(--color-text-secondary);
    font-size: 13px;
}

.setup-field select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-input);
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--color-text-primary);
    background: var(--color-surface-base);
    cursor: pointer;
}

.setup-field select[multiple] {
    min-height: 160px;
    padding: 8px;
}

.setup-field select option {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 2px 0;
    cursor: pointer;
}

.setup-field select option:checked {
    background: var(--color-primary);
    color: #FFFFFF;
    font-weight: 600;
}

.setup-estimation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-primary-light);
    border-radius: var(--radius-input);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    margin: 16px 0;
}


/* ── Decades / Genre Grid ── */
.decades-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.decade-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-input);
    background: var(--color-surface-section);
    cursor: pointer;
    transition: all 150ms ease;
    text-align: center;
}

.decade-checkbox:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.decade-checkbox input[type="checkbox"] {
    display: none;
}

.decade-label {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.decade-label small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 3px;
    color: var(--color-text-secondary);
}

.decade-checkbox:has(input:checked) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-button);
}

.decade-checkbox:has(input:checked) .decade-label,
.decade-checkbox:has(input:checked) .decade-label small {
    color: #FFFFFF;
}


/* ── Voice Cards ── */
.voice-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
}

.voice-card {
    background: var(--color-surface-section);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 12px;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.voice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--color-primary);
}

.voice-card.selected {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-button);
}

.voice-card.selected .voice-icon,
.voice-card.selected .voice-info strong,
.voice-card.selected .voice-info span {
    color: #FFFFFF;
}

.voice-icon {
    font-size: 2em;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary-light);
}

.voice-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-info strong {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--color-text-primary);
}

.voice-info span {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.preview-btn {
    background: var(--color-surface-base);
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    box-shadow: none;
}

.preview-btn:hover {
    background: var(--color-primary);
    color: #FFFFFF;
}

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

.voice-card.selected .preview-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
}

.voice-card.selected .preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* ── Branding / Marketing Section ── */
.setup-section-divider {
    margin: 28px 0 20px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.setup-section-divider h3 {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-description {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin: 0 0 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius-input);
    background: var(--color-surface-section);
    transition: all 150ms ease;
}

.checkbox-label:hover {
    background: var(--color-primary-light);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.checkbox-label span {
    font-family: var(--font-ui);
    font-weight: 500;
    color: var(--color-text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.logo-input-group input[type="url"] {
    flex: 1;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-button);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
    box-shadow: none;
}

.upload-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.logo-preview {
    margin-top: 12px;
    padding: 12px;
    background: var(--color-surface-section);
    border-radius: var(--radius-input);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px dashed var(--color-border);
}

.logo-preview img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--color-surface-base);
    padding: 4px;
}

.remove-btn {
    background: var(--color-error);
    color: #FFFFFF;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
    margin-left: auto;
    padding: 0;
    box-shadow: none;
}

.remove-btn:hover {
    opacity: 0.85;
    transform: scale(1.1);
}

.social-input-group {
    display: flex;
    gap: 10px;
}

.social-input-group select,
.platform-selector {
    min-width: 140px;
    max-width: 140px;
    padding: 10px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-input);
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--color-text-primary);
    background: var(--color-surface-base);
    cursor: pointer;
}

.social-input-group input {
    flex: 1;
}

.social-preview {
    display: block;
    margin-top: 8px;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 12px;
    background: var(--color-primary-light);
    border-radius: 6px;
    font-style: italic;
}


/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--color-text-secondary);
}

.empty-state h2 {
    font-family: var(--font-display);
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 15px;
}


/* ── Loading Spinner ── */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-border);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: comp-spin 1s ease-in-out infinite;
}


/* ── Shared Animations ── */
@keyframes comp-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

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


/* ── Responsive: Mobile ── */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .card {
        padding: 24px 20px;
    }

    .back-button {
        padding: 8px 14px;
        font-size: 13px;
    }

    .modal-content {
        width: 95%;
    }

    .modal-body {
        padding: 20px 16px;
    }

    .decades-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}