/* FZS Trainer Hub - Styles
 * Extracted from trainer-hub-v3.html mockup
 */

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

:root {
    /* FZS Brand Colors */
    --primary: #1a472a;
    --primary-dark: #0f2d1a;
    --primary-light: #e8f5e9;
    --accent: #4caf50;
    --accent-light: #c8e6c9;

    /* Status Colors */
    --success: #2e7d32;
    --warning: #f9a825;
    --error: #c62828;
    --info: #1565c0;

    /* Offline Status */
    --offline: #ff5722;
    --syncing: #2196f3;
    --synced: #4caf50;

    /* Neutrals */
    --bg: #f5f7f5;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #5f6368;
    --border: #e0e0e0;

    /* Attendance */
    --present: #2e7d32;
    --absent: #c62828;
    --excused: #f9a825;
    --pending: #9e9e9e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    max-width: 430px;
    margin: 0 auto;
    padding-bottom: 80px;
}

/* ============================================
   CONNECTIVITY BAR
   ============================================ */
.connectivity-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    z-index: 100;
    transition: all 0.3s;
}

.connectivity-bar.online { background: var(--synced); color: white; }
.connectivity-bar.offline { background: var(--offline); color: white; }
.connectivity-bar.syncing { background: var(--syncing); color: white; }

.connectivity-status { display: flex; align-items: center; gap: 8px; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: pulse 2s infinite;
}

.connectivity-bar.offline .status-dot { animation: none; background: rgba(255,255,255,0.6); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.sync-badge {
    background: rgba(255,255,255,0.25);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}

.sync-badge:active { background: rgba(255,255,255,0.4); }

.app-container { padding-top: 44px; }

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 20px 20px;
    position: sticky;
    top: 44px;
    z-index: 20;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.trainer-name { font-size: 14px; opacity: 0.9; }
.header-subtitle { font-size: 13px; opacity: 0.8; }

.back-btn {
    display: none;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 12px;
}

.back-btn.show { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================
   SESSION CARDS
   ============================================ */
.session-card {
    background: var(--card);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.session-card:active { transform: scale(0.98); }

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.session-course { font-weight: 600; font-size: 16px; color: var(--primary); }

.session-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-planned { background: var(--info); color: white; }
.status-in-progress { background: var(--accent); color: white; }
.status-completed { background: var(--text-muted); color: white; }

.session-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.session-meta-item { display: flex; align-items: center; gap: 8px; }
.session-meta-icon { font-size: 16px; }

.session-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.stat { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.stat-value { font-weight: 600; color: var(--primary); }

.page { display: none; }
.page.active { display: block; }

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
    margin: 20px 0 12px;
}

/* ============================================
   SESSION DETAIL TABS
   ============================================ */
.session-tabs {
    display: flex;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    margin: 0 20px;
    border-radius: 12px;
    overflow: hidden;
}

.session-tab {
    flex: 1;
    padding: 12px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.session-tab-icon { font-size: 18px; }

.session-tab.active {
    color: var(--primary);
    background: var(--primary-light);
    border-bottom-color: var(--primary);
}

.session-tab-content { display: none; }
.session-tab-content.active { display: block; }

/* ============================================
   ATTENDEE CARDS
   ============================================ */
.attendee-list { padding: 0 20px; }

.attendee-card {
    background: var(--card);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
}

.attendee-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.attendee-info { flex: 1; }
.attendee-name { font-weight: 600; font-size: 15px; }
.attendee-org { font-size: 12px; color: var(--text-muted); }

.attendee-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-present { background: #e8f5e9; color: var(--present); }
.badge-absent { background: #ffebee; color: var(--absent); }
.badge-excused { background: #fff8e1; color: #f57f17; }
.badge-partial { background: #e3f2fd; color: var(--info); }
.badge-pending { background: #f5f5f5; color: var(--pending); }

/* ============================================
   ROLL CALL
   ============================================ */
.rollcall-card {
    background: var(--card);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    position: relative;
}

.rollcall-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.rollcall-actions { display: flex; gap: 8px; }

.rollcall-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rollcall-btn:active { transform: scale(0.95); }

.rollcall-btn.selected.present {
    background: #e8f5e9;
    border-color: var(--present);
    color: var(--present);
}

.rollcall-btn.selected.absent {
    background: #ffebee;
    border-color: var(--absent);
    color: var(--absent);
}

.rollcall-btn.selected.excused {
    background: #fff8e1;
    border-color: #f57f17;
    color: #f57f17;
}

/* ============================================
   ASSESSMENTS
   ============================================ */
.assessment-card {
    background: var(--card);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.assessment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.assessment-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assessment-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-input {
    width: 80px;
    padding: 10px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.score-input:focus {
    border-color: var(--accent);
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-divider {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
}

.score-max {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.assessment-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
}

.badge-pass { background: #e8f5e9; color: var(--present); }
.badge-fail { background: #ffebee; color: var(--absent); }
.badge-no-score { background: #f5f5f5; color: var(--pending); }

.assessment-notes {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    min-height: 40px;
    outline: none;
    transition: border-color 0.2s;
}

.assessment-notes:focus {
    border-color: var(--accent);
}

.assessment-notes::placeholder {
    color: var(--text-muted);
}

.course-threshold {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 8px;
}

.assessment-saving {
    font-size: 11px;
    color: var(--syncing);
    margin-top: 4px;
}

/* ============================================
   COURSE SECTION HEADERS
   ============================================ */
.course-header {
    background: var(--primary-light);
    padding: 12px 16px;
    margin: 16px 20px 12px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-header-title {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-header-stats {
    font-size: 12px;
    opacity: 0.8;
}

.course-section {
    margin-bottom: 8px;
}

.course-section .attendee-list {
    padding-top: 0;
}

/* ============================================
   SUMMARY CARD & PROGRESS
   ============================================ */
.summary-card {
    background: var(--primary);
    color: white;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 20px;
}

.summary-title { font-size: 14px; opacity: 0.9; margin-bottom: 12px; }
.summary-stats { display: flex; justify-content: space-between; }
.summary-stat { text-align: center; }
.summary-stat-value { font-size: 28px; font-weight: 700; }
.summary-stat-label { font-size: 11px; opacity: 0.8; text-transform: uppercase; }

.progress-bar-container {
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ============================================
   BUTTONS & OVERLAYS
   ============================================ */
.submit-btn {
    width: calc(100% - 40px);
    margin: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.submit-btn:active { transform: scale(0.98); background: var(--primary-dark); }

/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 30;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 22px; }

/* ============================================
   SUCCESS OVERLAY
   ============================================ */
.success-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(46, 125, 50, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 100;
}

.success-overlay.show { opacity: 1; pointer-events: auto; }
.success-overlay.error { background: rgba(198, 40, 40, 0.95); }

.success-check { font-size: 80px; animation: pop 0.4s ease-out; }
.success-text { color: white; font-size: 24px; font-weight: 600; margin-top: 16px; }
.success-sub { color: rgba(255,255,255,0.9); font-size: 16px; margin-top: 8px; text-align: center; }

@keyframes pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

.syncing-icon { animation: spin 1s linear infinite; display: inline-block; }

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--card);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 20px;
    border: 1px solid var(--border);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state-text { font-size: 14px; }
