/* ==========================================================================
   EduTrack - School Directory & Visit Management System
   Professional Theme Stylesheet (White & Light-Blue Palette)
   ========================================================================== */

:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --primary-subtle: #f0f9ff;
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #ef4444;

    --bg-body: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --card-border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 16px -4px rgba(2, 132, 199, 0.08), 0 2px 6px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 15px 30px -8px rgba(2, 132, 199, 0.12), 0 4px 10px rgba(0, 0, 0, 0.03);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   SIDEBAR & LAYOUT
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 270px;
    background-color: var(--sidebar-bg);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-header .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.sidebar-header .brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.sidebar-header .brand-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.sidebar-nav {
    list-style: none;
    padding: 16px 12px;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #475569;
    padding: 12px 14px 6px;
}

.nav-item {
    margin-bottom: 3px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover i {
    color: var(--accent-cyan);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.nav-link.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(15, 23, 42, 0.6);
}

/* ==========================================================================
   MAIN CONTENT AREA & TOPBAR
   ========================================================================== */
.main-content {
    margin-left: 270px;
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-container {
    padding: 28px;
    flex-grow: 1;
}

/* ==========================================================================
   CARDS & STATS
   ========================================================================== */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.content-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.content-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--card-border);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.content-card-body {
    padding: 24px;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 20px;
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #075985 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.btn-camera {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 22px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-camera:hover {
    background: #047857;
    color: white;
    transform: translateY(-1px);
}

/* ==========================================================================
   GPS CAMERA VIEWFINDER & WATERMARK PREVIEW
   ========================================================================== */
.gps-camera-card {
    background: #0f172a;
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.viewfinder-box {
    position: relative;
    background: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(56, 189, 248, 0.3);
}

.viewfinder-crosshair {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1.5px dashed rgba(56, 189, 248, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

.gps-badge-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.92) 30%, rgba(15, 23, 42, 0.98) 100%);
    padding: 16px 20px;
    color: #ffffff;
    z-index: 15;
    border-top: 2px solid var(--accent-cyan);
    backdrop-filter: blur(4px);
}

.gps-badge-school {
    font-weight: 800;
    font-size: 1.05rem;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.gps-badge-location {
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

.gps-badge-coords {
    font-size: 0.82rem;
    color: #4ade80;
    font-family: monospace;
    font-weight: 600;
}

.gps-badge-meta {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.custom-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748b;
    background-color: #f8fafc;
    border-top: none;
    padding: 14px 16px;
}

.custom-table td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.custom-table tr:hover td {
    background-color: #f8fafc;
}

.table-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: transform 0.2s;
}

.table-thumb:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   MOBILE BOTTOM BAR & RESPONSIVE
   ========================================================================== */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--card-border);
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1050;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-item {
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: color 0.2s;
}

.mobile-bottom-item i {
    font-size: 1.25rem;
}

.mobile-bottom-item.active {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding-bottom: 65px; /* for mobile bottom bar */
    }
    .mobile-bottom-bar {
        display: flex;
    }
}
