:root {
    --varsys-gold: #FFCA13;
    --emergency-red: #E31E24;
    --text-dark: #333;
    --text-gray: #8E8E93;
    --bg-light: #F9F9F9;
    --card-bg: #FFFFFF; /* Default card color */
}

/* Pag naka-dark mode */
body.dark-mode {
    --bg-light: #121212;
    --text-dark: #FFFFFF;
    --text-gray: #AEAEB2;
    --card-bg: #1C1C1E; /* Dark gray para sa cards */
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #1e1e1e;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    /* FIX: Set strict boundary using 100dvh to prevent body scroll */
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
}

.app-shell {
    width: 100%;
    max-width: 430px;
    /* FIX: Use 100% of the strictly defined body height */
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    /* FIX: Added safe area top padding so the header doesn't hide behind mobile status bars */
    padding-top: env(safe-area-inset-top);
}

/* Animation para sa pagpasok (Entry) ng content */
@keyframes dissolveIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Ang content-area lang ang mag-a-animate */
.content-area {
    animation: dissolveIn 0.4s ease-in-out;
    /* Siguraduhing may overflow-y: auto para scrollable pa rin */
    overflow-y: auto;
}

/* Exit Animation para sa content lamang */
.dissolve-out-content {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* HEADER */
header {
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    z-index: 100;
}

.header-left { 
    display: flex;
    align-items: center; 
    gap: 5px; 
}


.header-title { 
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

#delete-mode-btn { background: none; border: none; font-size: 1.2rem; color: var(--text-dark); cursor: pointer; }
#delete-mode-btn.active { color: var(--emergency-red); transform: scale(1.1); }
/* CONTENT AREA */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    /* FIX: Add bottom padding so content doesn't hit the very bottom */
    padding-bottom: 40px; 
    background-color: var(--bg-light);
    position: relative;
    scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }

h1 { font-size: 24px; font-weight: 800; margin-bottom: 20px; color: var(--text-dark); }

.reports-container {
    position: relative;
    min-height: 100%;
}

.claims-tabs {
    display: flex;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.claim-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-weight: 700;
    color: #666;
    border-radius: 10px;
}

.claim-tab.active {
    background: var(--varsys-gold);
    color: #000;
}

.claim-card-new {
    background: #fff;
    border: 1px solid #FFCA13; /* Gold outline gaya ng sa image */
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
}

.claim-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.model-logo { width: 50px; }
.model-info h3 { font-size: 1.1rem; margin: 0; }
.model-info small { color: #888; }

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
}

.status-badge.processing { background: #FFD644; color: #000; }
.status-badge.completed { background: #2ecc71; color: #fff; }

.claim-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
    margin-top: 15px;
}

.info-block .val { display: block; font-weight: 700; color: #333; }
.info-block .lbl { font-size: 0.75rem; color: #888; }

.view-details-link {
    text-align: center;
    margin-top: 15px;
    color: #aaa;
    font-size: 0.85rem;
    font-weight: 600;
}
/* WATERMARK */
.watermark {
    position: fixed;
    top: 48%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0.07;
    pointer-events: none;
    z-index: 1;
    width: 80%;
}
.watermark img { width: 100%; max-width: 250px; filter: grayscale(1); }
.watermark span { display: block; font-size: 32px; font-weight: 900; color: #000; margin-top: 5px; }

/* --- CLAIM CARD STYLE --- */
.claim-card {
    background: white; border-radius: 20px; padding: 20px; margin-bottom: 16px;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid #F0F0F0; box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s; cursor: pointer; position: relative; overflow: hidden;
}

.claim-card:active { transform: scale(0.98); }

/* --- 7. DELETE MODE --- */
.report-card.delete-mode { padding-right: 70px; border: 1px solid var(--emergency-red) !important; }
.delete-overlay {
    position: absolute; top: 0; right: 0; height: 100%; width: 60px;
    background: var(--emergency-red); display: none;
    justify-content: center; align-items: center; color: white;
    border-radius: 0 18px 18px 0;
}
.report-card.delete-mode .delete-overlay { display: flex; }

.claim-card.delete-mode .delete-overlay { display: flex; }
.claim-card.delete-mode { border-color: #ff4444; }

.card-left { display: flex; flex-direction: column; gap: 6px; }
.claim-id-label { font-size: 0.65rem; font-weight: 600; color: #FFCA13; text-transform: uppercase; letter-spacing: 0.5px; }
.claim-title { font-size: 1rem; font-weight: 600; color: #1A1A1A; }
.claim-meta { font-size: 0.75rem; color: #888; font-weight: 500; }

/* Alignment fix para sa card-right container */
.card-right { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    justify-content: center;
    gap: 12px; 
}

.card-right i {
    color: #CCC;
    font-size: 0.9rem;
}

/* Status Badges */
.status-pill {
    font-size: 0.6rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px; 
    line-height: 1;
}
.status-pill i {
    font-size: 0.75rem;
    width: auto;
    display: block;
}
.status-pill.processing { background: #FFF9E6; color: #D4AF37; }
.status-pill.completed { background: #E8F5E9; color: #2ecc71; }

/* --- DELETE MODAL STYLING --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
    display: none; justify-content: center; align-items: center;
    z-index: 10000; padding: 20px;
}

.modal-card {
    background: white; width: 100%; max-width: 320px;
    border-radius: 25px; padding: 30px; text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-icon {
    width: 60px; height: 60px; background: #fff5f5; color: #e31e24;
    font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; margin: 0 auto 20px;
}

.modal-card h3 { font-weight: 800; margin-bottom: 10px; color: #1a1a1a; font-family: 'Montserrat'; }
.modal-card p { font-size: 0.85rem; color: #666; line-height: 1.5; margin-bottom: 25px; }

.modal-actions { display: flex; gap: 12px; }
.modal-actions button {
    flex: 1; padding: 14px; border-radius: 12px; border: none;
    font-weight: 700; font-family: 'Montserrat'; font-size: 0.8rem; cursor: pointer;
    transition: 0.2s;
}

.btn-cancel { background: #f2f2f7; color: #8e8e93; }
.btn-confirm-delete { background: #e31e24; color: white; }
.btn-confirm-delete:active { transform: scale(0.95); background: #c1181d; }

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.bounce-in { animation: bounceIn 0.3s ease-out; }

.report-section {
    margin-top: 10px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.report-section i {
    font-size: 1.4rem;
   color: var(--text-gray);
    animation: bounceUp 2s infinite;
    margin-bottom: -10px;
}

.report-section i:last-of-type {
    margin-bottom: 5px;
}

.report-text {
font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-gray);
    margin-top: 4px;
}

/* Navigation Container */
nav {
    height: 80px; /* Panatilihin ang base height */
    background: #F9F9F9;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #EDEDED;
    
    /* ITO ANG PINAKAMALAKING PAGBABAGO */
    /* Magdadagdag tayo ng padding para umangat ang nav bar mula sa ilalim */
    padding-bottom: max(50px, env(safe-area-inset-bottom));
    
    /* Dagdagan ang height para magkasya ang padding sa loob */
    height: calc(100px + max(20px, env(safe-area-inset-bottom)));
    
    z-index: 1000;
}
/* Consistent Nav Item */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8E8E93;
    flex: 1;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
}

/* Icons: Consistent Size & Alignment */
.nav-item i {
    font-size: 1.3rem;
    height: 30px; 
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    transition: color 0.3s ease;
}

/* Labels: Consistent Font Size */
.nav-item span {
    font-size: 10px;   /* Fixed font size: saktong-sakto sa mobile */
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    transition: color 0.3s ease;
}


/* --- ACTIVE STATE (Consistent Colors) --- */
.nav-item.active {
    color: #FFCA13; /* Varsys Gold */
}

.nav-item.active i, 
.nav-item.active span {
    color: #FFCA13;
    font-weight: 700;
}

/* --- BADGE: Consistent Position --- */
.badge {
    position: absolute;
    top: 10px;
    right: 20%; 
    background: #FF3B30;
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #F9F9F9;
    z-index: 2;
}

.emergency-wrapper {
    position: relative;
    top: -25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.emergency-btn {
    width: 68px;
    height: 68px;
    text-decoration: none;
    background-color: var(--emergency-red);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    transition: transform 0.2s active;
}

.emergency-btn:active {
    transform: scale(0.9);
}

.emergency-text {
    color: var(--emergency-red);
    font-weight: 800;
    font-size: 0.6rem;
    margin-top: 8px;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', sans-serif;;
}

/* --- PAGE TRANSITION ANIMATION --- */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);    
    }
}

.content-area {
    animation: slideUpFade 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    will-change: transform, opacity;
}

.page-exit {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in;
}

/* Dark Mode Support */
body.dark-mode .app-shell {
    background-color: #121212;
}

body.dark-mode header {
    background-color: #121212;
    border-bottom: 1px solid #2C2C2E;
}

body.dark-mode .header-title {
    color: #FFFFFF;
}

body.dark-mode .content-area {
    background-color: #121212;
}

body.dark-mode .claim-card,
body.dark-mode .report-card {
    background-color: var(--card-bg);
    border: 1px solid #2C2C2E;
}

body.dark-mode .claim-title,
body.dark-mode .card-details h3 {
    color: #FFFFFF;
}

body.dark-mode .report-card.unread {
    border: 1.5px solid var(--varsys-gold);
}

body.dark-mode .card-details p,
body.dark-mode .card-details small {
    color: #AEAEB2;
}

body.dark-mode .modal-card { 
    background: #1C1C1E; 
    color: white; 
}
body.dark-mode .modal-card h3 { 
    color: #FFFFFF; 
}

/* Tabs sa Dark Mode */
body.dark-mode .tab-btn {
    color: #FFFFFF;
}

body.dark-mode .tab-btn.active {
    background-color: var(--varsys-gold);
    color: #000000;
}

/* Nav sa Dark Mode */
body.dark-mode nav {
    background: #121212;
    border-top: 1px solid #2C2C2E;
}

body.dark-mode .nav-item.active {
    background: #1C1C1E;
}

/* Watermark sa Dark Mode */
body.dark-mode .watermark {
    opacity: 0.05; 
}

body.dark-mode .watermark span {
    color: #FFFFFF;
}