﻿/* -- ui.css -- Verdict Alpha -- */
/* User Bar */
.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.user-email {
    font-size: 0.85rem;
    color: var(--text);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sub-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.sub-badge.trial {
    background: var(--accent-amber);
    color: #1a1a28;
}
.sub-badge.active {
    background: var(--accent-green);
    color: #1a1a28;
}
.sub-badge.expired {
    background: var(--error);
    color: white;
}

/* Subscription Banner */
.sub-banner {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sub-banner.trial {
    border-left: 3px solid var(--accent-amber);
}
.sub-banner.active {
    border-left: 3px solid var(--accent-green);
}
.sub-banner.expired {
    border-left: 3px solid var(--error);
}
.sub-banner-text {
    font-size: 0.9rem;
}
.sub-banner-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.sub-banner-btn:hover {
    opacity: 0.85;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 18, 26, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.auth-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.auth-card.paywall {
    max-width: 440px;
}
.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}
.auth-tab.active {
    background: var(--bg-lighter);
    color: var(--text);
}
.auth-tab:hover:not(.active) {
    color: var(--text);
}

/* Auth Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-form input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 16px; /* Prevents iOS zoom on focus */
    outline: none;
    transition: border-color 0.2s;
}
.auth-form input:focus {
    border-color: var(--accent);
}
.auth-form input::placeholder {
    color: var(--text-dark);
}
.auth-btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: opacity 0.2s;
}
.auth-btn-primary:hover {
    opacity: 0.85;
}
.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* OAuth Buttons */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-dark);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
}
.auth-btn-oauth:hover {
    background: var(--bg-lighter);
}
.oauth-icon {
    font-size: 1.1rem;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 16px;
    color: var(--text-dark);
    font-size: 0.8rem;
}
.auth-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
}
.auth-link:hover {
    text-decoration: underline;
}

.auth-keep-login {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}
.auth-keep-login input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* OTP Section */
.auth-form h3 {
    text-align: center;
    margin-bottom: 4px;
}
.auth-hint {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 16px;
}
#recaptchaContainer {
    margin-bottom: 12px;
}

/* Register field validation */
.field-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.field-hint {
    font-size: 0.78rem;
    padding: 0 2px;
    min-height: 16px;
    transition: color 0.2s;
}
.field-hint.ok  { color: var(--accent-green); }
.field-hint.err { color: var(--error); }
.field-hint.checking { color: var(--text-dim); font-style: italic; }

.auth-form input.input-ok  { border-color: var(--accent-green); }
.auth-form input.input-err { border-color: var(--error); }

.pw-checklist {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 2px;
}
.pw-check {
    font-size: 0.76rem;
    color: var(--text-dark);
    transition: color 0.15s;
}
.pw-check.ok { color: var(--accent-green); }

/* Paywall */
.paywall h2 {
    text-align: center;
    margin-bottom: 8px;
}
.pricing {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-green);
    margin-bottom: 4px;
}
.price span {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 400;
}
.price-features {
    list-style: none;
    text-align: left;
    margin-top: 16px;
}
.price-features li {
    padding: 6px 0;
    font-size: 0.95rem;
    color: var(--text);
}

/* Model Selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lang-selector label {
    font-size: 0.85rem;
    color: var(--text-dim);
    white-space: nowrap;
}
.lang-selector select {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.mode-tabs::-webkit-scrollbar {
    display: none;
}
.mode-tab {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
}
.mode-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.mode-tab:hover:not(.active) {
    color: var(--text);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: minmax(320px, 560px) 1fr;
    gap: 20px;
    align-items: start;
}

/* Analysis Panel - Common container for tabs */
.analysis-panel {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Intervention Toast */
.intervention-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 320px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.intervention-toast strong {
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.intervention-toast em {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    opacity: 0.9;
}
.intervention-info {
    background: var(--accent-blue);
    color: white;
}
.intervention-warning {
    background: var(--accent-amber);
    color: #1a1a28;
}
.intervention-alert {
    background: var(--error);
    color: white;
}
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Move animation */
@keyframes piece-slide {
    from {
        transform: translate(var(--dx, 0), var(--dy, 0));
    }
    to {
        transform: translate(0, 0);
    }
}
.piece-moved {
    animation: piece-slide 0.13s ease-out;
}

/* ── Skeleton Loading States ── */
.skeleton-text {
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        var(--border) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

.skeleton-text.short {
    width: 60%;
    height: 1em;
}
.skeleton-text.medium {
    width: 80%;
    height: 1em;
}
.skeleton-text.long {
    width: 100%;
    height: 1em;
}

.skeleton-box {
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        var(--border) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-dim);
}

/* ── Onboarding Tour ── */
.onboard-highlight {
    transition: box-shadow 0.3s ease;
}



/* Drill Banner */
.tactics-drill-banner {
    background: var(--accent);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
}