/* style.css - FULLY UPDATED WITH MAP SUPPORT */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --usm-green: #004d25;
    --usm-dark: #002a14;
    --usm-gold: #FFD700;
    --bg-color: #f0f2f5;
    --text-main: #2d3436;
    --text-light: #636e72;
    --danger: #ff4757;
    --success: #2ed573;
    --facebook: #1877F2;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Poppins', sans-serif; color: var(--text-main); overflow-x: hidden; }

/* --- MAP STYLES (NEW) --- */
.map-style {
    height: 250px;
    width: 100%;
    border-radius: 12px;
    border: 2px solid #eee;
    z-index: 1; /* Keeps map below modal overlays */
    margin-bottom: 5px;
    background: #e0e0e0; /* Loading placeholder */
}

/* LOGIN STYLES */
body.login-page {
    background: linear-gradient(135deg, var(--usm-green), var(--usm-dark));
    height: 100vh; width: 100vw; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
}
.circle { position: absolute; border-radius: 50%; opacity: 0.1; z-index: 0; }
.circle-1 { width: 400px; height: 400px; background: var(--usm-gold); top: -100px; left: -100px; }
.circle-2 { width: 500px; height: 500px; border: 4px solid var(--usm-gold); bottom: -150px; right: -150px; }
.login-card {
    background: white; padding: 40px; border-radius: 24px; width: 90%; max-width: 400px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); border-top: 6px solid var(--usm-gold); z-index: 10;
}
.logo-icon { font-size: 3rem; margin-bottom: 10px; }
.google-btn {
    width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 50px; background: white; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 12px; transition: 0.3s;
}
.google-btn:hover { background: #f8f8f8; transform: translateY(-2px); }
.footer { margin-top: 20px; color: rgba(255,255,255,0.6); font-size: 0.8rem; z-index: 10; }

/* DASHBOARD LAYOUT */
body.dashboard-body { background-color: var(--bg-color); }
.dashboard-layout { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* Sidebar */
.sidebar { width: 280px; background: var(--usm-dark); color: white; display: flex; flex-direction: column; padding: 30px 20px; flex-shrink: 0; transition: all 0.3s ease; }
.logo-area { display: flex; align-items: center; gap: 12px; margin-bottom: 50px; color: var(--usm-gold); font-size: 1.4rem; font-weight: 700; }
.nav-links { list-style: none; flex-grow: 1; }
.nav-links li { margin-bottom: 8px; }
.nav-links a { display: flex; align-items: center; gap: 15px; color: rgba(255,255,255,0.6); text-decoration: none; padding: 14px 18px; border-radius: 12px; transition: 0.3s; font-weight: 500; }
.nav-links li.active a, .nav-links a:hover { background: rgba(255, 215, 0, 0.15); color: var(--usm-gold); }
.badge { background: #ff4757; color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; margin-left: auto; }

/* USER FOOTER */
.user-footer { background: rgba(255,255,255,0.05); padding: 15px; border-radius: 15px; display: flex; align-items: center; gap: 12px; }
.nav-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--usm-gold); }
.user-info { flex-grow: 1; overflow: hidden; }
.user-info h4 { font-size: 0.9rem; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: #888; font-size: 0.75rem; }

.footer-actions { display: flex; gap: 8px; }
.footer-actions button { background: transparent; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; transition: 0.2s; padding: 5px; }
.footer-actions button:hover { color: var(--usm-gold); }
#logout-btn { color: #ff6b6b; }
#logout-btn:hover { color: #ff4757; }

/* Main Content */
.main-content { flex-grow: 1; overflow-y: auto; padding: 30px 40px; background: var(--bg-color); }
.top-bar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.welcome-text h1 { font-size: 1.8rem; color: var(--usm-green); margin-bottom: 5px; }
.search-box { background: white; padding: 10px 20px; border-radius: 50px; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-right: 10px; }
.search-box input { border: none; width: 220px; font-family: inherit; }
.top-actions { display: flex; gap: 15px; align-items: center; }

.btn-primary, .btn-secondary { padding: 12px 24px; border-radius: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; white-space: nowrap; }
.btn-primary { background: var(--usm-green); color: white; border: none; box-shadow: 0 5px 15px rgba(0,77,37,0.2); }
.btn-secondary { background: white; color: var(--usm-green); border: 2px solid var(--usm-green); }

/* Stats & Feed */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-bottom: 40px; }
.stat-card { background: white; padding: 25px; border-radius: 20px; display: flex; align-items: center; gap: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.icon-box { width: 60px; height: 60px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.green { background: #e8f5e9; color: var(--usm-green); } .red { background: #ffebee; color: var(--danger); }
.feed-header { display: flex; justify-content: space-between; margin-bottom: 25px; align-items: center; }
.tabs { background: white; padding: 6px; border-radius: 12px; display: flex; gap: 5px; }
.tab { padding: 8px 20px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-light); transition: 0.3s; }
.tab.active { background: var(--usm-green); color: white; }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; padding-bottom: 50px; }
.item-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: all 0.3s ease; border: 1px solid transparent; cursor: pointer; position: relative; }
.item-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); border-color: var(--usm-gold); }
.card-img { width: 100%; height: 200px; object-fit: cover; border-bottom: 1px solid #f0f0f0; }
.card-body { padding: 20px; }
.tag { font-size: 0.7rem; font-weight: 800; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; margin-bottom: 12px; display: inline-block; }
.tag.LOST { background: #ffebee; color: var(--danger); } .tag.FOUND { background: #e8f5e9; color: var(--usm-green); }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 0.85rem; margin-bottom: 6px; }
.mini-tag { font-size: 0.7rem; color: #555; background: #eee; padding: 2px 6px; border-radius: 4px; margin-right: 5px; }

/* MODALS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 42, 20, 0.8); backdrop-filter: blur(5px); z-index: 1000; display: none; justify-content: center; align-items: center; padding: 10px; }
.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0; transform: scale(0.95);} to{opacity:1; transform: scale(1);} }

.modal-box { background: white; width: 100%; max-width: 500px; padding: 35px; border-radius: 20px; box-shadow: 0 30px 60px rgba(0,0,0,0.3); position: relative; max-height: 90vh; overflow-y: auto; }

/* Split Detail Box */
.detail-box { width: 95%; max-width: 900px; height: 80vh; padding: 0; display: flex; overflow: hidden; background: white; }
.detail-img-box { width: 50%; height: 100%; background: #000; display: flex; align-items: center; justify-content: center; }
.detail-img-box img { width: 100%; height: 100%; object-fit: contain; }
.detail-info { width: 50%; height: 100%; padding: 40px; display: flex; flex-direction: column; overflow-y: auto; }
.detail-type { display: inline-block; padding: 5px 12px; font-weight: 800; font-size: 0.8rem; border-radius: 6px; margin-bottom: 15px; }
.detail-h2 { font-size: 1.8rem; font-weight: 700; color: var(--text-main); margin-bottom: 20px; line-height: 1.2; }
.detail-meta { margin-bottom: 25px; color: #666; font-size: 0.95rem; display: flex; flex-direction: column; gap: 10px; }
.detail-desc { line-height: 1.6; color: #444; background: #f9f9f9; padding: 20px; border-radius: 12px; margin-bottom: 20px; border-left: 4px solid var(--usm-gold); }
.detail-actions { margin-top: auto; padding-top: 20px; border-top: 1px solid #eee; display: flex; flex-direction: column; gap: 10px; }

/* Alert & Confirm Styles */
.center-text { text-align: center; }
.icon-circle { width: 60px; height: 60px; background: #e8f5e9; color: var(--usm-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 15px auto; }
.icon-circle.warn { background: #fff3e0; color: #f57c00; }
.action-row { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }
.full-width { width: 100%; justify-content: center; }

/* Buttons & Inputs */
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #888; }
.close-btn-abs { position: absolute; top: 15px; right: 15px; background: white; width: 35px; height: 35px; border-radius: 50%; border: none; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group.full { grid-column: span 2; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 2px solid #eee; border-radius: 10px; font-family: inherit; transition: 0.3s; font-size: 16px; }
.btn-submit { width: 100%; padding: 15px; background: var(--usm-green); color: white; border: none; border-radius: 12px; font-weight: 600; margin-top: 25px; cursor: pointer; transition: 0.3s; }
.btn-facebook { background: var(--facebook); color: white; width: 100%; padding: 12px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: 0.3s; }
.btn-facebook:hover { background: #155db5; }

/* Notification List */
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { padding: 15px; border-bottom: 1px solid #eee; display: flex; flex-direction: column; gap: 10px; }
.notif-item.unread { background: #f0f7ff; border-left: 3px solid var(--usm-green); }
.notif-msg { font-size: 0.9rem; color: #333; }
.notif-time { font-size: 0.75rem; color: #999; }
.notif-actions { display: flex; gap: 10px; }
.btn-small { padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; border: none; cursor: pointer; font-weight: 500; }
.btn-go { background: var(--usm-green); color: white; }
.btn-read { background: #eee; color: #555; }
.notif-user-link { color: var(--usm-green); font-weight: 700; cursor: pointer; text-decoration: underline; margin-right: 5px; }
.notif-user-link:hover { color: var(--usm-gold); }

/* User Profile Popup Styles */
.popup-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 4px solid var(--usm-green); margin-bottom: 10px; }
.popup-role { background: #e8f5e9; color: var(--usm-green); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; display: inline-block; margin-bottom: 20px; }
.profile-details { text-align: left; background: #f9f9f9; padding: 20px; border-radius: 12px; width: 100%; margin-top: 10px; }
.p-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 0.9rem; color: #444; }
.p-row i { color: var(--usm-green); font-size: 1.1rem; }
.p-row:last-child { margin-bottom: 0; }
.btn-row { display: flex; gap: 10px; }
.btn-warning { background: var(--usm-gold); color: var(--usm-dark); }
.btn-warning:hover { background: #e6c200; }

/* -------------------------------------------
   MOBILE RESPONSIVENESS (PHONES & TABLETS)
   ------------------------------------------- */
@media (max-width: 900px) {
    /* Layout: Convert to Column Stack */
    .dashboard-layout { flex-direction: column; height: auto; overflow: visible; }
    
    /* Sidebar: Becomes Top Header */
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: sticky; 
        top: 0; 
        z-index: 900; 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: space-between; 
        align-items: center;
        padding: 10px 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }

    .logo-area { margin-bottom: 0; font-size: 1.2rem; }
    .logo-area h2 { display: none; } /* Hide text on mobile to save space, keep icon */
    .logo-icon { font-size: 1.8rem; margin-bottom: 0; }
    
    /* Nav Links: Row below logo */
    .nav-links { 
        order: 3; 
        width: 100%; 
        display: flex; 
        justify-content: space-around; 
        margin-top: 10px; 
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links a { padding: 8px 12px; font-size: 0.9rem; }
    
    /* User Footer: Compact */
    .user-footer { background: none; padding: 0; width: auto; }
    .user-info { display: none; } /* Hide name on mobile */
    .nav-avatar { width: 35px; height: 35px; border-width: 2px; }
    .footer-actions { margin-left: 10px; }

    /* Main Content: Full Width & Scrollable */
    .main-content { padding: 20px 15px; width: 100%; overflow: visible; }
    
    /* Top Bar: Stack Actions */
    .top-bar { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 25px; }
    .welcome-text { width: 100%; }
    .top-actions { flex-direction: column; width: 100%; gap: 10px; }
    .search-box { width: 100%; margin: 0; }
    .search-box input { width: 100%; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }

    /* Stats Grid: 1 Column */
    .stats-grid { grid-template-columns: 1fr; gap: 15px; }
    
    /* Items Grid: 1 Column */
    .items-grid { grid-template-columns: 1fr; }

    /* Modal Adjustments */
    .modal-box { width: 95%; padding: 25px 20px; }
    .form-grid { grid-template-columns: 1fr; } /* Stack form inputs */
    .form-group.full { grid-column: auto; }
    
    /* Detail Modal: Full Screen Stack */
    .detail-box { 
        flex-direction: column; 
        height: auto; 
        max-height: 90vh; 
        width: 95%;
        border-radius: 15px;
        overflow-y: auto;
    }
    .detail-img-box { width: 100%; height: 250px; background: #000; }
    .detail-info { width: 100%; padding: 25px; height: auto; }
    .close-btn-abs { top: 10px; right: 10px; background: rgba(255,255,255,0.9); }
}