/* DESIGN SYSTEM */
:root {
    /* HSL Colors: 'Trust Blue' & 'Action Orange' */
    --primary: 220 90% 56%;
    /* #2563EB - Vibrant Blue */
    --primary-dark: 220 90% 40%;
    --accent: 25 95% 53%;
    /* #F97316 - Trustworthy Orange/Amber */

    --bg-dark: 220 40% 10%;
    /* #0F172A - Deep Navy Background */
    --bg-card: 220 35% 15%;
    /* #192338 - Card Background */
    --text-main: 220 20% 98%;
    /* #F8FAFC */
    --text-muted: 215 15% 65%;
    /* #94A3B8 */

    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: hsl(var(--bg-dark));
    color: hsl(var(--text-main));
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

/* UTILITIES */
.hidden-view,
.hidden {
    display: none !important;
}

.active-view {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* NAVBAR */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, hsl(var(--primary)), #60A5FA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    color: hsl(var(--text-muted));
}

.nav-links a:hover {
    color: hsl(var(--text-main));
}

/* MOBILE NAV TRIGGER */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}


/* BUTTONS */
.btn-primary,
.btn-primary-sm {
    background: hsl(var(--primary));
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
    white-space: nowrap;
}

.btn-primary-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px hsl(var(--primary) / 0.4);
}

.btn-primary-outline {
    background: transparent;
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary));
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary-outline:hover {
    background: hsl(var(--primary) / 0.1);
}

.btn-google {
    background: white;
    color: #333;
    width: 100%;
    padding: 0.8rem;
    border-radius: 50px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: transform 0.2s;
    margin-bottom: 1.5rem;
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* HERO */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    /* Offset for nav */
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: hsl(var(--primary) / 0.2);
    filter: blur(120px);
    border-radius: 50%;
    z-index: -1;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.badge {
    display: inline-block;
    background: hsl(var(--accent) / 0.15);
    color: hsl(var(--accent));
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid hsl(var(--accent) / 0.2);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.subtext {
    font-size: 1.2rem;
    color: hsl(var(--text-muted));
    margin-bottom: 2.5rem;
}

.cta-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.trust-text {
    font-size: 0.9rem;
    color: hsl(var(--text-muted));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* HERO VISUAL */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.glass-card {
    background: hsl(var(--bg-card) / 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: float 6s ease-in-out infinite;
    max-width: 100%;
}

.icon {
    font-size: 2.5rem;
    background: hsl(var(--bg-dark));
    padding: 1rem;
    border-radius: 12px;
}

.text strong {
    display: block;
    font-size: 1.1rem;
}

.text span {
    font-size: 0.9rem;
    color: hsl(var(--text-muted));
}

.status-pill {
    position: absolute;
    bottom: -15px;
    right: -15px;
    background: #10B981;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* STEPS SECTION */
.steps-section {
    padding: 4rem 5%;
    text-align: center;
}

.steps-section h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.step-card {
    background: hsl(var(--bg-card));
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    text-align: left;
    transition: 0.3s;
}

.step-card:hover {
    border-color: hsl(var(--primary) / 0.5);
    transform: translateY(-5px);
}

.step-num {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: hsl(var(--bg-dark));
    -webkit-text-stroke: 1px hsl(var(--primary));
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* CTA BANNER */
.cta-banner {
    padding: 4rem 5%;
    display: flex;
    justify-content: center;
}

.cta-content {
    background: linear-gradient(135deg, hsl(var(--primary)), #60A5FA);
    width: 100%;
    max-width: 1000px;
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px -10px hsl(var(--primary) / 0.5);
}

.cta-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

/* DASHBOARD */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;
}

.sidebar {
    width: 250px;
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 3rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: hsl(var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.menu li {
    list-style: none;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    color: hsl(var(--text-muted));
}

.menu li.active {
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    font-weight: 500;
}

.dashboard-content {
    flex: 1;
    padding: 2rem 5%;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.case-card {
    background: hsl(var(--bg-card));
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag.status-analysis,
.tag.status-triage_pending,
.tag.status-payment_pending,
.tag.status-under_analysis,
.tag.status-doc_review,
.tag.status-rebuttal_drafted,
.status-badge.status-analysis,
.status-badge.status-triage_pending,
.status-badge.status-payment_pending,
.status-badge.status-under_analysis,
.status-badge.status-doc_review,
.status-badge.status-rebuttal_drafted {
    background: hsl(var(--accent) / 0.2);
    color: hsl(var(--accent));
}

.tag.status-success,
.tag.status-rebuttal_ready,
.tag.status-resolved,
.tag.status-closed,
.status-badge.status-success,
.status-badge.status-rebuttal_ready,
.status-badge.status-resolved,
.status-badge.status-closed {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.tag.status-draft,
.status-badge.status-draft {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.tag.status-rejected,
.status-badge.status-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
    /* Validation for mobile edges */
}

.modal-card {
    background: hsl(var(--bg-card));
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: hsl(var(--bg-dark));
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
}

/* TOAST NOTIFICATIONS */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: hsl(var(--bg-card));
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    min-width: 250px;
}

.toast-success {
    border-left: 4px solid #10B981;
}

.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-info {
    border-left: 4px solid hsl(var(--accent));
}

.toast button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
    font-size: 1.2rem;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(20px);
    transition: 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ===========================
   RESPONSIVE / MOBILE STYLES
   =========================== */

@media (max-width: 768px) {

    /* TYPOGRAPHY */
    .hero h1 {
        font-size: 2.5rem;
    }

    .steps-section h2 {
        font-size: 2rem;
    }

    /* HERO */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
        justify-content: center;
    }

    .hero-content {
        margin-bottom: 3rem;
    }

    .cta-group {
        align-items: center;
    }

    .hero-image {
        width: 100%;
    }

    .glass-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }

    .status-pill {
        bottom: -10px;
        right: 50%;
        transform: translateX(50%);
        width: max-content;
    }

    /* NAVBAR */
    .nav-links {
        display: none;
        /* Hide standard nav */
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: hsl(var(--bg-card));
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--glass-border);
        z-index: 2000;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        list-style: none;
        /* Remove dots */
    }

    .nav-links.nav-open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    /* DASHBOARD */
    .dashboard-layout {
        flex-direction: column;
        padding-top: 60px;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }

    .user-profile {
        margin-bottom: 0;
        width: 100%;
        /* Full width to force menu below if needed, or keep partial to share row */
    }

    /* MOBILE DASHBOARD MENU (Horizontal Tabs) */
    .menu {
        display: flex;
        width: 100%;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .menu::-webkit-scrollbar {
        display: none;
    }

    .menu li {
        margin-bottom: 0;
        white-space: nowrap;
        background: hsl(var(--bg-dark));
        border: 1px solid var(--glass-border);
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .menu li.active {
        background: hsl(var(--primary));
        color: white;
        border-color: hsl(var(--primary));
    }

    .dashboard-content {
        padding: 1rem;
    }

    /* MOBILE SPACING REDUCTION */
    .cta-banner,
    .steps-section {
        padding: 2rem 5%;
    }

    .cta-content {
        padding: 2rem 1.5rem;
    }

    /* CARDS */
    .case-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .case-card>div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .case-card>div:last-child {
        align-items: flex-start;
    }

    /* TOASTS */
    #toast-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }

    /* FIX: Modal & Tabs Responsiveness */
    .modal-card {
        width: 90%;
        max-width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }

    /* Target the Auth Tabs Container (flex container inside modal) */
    .modal-card>div[style*="display:flex"] {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    /* Target Auth Tab Buttons */
    .modal-card>div[style*="display:flex"]>button {
        flex: 1;
        text-align: center;
        width: 100%;
        padding: 0.8rem 0;
        font-size: 0.9rem;
    }
}
