/* ==========================================================
   Modern Mobile-First Staff Attendance Portal Theme
   Optimized for Android & iOS Touch Devices and Desktop
   ========================================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --accent-gradient: linear-gradient(135deg, #0d6efd 0%, #0043a8 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --card-bg: #ffffff;
    --app-bg: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 15px 35px rgba(15, 23, 42, 0.1);
}

body {
    background-color: var(--app-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 75px; /* Space for mobile bottom navigation */
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
}

.main-content {
    flex: 1 0 auto;
}

/* App Header Card for Mobile */
.mobile-hero-header {
    background: var(--primary-gradient);
    border-radius: 0 0 1.75rem 1.75rem;
    padding: 1.75rem 1.25rem 2rem 1.25rem;
    color: #fff;
    box-shadow: 0 10px 25px rgba(30, 60, 114, 0.25);
    margin-bottom: -1.25rem;
    position: relative;
    z-index: 2;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.live-digital-clock {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Roboto", monospace;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
}

.clock-subtext {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Big Central Punch Button */
.punch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}

.punch-circle-btn {
    width: 175px;
    height: 175px;
    border-radius: 50%;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.punch-circle-btn:active {
    transform: scale(0.94);
}

.punch-circle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none !important;
}

.punch-in-btn {
    background: var(--success-gradient);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

.punch-in-btn:not(:disabled):hover {
    box-shadow: 0 15px 35px rgba(40, 167, 69, 0.6);
    transform: translateY(-2px);
}

.punch-out-btn {
    background: var(--danger-gradient);
    box-shadow: 0 10px 30px rgba(235, 51, 73, 0.4);
}

.punch-out-btn:not(:disabled):hover {
    box-shadow: 0 15px 35px rgba(235, 51, 73, 0.6);
    transform: translateY(-2px);
}

/* Pulsing Radar Ring */
.radar-pulse-green::before {
    content: '';
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 50%;
    border: 2px solid #28a745;
    animation: radarPulse 2s infinite;
    opacity: 0;
}

.radar-pulse-red::before {
    content: '';
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 50%;
    border: 2px solid #dc3545;
    animation: radarPulse 2s infinite;
    opacity: 0;
}

@keyframes radarPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    70% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(1.15); opacity: 0; }
}

/* Status Chips and Indicators */
.chip-status {
    padding: 0.5rem 0.85rem;
    border-radius: 50rem;
    font-size: 0.825rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.chip-success {
    background: #dcfce7;
    color: #166534;
}

.chip-danger {
    background: #fee2e2;
    color: #991b1b;
}

.chip-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Geofence Radar Card */
.geofence-card {
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
    background: #fff;
}

/* Mini Map Container */
#attendance-map {
    height: 220px;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    z-index: 1;
}

@media (min-width: 768px) {
    #attendance-map {
        height: 280px;
    }
}

/* Quick Metrics Row */
.mini-stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.85rem;
    text-align: center;
    transition: background 0.2s;
}

.mini-stat-box .title {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.mini-stat-box .val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.725rem;
    font-weight: 600;
    flex: 1;
    padding: 0.4rem 0;
    transition: color 0.2s ease;
}

.mobile-nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.mobile-nav-item.active {
    color: #0d6efd;
}

.mobile-nav-item:hover {
    color: #0d6efd;
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Status Badges */
.badge-present { background-color: #d1e7dd; color: #0f5132; }
.badge-late { background-color: #fff3cd; color: #664d03; }
.badge-absent { background-color: #f8d7da; color: #842029; }
.badge-completed { background-color: #cff4fc; color: #055160; }
