/* ========================================================
   Adv. Javed Mirza Law Practice Case Management - App Styles
   Total Mobile App Experience: Colorful, Ultra-Modern & Professional
   ======================================================== */

:root {
    /* Brand & Dark Base */
    --primary: #0f172a;
    --primary-dark: #020617;
    --surface-dark: #1e293b;
    
    /* Vibrant Semantic Accents */
    --amber-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --indigo-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);

    /* Page & Surface Colors */
    --bg-page: #f1f5f9;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.88);
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Metrics & Spacing */
    --bottom-nav-height: 68px;
    --header-height: 60px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-full: 9999px;
    
    /* Shadow Profiles */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 10px 25px -3px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
    --shadow-colored-amber: 0 8px 20px -3px rgba(245, 158, 11, 0.35);
    --shadow-colored-rose: 0 8px 20px -3px rgba(244, 63, 94, 0.35);
    --shadow-colored-indigo: 0 8px 20px -3px rgba(99, 102, 241, 0.35);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.app-body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + 24px);
    overflow-x: hidden;
}

/* ========================================================
   Header (App Bar)
   ======================================================== */
.app-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #ffffff;
    z-index: 1040;
    border-bottom: 2px solid #f59e0b;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
}

.brand-avatar {
    width: 40px;
    height: 40px;
    background: var(--amber-gradient);
    color: #0f172a;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: var(--shadow-colored-amber);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.15;
    margin: 0;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #cbd5e1;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-weight: 600;
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 4px;
    box-shadow: 0 0 8px #10b981;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ========================================================
   App Main Container
   ======================================================== */
.app-main {
    max-width: 960px;
    margin: 0 auto;
}

/* ========================================================
   Modern Cards
   ======================================================== */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:active {
    transform: scale(0.99);
}

.app-card-interactive:hover {
    box-shadow: var(--shadow-hover);
}

.card-title-lg {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

/* ========================================================
   Vibrant Colorful KPI Metrics Grid
   ======================================================== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

@media (min-width: 768px) {
    .metric-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

.metric-card-gradient {
    border-radius: var(--radius-md);
    padding: 16px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card-gradient:active {
    transform: scale(0.96);
}

.metric-card-gradient.metric-amber {
    background: var(--amber-gradient);
    box-shadow: var(--shadow-colored-amber);
}

.metric-card-gradient.metric-indigo {
    background: var(--indigo-gradient);
    box-shadow: var(--shadow-colored-indigo);
}

.metric-card-gradient.metric-emerald {
    background: var(--emerald-gradient);
    box-shadow: 0 8px 20px -3px rgba(16, 185, 129, 0.35);
}

.metric-card-gradient.metric-rose {
    background: var(--rose-gradient);
    box-shadow: var(--shadow-colored-rose);
}

.metric-card-gradient .metric-icon-bg {
    position: absolute;
    right: -8px;
    bottom: -10px;
    font-size: 4rem;
    opacity: 0.18;
    transform: rotate(-10deg);
}

.metric-card-gradient .metric-num {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
}

.metric-card-gradient .metric-lbl {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.95;
}

/* ========================================================
   Filter Chips & Segmented Controls
   ======================================================== */
.filter-scroll-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.filter-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    background: #ffffff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-chip:hover {
    color: var(--primary);
    background: #f8fafc;
}

.filter-chip.active {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

/* Purpose Quick Chips */
.purpose-chip {
    display: inline-block;
    padding: 4px 10px;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin: 2px;
    transition: background 0.15s;
    user-select: none;
}

.purpose-chip:hover, .purpose-chip:active {
    background: #cbd5e1;
    color: #0f172a;
}

/* ========================================================
   Colorful Case Types & Status Badges
   ======================================================== */
.badge-case-type {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-case-criminal { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.badge-case-civil { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-case-bail { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-case-writ { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-case-family { background: #fae8ff; color: #86198f; border: 1px solid #f5d0fe; }
.badge-case-commercial { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-case-cheque { background: #cffafe; color: #0e7490; border: 1px solid #a5f3fc; }

.badge-court {
    background-color: #f1f5f9;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.badge-stage {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid #bfdbfe;
}

/* Pulse animation for Action Required */
.animate-pulse {
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.97); }
}

/* ========================================================
   Action Callouts (Senior Instructions & Court Reports)
   ======================================================== */
.instruction-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #78350f;
    font-size: 0.85rem;
    line-height: 1.45;
}

.court-report-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-left: 5px solid #10b981;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #14532d;
    font-size: 0.85rem;
    line-height: 1.45;
}

/* ========================================================
   Modern Interactive Timeline
   ======================================================== */
.timeline {
    position: relative;
    padding-left: 28px;
    margin-top: 14px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 10px;
    width: 2px;
    background: linear-gradient(to bottom, #f59e0b, #3b82f6, #10b981);
}

.timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
    z-index: 2;
}

.timeline-dot.attended {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    background: #10b981;
}

.timeline-dot.scheduled {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background: #ffffff;
}

/* ========================================================
   Mobile Bottom Navigation Bar (Glassmorphic)
   ======================================================== */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.app-bottom-nav .nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.app-bottom-nav .nav-item:active i {
    transform: scale(0.9);
}

.app-bottom-nav .nav-item.active {
    color: #f59e0b;
}

.app-bottom-nav .nav-item.active i {
    transform: translateY(-2px) scale(1.12);
    color: #d97706;
}

/* Floating Center Plus Action Button */
.nav-center-item {
    position: relative;
    top: -14px;
}

.nav-center-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--amber-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
    border: 3px solid #ffffff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-center-btn:active {
    transform: scale(0.92);
}

/* Floating Action Button (FAB) */
.fab-btn {
    position: fixed;
    right: 20px;
    bottom: calc(var(--bottom-nav-height) + 16px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--amber-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    z-index: 1020;
    text-decoration: none;
    border: 2px solid #ffffff;
    transition: transform 0.2s;
}

.fab-btn:active {
    transform: scale(0.92);
}

/* Touch Friendly Buttons */
.btn-mobile-lg {
    padding: 12px 20px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

/* Direct Action Buttons: WhatsApp & Call */
.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
    border: none;
    font-weight: 700;
}

.btn-whatsapp:hover, .btn-whatsapp:active {
    background: #128c7e;
    color: #ffffff;
}

.btn-call {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    font-weight: 700;
}

.btn-call:hover, .btn-call:active {
    background: #2563eb;
    color: #ffffff;
}

/* Print View */
@media print {
    .app-header, .app-bottom-nav, .fab-btn, .btn, .no-print {
        display: none !important;
    }
    body.app-body {
        padding: 0 !important;
        background: #ffffff !important;
    }
    .app-card {
        box-shadow: none !important;
        border: 1px solid #000000 !important;
        page-break-inside: avoid;
    }
}
