:root {
    --pal-red: #CE1126;
    --pal-green: #007A3D;
    --pal-black: #000000;
    --pal-white: #FFFFFF;
    
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #6c757d;
    --gold: #ffc107;
    
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color); /* Ensure body has background color */
    color: var(--text-main);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed; /* Use fixed to keep it in place during scroll */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Palestine.svg');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    opacity: 0.3; /* Very subtle wallpaper */
    z-index: -1;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%); /* Reverted */
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: white;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- HEADER & NAV --- */
.main-header {
    background-color: white;
    border-bottom: 1px solid #eee;
    padding: 20px;
    text-align: center;
}

.logo-circle {
    width: 60px;
    height: 60px;
    background: var(--pal-black);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border: 3px solid var(--pal-red);
}

.logo-text {
    font-family: var(--font-head);
    font-weight: 900;
    letter-spacing: 1px;
}

.top-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    color: var(--pal-red);
    border-bottom-color: var(--pal-red);
}

/* --- HERO & FLAG MASK (UPDATED) --- */
.hero-text-container {
    position: relative;
    z-index: 1;
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -20px; /* Pull it up slightly to remove gap with header */
    padding-top: 40px; /* Adjust padding to compensate */
    padding-bottom: 60px; /* Keep some bottom padding */
    color: var(--text-main);
    text-align: center;
    height: 350px; /* Fixed height for the banner */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Move text higher */
}

.hero-text-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Palestine.svg');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: -1;

    mask-image: linear-gradient(to bottom, black 30%, transparent 85%); /* Fade starts earlier */
}

.flag-text {
    position: relative;
    z-index: 1;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 2.5rem;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 5px;
    color: var(--pal-red);
    letter-spacing: 1px;
    /* Wider solid white border effect */
    text-shadow: 
        -2px -2px 0 #fff,  
         2px -2px 0 #fff,
        -2px  2px 0 #fff,
         2px  2px 0 #fff,
        -2px  0px 0 #fff,
         2px  0px 0 #fff,
         0px -2px 0 #fff,
         0px  2px 0 #fff;
}

.subtitle {
    position: relative;
    z-index: 1;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    /* Solid white border effect */
    text-shadow: 
        -1px -1px 0 #fff,  
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

/* --- STATS DASHBOARD --- */
main { padding: 20px; flex: 1; position: relative; }

.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: -180px; /* The Magic Move: Pulls cards up */
    position: relative;
    z-index: 10; /* Ensure cards sit on top of the flag */
    background: transparent; /* Grid container itself is transparent */
}

.stat-card {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    text-align: center;
}

.stat-label { font-size: 0.7rem; text-transform: uppercase; font-weight: 700; color: #999; }
.stat-value { font-family: var(--font-head); font-weight: 800; font-size: 1.8rem; color: var(--text-main); }
.main-stat .stat-value { color: var(--pal-red); }

.progress-bar-bg {
    height: 8px; background: #eee; border-radius: 4px; margin: 8px 0; overflow: hidden;
}
.progress-bar-fill {
    height: 100%; background: var(--pal-green); width: 0%; transition: width 1s ease-out;
}
.small-text { font-size: 0.75rem; color: var(--text-muted); }

/* --- PROCESS SECTION (HOW IT WORKS) --- */
.process-section {
    background: #fff9fa;
    padding: 20px;
    border-radius: 16px;
    border: 1px dashed var(--pal-red);
    margin-bottom: 30px;
}

.process-section h3 {
    text-align: center; font-size: 1rem; color: var(--pal-red); margin-bottom: 15px;
}

.process-steps {
    display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px;
}

.step {
    display: flex; align-items: center; gap: 15px;
}

.step-icon {
    width: 40px; height: 40px; background: white;
    border-radius: 50%; border: 2px solid #eee;
    display: flex; align-items: center; justify-content: center;
    color: var(--pal-green); font-size: 1.1rem; flex-shrink: 0;
}

.step-text strong { display: block; font-size: 0.9rem; color: var(--text-main); }
.step-text p { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.3; }

.action-group {
    display: flex; flex-direction: column; gap: 10px;
}

/* --- BUTTONS --- */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px; border-radius: 8px; text-decoration: none;
    font-weight: 700; font-family: var(--font-head);
    border: none; cursor: pointer; width: 100%; transition: all 0.2s;
}

.btn-primary { background: var(--pal-red); color: white; }
.btn-primary:hover { background: #b00e20; }

.btn-secondary { background: var(--pal-black); color: white; }
.btn-secondary:hover { background: #333; }

.glow-effect { animation: pulse-red 2s infinite; }
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(206, 17, 38, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(206, 17, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(206, 17, 38, 0); }
}

/* --- LEADERBOARD --- */
.leaderboard-header { margin-bottom: 15px; text-align: center; }

#leaderboard-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
#leaderboard-table th { font-size: 0.75rem; color: #999; text-transform: uppercase; padding: 0 10px; text-align: left;}
#leaderboard-table td { background: white; padding: 12px 10px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; font-size: 0.9rem; font-weight: 600;}
#leaderboard-table td:first-child { border-left: 1px solid #eee; border-radius: 8px 0 0 8px; }
#leaderboard-table td:last-child { border-right: 1px solid #eee; border-radius: 0 8px 8px 0; }
.text-right { text-align: right !important; }

/* Winner Row */
.top-society-row td {
    background: linear-gradient(90deg, #fff9e6 0%, #fff 100%) !important;
    border-color: var(--gold) !important;
    color: #b38600;
}

/* --- ACTIVITY TICKER --- */
.activity-ticker-container {
    padding: 20px;
    background: #fdfdfd;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
}

.activity-ticker-container h3 {
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.ticker-items .item {
    font-size: 0.85rem;
    color: var(--text-main);
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.ticker-items .item:last-child {
    border-bottom: none;
}

.ticker-items .item .highlight {
    font-weight: 700;
    color: var(--pal-red);
}

.ticker-items .item .status {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 10px;
}

.status-badge.status-verified {
    background-color: var(--pal-green);
    color: var(--pal-black);
}

.status-badge.status-pending {
    background-color: var(--gold);
    color: var(--pal-black);
}

.log-status-verified {
    color: var(--pal-green);
    font-weight: 700;
}

.log-status-rejected {
    color: var(--pal-red);
    font-weight: 700;
}

/* --- MODAL --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 1000; backdrop-filter: blur(4px);
}
.modal-card {
    background: white; width: 90%; max-width: 400px; margin: 10vh auto; padding: 25px;
    border-radius: 16px; position: relative; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-modal { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #ccc; }
.step-header { text-align: center; margin-bottom: 20px; }
.icon-bg { width: 50px; height: 50px; background: #f0f0f0; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.icon-bg.success { background: #e6f4ea; color: var(--pal-green); }
.input-group { display: flex; align-items: center; background: #f9f9f9; border: 1px solid #eee; border-radius: 8px; padding: 0 12px; margin-bottom: 15px; }
.input-group input { border: none; background: transparent; width: 100%; padding: 12px 0; outline: none; margin-left: 10px;}
.file-upload-wrapper { position: relative; margin-bottom: 15px; overflow: hidden; }
.fake-upload-btn { border: 2px dashed #ccc; padding: 12px; text-align: center; border-radius: 8px; color: #777; font-size: 0.9rem; }
.file-upload-wrapper input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

footer { text-align: center; padding: 30px 20px; font-size: 0.75rem; color: #aaa; margin-top: auto; }

/* Styling for Under Development Page */
.under-development {
    text-align: center;
    padding: 50px 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.development-icon {
    font-size: 3rem;
    color: var(--pal-red);
    margin-bottom: 20px;
}

.under-development h2 {
    font-family: var(--font-head);
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.under-development p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
}