/* ==========================================================================
   PET SMILE AI - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Apple Human Interface + Modern dark-mode-first glassmorphism
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    /* HSL Color System */
    --color-primary: hsl(215, 60%, 50%);         /* Comfort Blue */
    --color-primary-dark: hsl(215, 60%, 40%);
    --color-secondary: hsl(170, 50%, 45%);       /* Healing Teal */
    --color-dark-bg: #0b0f19;                    /* Dark Deep Blue */
    --color-card-bg: rgba(255, 255, 255, 0.05);  /* Glassmorphic Base */
    --color-card-border: rgba(255, 255, 255, 0.08);
    --color-text-primary: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;

    /* Severity Scale Colors */
    --color-severity-1: hsl(145, 65%, 45%);      /* Minor - Green */
    --color-severity-2: hsl(45, 85%, 50%);       /* Mild - Yellow */
    --color-severity-3: hsl(25, 85%, 50%);       /* Moderate - Orange */
    --color-severity-4: hsl(0, 75%, 45%);        /* Serious - Red */
    --color-severity-5: hsl(340, 85%, 20%);      /* Emergency - Dark Red */

    /* Typography Scale */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Spacing & Radii */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 28px;
    
    /* Layout */
    --phone-width: 375px;
    --phone-height: 812px;
}

/* Base Document Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #111827;
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   SIMULATED MOBILE FRAME
   ========================================================================== */
.web-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    perspective: 1000px;
}

.phone-frame {
    width: var(--phone-width);
    height: var(--phone-height);
    background-color: var(--color-dark-bg);
    border: 12px solid #2d3748;
    border-radius: 48px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 28px;
    background-color: #2d3748;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 1000;
}

/* ==========================================================================
   APP SCREENS INTERFACE
   ========================================================================== */
.app-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding-top: 40px; /* Leave space for notch */
    background-color: var(--color-dark-bg);
    animation: fadeIn 0.3s ease-out forwards;
}

.app-screen.active {
    display: flex;
}

/* Global Typography & Layout Elements */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.scroll-form, .home-scroll-area, .results-scroll-content, .first-aid-scroll, .faq-scroll, .compilation-scroll, .permissions-content, .history-scroll, .healing-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    padding-bottom: 90px; /* Space for bottom nav */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-primary);
}

.btn-outline:active {
    background: rgba(255, 255, 255, 0.05);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-white {
    background: white;
    color: #111827;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}

.link-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.form-input {
    width: 100%;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: white;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
}

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

.text-area {
    min-height: 80px;
    resize: none;
}

/* ==========================================================================
   SCREEN 1: SPLASH SCREEN
   ========================================================================== */
#screen-splash {
    justify-content: center;
    align-items: center;
}

.splash-logo {
    text-align: center;
    margin-bottom: 40px;
}

.splash-logo svg {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
}

.splash-logo h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.splash-logo p {
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 11px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-secondary);
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   SCREEN 2: ONBOARDING CAROUSEL
   ========================================================================== */
.onboarding-carousel {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-image {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.slide-icon {
    width: 72px;
    height: 72px;
}

.slide-icon.comfort { color: var(--color-secondary); }
.slide-icon.warning { color: hsl(25, 85%, 50%); }
.slide-icon.primary { color: var(--color-primary); }

.carousel-slide h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.dot.active {
    background: var(--color-secondary);
    width: 24px;
    border-radius: 4px;
}

.onboarding-controls {
    padding: 0 40px 40px 40px;
}

/* ==========================================================================
   SCREEN 3: PERMISSIONS SCREEN
   ========================================================================== */
.permissions-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.section-desc {
    margin-bottom: var(--spacing-md);
}

.permission-item {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.permission-meta {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.perm-icon {
    color: var(--color-secondary);
    width: 28px;
    height: 28px;
}

.permission-item h3 {
    font-size: 15px;
    margin-bottom: 2px;
}

.permission-item p {
    font-size: 11px;
    color: var(--color-text-muted);
}

.screen-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-card-border);
}

/* ==========================================================================
   SCREEN 4: AUTHENTICATION SCREEN
   ========================================================================== */
.auth-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-lg);
}

.auth-header svg {
    color: var(--color-primary);
    margin-bottom: 20px;
}

.auth-header h2 {
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
}

.auth-options {
    padding: 0 var(--spacing-lg) 20px var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.btn-auth {
    font-size: 14px;
    font-family: var(--font-primary);
}

.btn-google {
    background: white;
    color: #111827;
}

.btn-apple {
    background: black;
    color: white;
}

.btn-email {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: var(--spacing-sm) 0;
}

.auth-divider span {
    background: var(--color-dark-bg);
    padding: 0 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    position: relative;
    z-index: 2;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-card-border);
    z-index: 1;
}

.legal-footer {
    font-size: 10px;
    text-align: center;
    color: var(--color-text-muted);
    padding: 0 var(--spacing-lg) 30px var(--spacing-lg);
}

.legal-footer a {
    color: var(--color-text-secondary);
    text-decoration: underline;
}

/* ==========================================================================
   SCREEN 5: HOME DASHBOARD
   ========================================================================== */
.home-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-card-border);
}

.user-greeting {
    display: flex;
    flex-direction: column;
}

.greeting-sub {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.greeting-main {
    font-size: 18px;
}

.btn-emergency-top {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    animation: pulsesoft 1.5s infinite;
}

/* Pet profile horizontal scroller */
.pet-profiles-carousel {
    margin-bottom: var(--spacing-md);
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-title-bar h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.profiles-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.profile-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 65px;
    cursor: pointer;
}

.bubble-avatar {
    width: 52px;
    height: 52px;
    border-radius: 52px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    color: white;
}

.profile-bubble.selected .bubble-avatar {
    border-color: var(--color-secondary);
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
}

.bubble-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* Scan CTA Card */
.scan-cta-card {
    background: linear-gradient(135deg, hsl(215, 60%, 15%) 0%, hsl(170, 50%, 12%) 100%);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.scan-cta-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
}

.scan-cta-card:hover::after {
    transform: translateX(100%);
    transition: transform 1.5s;
}

.scan-cta-content h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.scan-cta-content p {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    max-width: 180px;
}

.scan-cta-graphic {
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-card-border);
}

.scan-cta-graphic i {
    width: 30px;
    height: 30px;
    color: var(--color-secondary);
}

/* Quick Tools Grid */
.quick-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.tool-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: transform 0.2s;
}

.tool-card:active {
    transform: scale(0.97);
}

.tool-icon {
    width: 24px;
    height: 24px;
}

.tool-icon.accent-blue { color: var(--color-primary); }
.tool-icon.accent-teal { color: var(--color-secondary); }

.tool-card span {
    font-size: 13px;
    font-weight: 500;
}

/* History snapshot list */
.snapshot-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-item-row {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.row-pet-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pet-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.row-info h4 {
    font-size: 13px;
}

.row-info span {
    font-size: 10px;
    color: var(--color-text-muted);
}

.severity-pill-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px var(--spacing-md);
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.05);
}

.empty-state i {
    width: 32px;
    height: 32px;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-muted);
}

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

/* ==========================================================================
   NAVIGATION SHELL (BOTTOM NAV)
   ========================================================================== */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--color-card-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 12px;
    z-index: 500;
}

.nav-item {
    background: none;
    border: none;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--color-secondary);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item span {
    font-size: 9px;
    font-weight: 500;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-card-border);
}

.back-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* ==========================================================================
   SCREEN 7: CAMERA PREVIEW CONTAINER
   ========================================================================== */
.camera-preview-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: black;
}

.video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.target-bounding-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border: 3px dashed var(--color-severity-2); /* Start yellow */
    border-radius: 50%;
    pointer-events: none;
    transition: border-color 0.3s, transform 0.3s;
}

.target-bounding-ring.valid {
    border-color: var(--color-severity-1); /* Turns green when aligned */
    border-style: solid;
    transform: translate(-50%, -50%) scale(1.05);
}

.edge-assist-toast {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--color-card-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    transition: opacity 0.2s;
}

.simulator-debug-panel {
    position: absolute;
    top: var(--spacing-lg);
    left: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
}

.sim-pill-group {
    display: flex;
    gap: 6px;
}

.sim-pill {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-text-secondary);
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
}

.sim-pill.active {
    background: var(--color-secondary);
    color: black;
    font-weight: 600;
}

.camera-back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.camera-footer {
    background: #000;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.camera-guide-text {
    text-align: center;
}

.camera-guide-text p {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.shutter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
}

.photo-thumbnail-holder {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.thumb-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-secondary);
    color: black;
    width: 16px;
    height: 16px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-shutter-btn {
    width: 68px;
    height: 68px;
    border-radius: 34px;
    background: white;
    padding: 4px;
    border: none;
    cursor: pointer;
}

.shutter-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    border: 2px solid black;
}

.angle-selector-pill {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================================================
   SCREEN 8: COMPILATION
   ========================================================================== */
.compilation-desc {
    margin-bottom: var(--spacing-md);
}

.angle-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.angle-item-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
}

.angle-image-container {
    height: 120px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.angle-meta {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.angle-meta span {
    font-size: 12px;
    font-weight: 500;
}

.status-icon {
    width: 16px;
    height: 16px;
}

.status-icon.green { color: var(--color-severity-1); }
.status-icon.grey { color: var(--color-text-muted); }

.sandbox-form {
    background: rgba(59, 130, 246, 0.05);
    border: 1px dashed rgba(59, 130, 246, 0.2);
    padding: 12px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   SCREEN 9: ANALYSIS SCREEN
   ========================================================================== */
.analysis-loading-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    text-align: center;
}

.pipeline-loader {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--color-secondary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    animation: spin 1.5s linear infinite;
}

.loader-inner-circle {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-bottom-color: var(--color-primary);
    animation: spinReverse 2s linear infinite;
}

.loader-central-icon {
    color: var(--color-secondary);
    width: 28px;
    height: 28px;
    animation: pulsesoft 2s ease-in-out infinite;
}

.analysis-loading-wrapper h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.pipeline-status {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

.pipeline-steps-list {
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: left;
}

.step-line-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 12px;
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.step-line-item.active {
    color: var(--color-text-primary);
}

.step-line-item.active i {
    color: var(--color-secondary);
}

.step-line-item.done {
    color: var(--color-text-secondary);
}

.step-line-item.done i {
    color: var(--color-severity-1);
}

.step-line-item i {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   SCREEN 10: RESULTS SCREEN
   ========================================================================== */
.results-top-banner {
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md) var(--spacing-md);
    position: relative;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Severity Theme Background Gradients */
.banner-severity-1 { background: linear-gradient(135deg, hsl(145, 65%, 20%) 0%, #0b0f19 100%); border-bottom: 2px solid var(--color-severity-1); }
.banner-severity-2 { background: linear-gradient(135deg, hsl(45, 85%, 15%) 0%, #0b0f19 100%); border-bottom: 2px solid var(--color-severity-2); }
.banner-severity-3 { background: linear-gradient(135deg, hsl(25, 85%, 15%) 0%, #0b0f19 100%); border-bottom: 2px solid var(--color-severity-3); }
.banner-severity-4 { background: linear-gradient(135deg, hsl(0, 75%, 15%) 0%, #0b0f19 100%); border-bottom: 2px solid var(--color-severity-4); }
.banner-severity-5 { background: linear-gradient(135deg, hsl(340, 85%, 10%) 0%, #0b0f19 100%); border-bottom: 2px solid var(--color-severity-5); }

.results-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-sm);
}

.close-x-btn {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.severity-rating-title {
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.results-top-banner h1 {
    font-size: 38px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.results-top-banner h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.metric-row {
    display: flex;
    gap: 8px;
}

.metric-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-badge i {
    width: 14px;
    height: 14px;
}

.detail-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.detail-card h3 {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.rec-alert-box {
    display: flex;
    gap: var(--spacing-sm);
    padding: 12px;
    border-radius: var(--radius-sm);
}

/* Rec Box Colors based on severity */
.rec-box-severity-1 { background: rgba(16, 185, 129, 0.1); border-left: 3px solid var(--color-severity-1); }
.rec-box-severity-2 { background: rgba(245, 158, 11, 0.1); border-left: 3px solid var(--color-severity-2); }
.rec-box-severity-3 { background: rgba(249, 115, 22, 0.1); border-left: 3px solid var(--color-severity-3); }
.rec-box-severity-4 { background: rgba(239, 68, 68, 0.1); border-left: 3px solid var(--color-severity-4); }
.rec-box-severity-5 { background: rgba(127, 29, 29, 0.2); border-left: 3px solid var(--color-severity-5); }

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-icon.green { color: var(--color-severity-1); }
.alert-icon.orange { color: var(--color-severity-3); }

.rec-alert-box h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.rec-alert-box p {
    font-size: 12px;
}

.warning-card {
    border-color: rgba(239, 68, 68, 0.2);
}

.warning-card ul {
    list-style: none;
}

.warning-card li {
    font-size: 13px;
    color: var(--color-text-secondary);
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
}

.warning-card li::before {
    content: '•';
    color: #ef4444;
    position: absolute;
    left: 4px;
    font-size: 16px;
}

.disclaimer-text {
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

.disclaimer-text p {
    font-size: 10px;
    color: var(--color-text-muted);
}

.results-bottom-actions {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-card-border);
    display: flex;
    gap: var(--spacing-sm);
}

.results-bottom-actions .btn {
    flex: 1;
}

/* ==========================================================================
   SCREEN 11: FIRST AID PROTOCOL
   ========================================================================== */
.triage-urgency-strip {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
}

.first-aid-intro {
    margin-bottom: var(--spacing-md);
}

.checklist-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.check-item {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    cursor: pointer;
    align-items: flex-start;
}

.check-item.done {
    opacity: 0.6;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.check-item.done .checkbox-custom {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: black;
}

.check-text h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.check-item.done .check-text h4 {
    text-decoration: line-through;
}

.check-text p {
    font-size: 11px;
}

/* ==========================================================================
   SCREEN 12: EMERGENCY MODE SCREEN
   ========================================================================== */
.emergency-wrapper {
    flex: 1;
    background: radial-gradient(circle, hsl(0, 80%, 15%) 0%, var(--color-dark-bg) 80%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    text-align: center;
}

.emergency-icon-ring {
    width: 100px;
    height: 100px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.pulse-emergency-icon {
    width: 48px;
    height: 48px;
    color: #ef4444;
    animation: pulsesoft 1s infinite alternate;
}

.emergency-wrapper h1 {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #fca5a5;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.emergency-wrapper h2 {
    font-size: 26px;
    margin-bottom: var(--spacing-md);
}

.emergency-warning-desc {
    font-size: 13px;
    color: #fca5a5;
    margin-bottom: 30px;
    max-width: 280px;
}

.emergency-vet-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
}

.vet-card-meta {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.vet-card-meta i {
    color: #ef4444;
    width: 24px;
    height: 24px;
}

.vet-card-meta h3 {
    font-size: 14px;
    margin-bottom: 2px;
}

.vet-card-meta p {
    font-size: 11px;
}

.btn-link {
    background: none;
    border: none;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

/* ==========================================================================
   SCREEN 14: HEALING TRACKER
   ========================================================================== */
.healing-selector-box {
    margin-bottom: var(--spacing-md);
}

.healing-comparison-frame {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.comparison-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comparison-half .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 700;
}

.comp-img-placeholder {
    height: 140px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.comp-img-placeholder i {
    width: 32px;
    height: 32px;
}

.healing-trend-badge {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    color: var(--color-secondary);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: var(--spacing-md);
}

.healing-trend-badge.inline-flex {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.healing-trend-badge i {
    width: 18px;
    height: 18px;
}

.healing-graph-box {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.healing-graph-box h4 {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.mock-graph {
    height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: 20px;
}

.graph-bar {
    width: 30px;
    background: var(--color-secondary);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    position: relative;
    opacity: 0.8;
}

.day-lbl {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--color-text-muted);
}

/* ==========================================================================
   SCREEN 15: FAQ
   ========================================================================== */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.faq-item {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-question span {
    font-size: 13px;
    font-weight: 600;
}

.faq-question i {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.faq-item.open .faq-question i {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
}

.legal-notice-box {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.legal-notice-box h4 {
    color: var(--color-severity-2);
    font-size: 13px;
    margin-bottom: 4px;
}

.legal-notice-box p {
    font-size: 11px;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinReverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes pulsesoft {
    0% { opacity: 0.6; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.02); }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}
