/* GeoAttend - Modern Clean Responsive Stylesheet (100% Offline) */
:root {
    --bg-main: #090d16;
    --bg-card: #131b2e;
    --bg-card-hover: #1a253e;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(59, 130, 246, 0.4);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header & Navigation Bar */
.app-header {
    background: rgba(19, 27, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.25rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-pill {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.status-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-pill.status-online {
    background: var(--success-light);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}
.status-pill.status-online .dot {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.status-pill.status-error {
    background: var(--danger-light);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
.status-pill.status-error .dot {
    background: #f87171;
}

.status-pill.status-offline {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}
.status-pill.status-offline .dot {
    background: #94a3b8;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(11, 15, 25, 0.6);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.nav-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

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

.nav-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

/* Main Container */
.main-wrapper {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem 1rem;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Attendance Layout: 2 Columns on desktop */
.attendance-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 860px) {
    .attendance-grid {
        grid-template-columns: 360px 1fr;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Radar & Proximity Visualizer Card */
.proximity-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.radar-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 1.25rem auto;
    display: flex;
    justify-content: center;
}

#radarCanvas {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 50%;
    background: #020617;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
}

.proximity-info-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-item {
    text-align: left;
}

.info-item-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-item-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2px;
}

.distance-highlight {
    font-size: 1.35rem;
    color: #38bdf8;
}

/* Alert Boxes */
.alert-box {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    align-items: flex-start;
    font-size: 0.9rem;
}

.alert-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.alert-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.alert-body p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.35rem;
}

.alert-body small {
    display: block;
    color: rgba(255, 255, 255, 0.6);
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

/* Forms */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.form-label .req {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(11, 15, 25, 0.9);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.4);
}

/* Radio Button Group */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.radio-card input:checked + .radio-card-body {
    border-color: var(--primary);
    background: var(--primary-light);
    color: #60a5fa;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #334155;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.visible {
    display: flex;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th {
    background: rgba(11, 15, 25, 0.7);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Code Snippets */
.code-block {
    background: #020617;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.6;
    max-height: 380px;
    white-space: pre;
}

/* Step list */
.step-list {
    list-style: none;
    counter-reset: step-counter;
    margin-bottom: 1.5rem;
}

.step-item {
    counter-increment: step-counter;
    position: relative;
    padding-left: 2.75rem;
    margin-bottom: 1.25rem;
}

.step-item::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-light);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
}

.step-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.step-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Range Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}


/* ==========================================================
   Geo Photo Camera & Gallery Styles
   ========================================================== */
.camera-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 1.25rem auto;
    background: #020617;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

#geoCameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #090d16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 1.5rem;
    text-align: center;
    z-index: 5;
}

.camera-viewfinder-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.hud-pill {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.camera-controls-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Photo Gallery Grid */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.photo-card {
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.photo-thumb-wrap {
    position: relative;
    width: 100%;
    height: 160px;
    background: #020617;
    cursor: pointer;
    overflow: hidden;
}

.photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-thumb-wrap:hover .photo-thumb {
    transform: scale(1.05);
}

.photo-overlay-tag {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.photo-details {
    padding: 0.85rem;
}

.photo-meta-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-meta-time {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.photo-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Lightbox Modal */
.lightbox-img-wrap {
    max-width: 90vw;
    max-height: 80vh;
    text-align: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: inline-block;
}
