/* ============================================================
   SolvaTech GPS Presences — Global Stylesheet
   Gereja CCC Bandung
   ============================================================ */

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

:root {
    /* Brand Colors — Professional Dark Blue */
    --primary: #1D4ED8;
    --primary-dark: #1E3A8A;
    --primary-light: #DBEAFE;
    --primary-glow: rgba(29, 78, 216, 0.25);

    --accent: #F97316;
    --accent-light: #FFF7ED;

    --success: #22C55E;
    --success-light: #DCFCE7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #0EA5E9;
    --info-light: #E0F2FE;

    /* Neutrals */
    --bg: #EFF6FF;
    --surface: #FFFFFF;
    --border: #DBEAFE;
    --text: #0F172A;
    --text-muted: #475569;
    --text-light: #94A3B8;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(29,78,216,0.08);
    --shadow: 0 4px 20px rgba(29,78,216,0.12);
    --shadow-lg: 0 8px 40px rgba(29,78,216,0.18);
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   App Header
   ============================================================ */
.app-header {
    background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 50%, #3B82F6 100%);
    box-shadow: 0 4px 24px rgba(29,78,216,0.40);
}

.header-logo {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ============================================================
   Bottom Navigation
   ============================================================ */
.bottom-nav {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    flex: 1;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item.active { color: var(--primary); }
.nav-item:hover { color: var(--primary); }

.nav-icon-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.nav-item.active .nav-icon-wrap {
    background: var(--primary-light);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-premium {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid rgba(108,60,225,0.15);
    box-shadow: var(--shadow);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 60%, #3B82F6 100%);
    color: white;
    box-shadow: 0 12px 32px rgba(29,78,216,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0F766E 0%, #047857 100%);
    box-shadow: 0 6px 22px rgba(13,148,136,0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-secondary:hover { background: #99F6E4; }

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover { background: var(--bg); }

.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: 18px; }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: 10px; }
.btn-full { width: 100%; }

/* ============================================================
   Form Inputs
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder { color: var(--text-light); }

select.form-input { appearance: none; }

/* ============================================================
   Badges & Status
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success { background: var(--success-light); color: #166534; }
.badge-error   { background: var(--error-light);   color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info    { background: var(--info-light);    color: #0369A1; }
.badge-purple  { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray    { background: #F0FDF4;              color: var(--text-muted); }

/* ============================================================
   Schedule Card
   ============================================================ */
.schedule-card {
    background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 60%, #3B82F6 100%);
    border-radius: 20px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(13,148,136,0.4);
}

.schedule-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 130px; height: 130px;
    background: rgba(255,255,255,0.10);
    border-radius: 50%;
}

.schedule-card::after {
    content: '';
    position: absolute;
    bottom: -20px; left: 20px;
    width: 80px; height: 80px;
    background: rgba(14,165,233,0.2);
    border-radius: 50%;
}

/* ============================================================
   Stat Cards
   ============================================================ */
.stat-card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}

/* ============================================================
   Table
   ============================================================ */
.table-container {
    background: white;
    border-radius: 18px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

thead th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFAFE; }

/* ============================================================
   Tabs
   ============================================================ */
.tab-bar {
    display: flex;
    background: var(--bg);
    border-radius: 16px;
    padding: 4px;
    gap: 2px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   GPS Location Badge
   ============================================================ */
.location-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 2px solid;
}

.location-badge.inside {
    background: var(--success-light);
    border-color: #6EE7B7;
    color: #065F46;
}

.location-badge.outside {
    background: var(--warning-light);
    border-color: #FCD34D;
    color: #92400E;
}

/* ============================================================
   Face Camera
   ============================================================ */
.camera-frame {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(108,60,225,0.15);
    background: #1a1a2e;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInTop {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes shimmer {
    from { background-position: -400px 0; }
    to   { background-position: 400px 0; }
}

.animate-fade-in  { animation: fadeIn 0.4s ease both; }
.animate-slide-top { animation: slideInTop 0.3s ease both; }

.pulse-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--success);
    animation: pulse-ring 1.5s ease-out infinite;
}

.skeleton {
    background: linear-gradient(90deg, #f0eeff 25%, #e6e2ff 50%, #f0eeff 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============================================================
   Misc
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.page-main {
    flex-grow: 1;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 16px 100px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg { margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ============================================================
   Loading Spinner
   ============================================================ */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-dark {
    border-color: rgba(108,60,225,0.2);
    border-top-color: var(--primary);
}

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

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15,12,41,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: white;
    border-radius: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: fadeIn 0.25s ease;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body { padding: 20px 24px 24px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    .stat-number { font-size: 26px; }
}

@media (prefers-color-scheme: dark) {
    /* Keep light mode for church app */
}
