/* 
   CPPS Sports Tracking System - Stylesheet
   Theme: iOS Light Mode with Liquid Glass (Glassmorphism)
   Colors: Blue, Yellow, Orange, White, Black
   Responsive Mobile-First Design
*/

:root {
    /* iOS System Light Color Palette */
    --primary-blue: #007aff;       /* iOS System Blue */
    --primary-blue-dark: #0056b3;  /* Darker Blue */
    --primary-blue-light: #e5f1ff; /* Very soft light blue */
    
    --accent-yellow: #ffcc00;      /* iOS System Yellow */
    --accent-yellow-dark: #c7a000; /* Darker Yellow */
    --accent-yellow-light: #fffbeb;/* Very soft light yellow */
    
    --accent-orange: #ff9500;      /* iOS System Orange */
    --accent-orange-dark: #d67d00; /* Darker Orange */
    --accent-orange-light: #fff4e5;/* Very soft light orange */
    
    --white: #ffffff;
    --black: #000000;
    
    /* System Surfaces */
    --bg-app: #f2f2f7;             /* iOS Secondary System Background */
    --bg-card: rgba(255, 255, 255, 0.72); /* Frosted Translucent White Glass */
    --border-color: rgba(0, 0, 0, 0.06);  /* Super thin iOS light borders */
    --border-glass: rgba(255, 255, 255, 0.6);
    
    /* Typography Colors */
    --text-dark: #1c1c1e;          /* iOS Primary Label (Dark Charcoal) */
    --text-gray: #8e8e93;          /* iOS Secondary Label */
    --text-danger: #ff3b30;        /* iOS System Red */
    
    /* Attendance Status Colors */
    --status-present: #007aff;     /* Blue for Present */
    --status-late: #ffcc00;        /* Yellow for Late */
    --status-excused: #8e8e93;     /* Gray for Excused */
    --status-absent: #ff9500;      /* Orange for Absent */
    
    /* Layout Variables */
    --header-height: 70px;
    --nav-height: 65px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Shadow Variables */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL RESET & LIQUID BACKGROUND ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Prompt', 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Soft fluid mesh background with flowing color blobs */
    background-color: var(--bg-app);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 122, 255, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 90% 10%, rgba(255, 204, 0, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(255, 149, 0, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.5;
    padding-bottom: calc(var(--nav-height) + 20px);
    padding-top: var(--header-height);
    overflow-x: hidden;
    font-size: 15px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Kanit', -apple-system, sans-serif;
    font-weight: 600;
    color: var(--black);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* ==================== HEADER ==================== */
.app-header {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.logo-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
}

.header-title h1 {
    font-size: 17px;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    line-height: 1.2;
    font-weight: 700;
}

.header-title p {
    font-size: 11px;
    color: var(--primary-blue);
    font-weight: 500;
}

/* ==================== MAIN BODY ==================== */
.app-body {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
}

/* Views Panel Transition */
.view-panel {
    display: none;
    animation: iosFadeIn 0.35s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.view-panel.active {
    display: block;
}

@keyframes iosFadeIn {
    from { opacity: 0; transform: scale(0.98) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==================== TITLES & HEADERS ==================== */
.section-title {
    margin-bottom: 16px;
    padding-left: 4px;
}

.section-title h2 {
    font-size: 22px;
    color: var(--black);
    font-weight: 700;
}

.section-title p {
    font-size: 13px;
    color: var(--text-gray);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

.desc-text {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.required {
    color: var(--text-danger);
}

.lbl-danger {
    color: var(--text-danger) !important;
    font-weight: 600;
}

.text-danger {
    border-color: rgba(255, 59, 48, 0.3) !important;
    background-color: rgba(255, 59, 48, 0.03) !important;
}

/* ==================== LIQUID GLASS CARDS ==================== */
.card, .athlete-card, .athlete-att-card, .sched-card, .accordion-item {
    background-color: var(--bg-card);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 
        0 4px 20px 0 rgba(0, 0, 0, 0.03), 
        inset 0 1px 0 0 rgba(255, 255, 255, 0.6); /* Top shiny glass line */
    transition: var(--transition);
}

/* Active touch states for cards */
.athlete-card:active, .sched-card:active {
    transform: scale(0.985);
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.card-header h4 {
    font-size: 15px;
    color: var(--black);
    font-weight: 600;
}

/* ==================== BUTTONS (iOS STYLE) ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Prompt', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 24px; /* Fully rounded iOS style */
    border: none;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
}

.btn-primary:active {
    background-color: var(--primary-blue-dark);
    transform: scale(0.975);
    opacity: 0.9;
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-blue);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: none;
}

.btn-secondary:active {
    background-color: rgba(0, 0, 0, 0.08);
    transform: scale(0.975);
}

.btn-orange {
    background-color: var(--accent-orange);
    color: var(--white);
}

.btn-orange:active {
    background-color: var(--accent-orange-dark);
    transform: scale(0.975);
}

.btn-yellow {
    background-color: var(--accent-yellow);
    color: var(--text-dark);
}

.btn-yellow:active {
    background-color: var(--accent-yellow-dark);
    transform: scale(0.975);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-family: 'Prompt', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
}

.btn-text:active {
    opacity: 0.6;
}

.w-full {
    width: 100%;
}

.mt-1 {
    margin-top: 8px;
}

/* ==================== FORMS (iOS STYLE) ==================== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 4px;
    font-weight: 500;
    padding-left: 2px;
}

.form-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.038);
    border: 1px solid rgba(0, 0, 0, 0.02);
    color: var(--text-dark);
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Prompt', sans-serif;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    background-color: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238e8e93'%3E%3Cpath d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 32px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.flex-1 {
    flex: 1;
}

/* ==================== DASHBOARD VIEW ==================== */
.dashboard-welcome {
    margin-bottom: 16px;
    padding-left: 4px;
}

.dashboard-welcome h2 {
    font-size: 24px;
    color: var(--black);
    font-weight: 700;
}

.dashboard-welcome p {
    font-size: 13px;
    color: var(--primary-blue);
    font-weight: 600;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.icon-blue {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
}

.icon-yellow {
    background-color: var(--accent-yellow-light);
    color: var(--accent-yellow-dark);
}

.stat-data .stat-label {
    font-size: 11px;
    color: var(--text-gray);
    display: block;
    font-weight: 500;
}

.stat-data h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--black);
    line-height: 1.2;
}

/* Attendance summary card progress bar */
.sport-badge-today {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.attendance-progress-bar {
    height: 12px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.p-present { background-color: var(--status-present); }
.p-late { background-color: var(--status-late); }
.p-excused { background-color: var(--status-excused); }
.p-absent { background-color: var(--status-absent); }

.progress-legends {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.legend-item {
    font-size: 12px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-present { background-color: var(--status-present); }
.dot-late { background-color: var(--status-late); }
.dot-excused { background-color: var(--status-excused); }
.dot-absent { background-color: var(--status-absent); }

/* Quick Actions Row */
.quick-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.quick-actions-row button {
    height: 46px;
    padding: 0;
    border-radius: 23px;
}

/* ==================== ATTENDANCE VIEW ==================== */
.attendance-config-card {
    padding: 14px;
}

.list-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-gray);
    padding: 0 4px;
    font-weight: 500;
}

/* Attendance Athlete Row Card */
.athlete-att-card {
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.athlete-att-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    transition: var(--transition);
}

.avatar-wrapper.status-border-present { border-color: var(--status-present); }
.avatar-wrapper.status-border-late { border-color: var(--status-late); }
.avatar-wrapper.status-border-excused { border-color: var(--status-excused); }
.avatar-wrapper.status-border-absent { border-color: var(--status-absent); }

.athlete-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.athlete-att-details {
    flex-grow: 1;
}

.athlete-att-details h5 {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
}

.athlete-att-details p {
    font-size: 11px;
    color: var(--text-gray);
}

.allergy-alert-badge {
    display: inline-block;
    background-color: rgba(255, 59, 48, 0.08);
    color: var(--text-danger);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    border: 0.5px solid rgba(255, 59, 48, 0.2);
    font-weight: 500;
}

/* 4-Button Attendance Selector (iOS Segmented Control Style) */
.att-buttons-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px;
    border-radius: 10px;
    overflow: hidden;
    width: 170px;
    flex-shrink: 0;
}

.btn-status-option {
    background-color: transparent;
    border: none;
    color: var(--text-dark);
    font-family: 'Prompt', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    padding: 6px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

/* Segmented selector active states */
.btn-status-option.active-present {
    background-color: var(--white);
    color: var(--status-present);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.btn-status-option.active-late {
    background-color: var(--white);
    color: var(--accent-yellow-dark);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.btn-status-option.active-excused {
    background-color: var(--white);
    color: var(--text-dark);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.btn-status-option.active-absent {
    background-color: var(--white);
    color: var(--status-absent);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Sticky Save Panel */
.sticky-save-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 90;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.attendance-list-section {
    padding-bottom: 75px;
}

/* ==================== SCHEDULES VIEW ==================== */
.schedule-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-tab {
    flex-shrink: 0;
    background-color: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.01);
    color: var(--text-dark);
    font-family: 'Prompt', sans-serif;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.filter-tab.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    font-weight: 600;
}

/* Schedule Cards */
.sched-card {
    border-left: 4px solid var(--primary-blue);
    position: relative;
    padding: 14px 16px;
}

.sched-card.sport-futsal { border-left-color: var(--accent-yellow); }
.sched-card.sport-volleyball { border-left-color: var(--accent-orange); }

.sched-time {
    font-size: 12px;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sched-focus {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 8px;
}

.sched-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: var(--text-gray);
    font-weight: 500;
}

.sched-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sched-sport-badge {
    background-color: rgba(0, 122, 255, 0.08);
    color: var(--primary-blue);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.btn-delete-sched {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.btn-delete-sched:active {
    color: var(--text-danger);
}

.no-data-msg {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 500;
}

/* ==================== ATHLETES VIEW ==================== */
.search-bar {
    margin-bottom: 14px;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-gray);
    pointer-events: none;
}

.search-bar .form-control {
    padding-left: 38px;
    background-color: rgba(0, 0, 0, 0.04);
}

.athletes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Athlete Cards */
.athlete-card {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.athlete-info {
    flex-grow: 1;
}

.athlete-info h4 {
    font-size: 14.5px;
    color: var(--text-dark);
    margin-bottom: 2px;
    font-weight: 600;
}

.athlete-info p {
    font-size: 11px;
    color: var(--text-gray);
    font-weight: 500;
}

.athlete-list-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.meta-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-gray);
    font-weight: 500;
}

.meta-badge.badge-allergy {
    background-color: rgba(255, 59, 48, 0.08);
    color: var(--text-danger);
    border: 0.5px solid rgba(255, 59, 48, 0.2);
}

.athlete-stat-bubble {
    text-align: center;
    background-color: rgba(0, 122, 255, 0.08);
    padding: 6px 10px;
    border-radius: 10px;
    min-width: 60px;
    flex-shrink: 0;
}

.athlete-stat-bubble .stat-num {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary-blue);
    display: block;
}

.athlete-stat-bubble .stat-txt {
    font-size: 9px;
    color: var(--primary-blue);
    display: block;
    font-weight: 600;
}

/* ==================== SETTINGS & REPORTS VIEW ==================== */
.settings-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    margin-bottom: 0;
    overflow: hidden;
    padding: 0 !important;
}

.accordion-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: transparent;
    transition: var(--transition);
}

.accordion-header h3 {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 600;
}

.accordion-header svg {
    color: var(--text-gray);
    transition: var(--transition);
}

.accordion-item.open .accordion-header {
    border-bottom: 1px solid var(--border-color);
}

.accordion-item.open .accordion-header svg {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 16px;
    display: none;
    background-color: rgba(255, 255, 255, 0.45);
    animation: iosSlideDown 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.accordion-item.open .accordion-content {
    display: block;
}

@keyframes iosSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sport settings layout */
.sport-add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sport-list-group {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sport-list-item {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 500;
}

.btn-delete-sport {
    background: none;
    border: none;
    color: var(--text-danger);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

/* LINE notifications card */
.notification-preview-box {
    margin-top: 14px;
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.preview-header {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 6px 12px;
    font-size: 11.5px;
    color: var(--primary-blue);
    font-weight: 600;
}

.preview-content {
    padding: 12px;
    font-size: 12px;
    white-space: pre-line;
    color: var(--text-dark);
    background-color: var(--white);
    font-family: monospace, system-ui;
    border-bottom: 1px solid var(--border-color);
}

.preview-actions {
    display: flex;
    padding: 8px 12px;
    gap: 8px;
}

/* Backup styling */
.backup-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.danger-zone {
    border-top: 1px dashed var(--border-color);
    padding-top: 14px;
    text-align: center;
}

/* ==================== iOS NATIVE STYLE TAB BAR (BOTTOM NAV) ==================== */
.bottom-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-color);
    height: var(--nav-height);
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.02);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 60px;
    height: 100%;
    cursor: pointer;
    transition: var(--transition);
}

.nav-icon {
    width: 22px;
    height: 22px;
    transition: var(--transition);
}

.nav-label {
    font-size: 9.5px;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item.active .nav-icon {
    transform: scale(1.06);
}

/* ==================== SYSTEM MODALS (iOS STYLE) ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.35); /* iOS dimmer overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-container {
    background-color: rgba(255, 255, 255, 0.85); /* White Liquid Glass */
    backdrop-filter: blur(35px) saturate(200%);
    -webkit-backdrop-filter: blur(35px) saturate(200%);
    border: 1px solid var(--border-glass);
    width: 92%;
    max-width: 460px;
    border-radius: var(--radius-lg);
    z-index: 210;
    overflow: hidden;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    animation: iosZoomIn 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes iosZoomIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 17px;
    color: var(--black);
    font-weight: 700;
}

.btn-close-x {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-gray);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-close-x:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    width: 100%;
}

.modal-footer .btn, .modal-footer button {
    flex: 1;
    margin: 0;
    height: 44px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
}

/* Photo upload form box */
.photo-upload-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    background-color: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(0, 0, 0, 0.08);
}

.profile-preview-wrapper {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.05);
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.avatar-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-upload-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-note {
    font-size: 9.5px;
    color: var(--text-gray);
}

/* ==================== iOS SYSTEM GROUPED LIST CELLS ==================== */
.ios-list-group {
    background-color: var(--white);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ios-list-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.035);
    font-size: 13.5px;
}

.ios-list-item-row:last-child {
    border-bottom: none;
}

.ios-label {
    color: var(--text-gray);
    font-weight: 500;
}

.ios-value {
    color: var(--text-dark);
    font-weight: 600;
    text-align: right;
}

.blood-highlight {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11.5px;
}

.allergy-group.has-allergy {
    border: 1.5px solid rgba(255, 59, 48, 0.25);
    background-color: rgba(255, 59, 48, 0.03);
}

.label-allergy {
    color: var(--text-danger);
    font-weight: 600;
}

.value-allergy {
    color: var(--text-danger);
    font-weight: 700;
}

/* Details Popup Header */
.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.detail-avatar-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.detail-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title-info h4 {
    font-size: 17px;
    color: var(--black);
    font-weight: 700;
}

.detail-subtitle {
    font-size: 11.5px;
    color: var(--text-gray);
    margin-top: 1px;
    font-weight: 500;
}

/* Detailed Progress Bar for Stats */
.detail-stats-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.detail-stats-panel h5 {
    font-size: 13.5px;
    color: var(--black);
    margin-bottom: 10px;
    font-weight: 600;
}

.detail-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 500;
}

.detail-progress-label {
    width: 80px;
    flex-shrink: 0;
    color: var(--text-dark);
}

.detail-progress-track {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    overflow: hidden;
}

.detail-progress-fill {
    height: 100%;
    border-radius: 4px;
}

.detail-progress-val {
    width: 45px;
    text-align: right;
    font-weight: 600;
}

/* ==================== RESPONSIVE RULES ==================== */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .app-body {
        padding: 12px;
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
        gap: 8px;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    
    .stat-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .stat-data h3 {
        font-size: 15px;
    }
    
    .quick-actions-row {
        gap: 8px;
    }
    
    .quick-actions-row button {
        font-size: 12px;
        height: 42px;
    }
    
    .athlete-att-card {
        padding: 10px;
        gap: 10px;
    }
    
    .avatar-wrapper {
        width: 38px;
        height: 38px;
    }
    
    .btn-status-option {
        font-size: 12px;
        padding: 5px 0;
    }
}

/* Login Tabs Segmented Control */
.login-tab-btn {
    background-color: transparent;
    border: none;
    color: var(--text-gray);
    font-family: 'Prompt', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.login-tab-btn.active {
    background-color: var(--white);
    color: var(--primary-blue);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Header Profile Dropdown Styles */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
}

.profile-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
}

.profile-avatar-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary-blue-light);
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 46px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
    animation: iosSlideDown 0.22s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.profile-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-family: 'Prompt', sans-serif;
    font-size: 13px;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    text-align: left;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

@keyframes iosSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

#view-login.active {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-height: 85vh;
    padding: 20px;
}
