/**
 * System Collection v2.0 - Main Stylesheet
 * XAMPP Version
 */

/* ==================== CSS Variables ==================== */
:root {
    --primary: #4A90E2;
    --primary-dark: #2E5C8A;
    --primary-light: #E8F4FD;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    --light: #F8F9FA;
    --dark: #333333;
    --gray: #666666;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* ==================== Form Elements ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.form-control.error {
    border-color: var(--danger);
}

.form-error {
    display: block;
    color: var(--danger);
    font-size: 14px;
    margin-top: 6px;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ==================== Cards ==================== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

/* ==================== Guest Portal ==================== */
.page-wrapper {
    min-height: 100vh;
    padding-bottom: 80px;
}

.header {
    background: white;
    box-shadow: var(--shadow);
    padding: 20px 0;
    margin-bottom: 24px;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    padding: 20px 0;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* Info Grid */
.info-grid {
    display: grid;
    gap: 20px;
}

.info-item {
    padding: 16px;
    background: var(--light);
    border-radius: 8px;
}

.info-label {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 6px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

/* Zone Badge */
.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

/* Check-in Status */
.checkin-status {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: var(--radius);
}

.checkin-status.checked-in {
    background: #d4edda;
    border: 2px solid var(--success);
}

.checkin-status.not-checked-in {
    background: #fff3cd;
    border: 2px solid var(--warning);
}

.status-icon {
    font-size: 48px;
}

.checkin-status.checked-in .status-icon {
    color: var(--success);
}

.checkin-status.not-checked-in .status-icon {
    color: var(--warning);
}

.status-content h4 {
    font-size: 20px;
    margin-bottom: 4px;
}

.status-content p {
    font-size: 14px;
    color: var(--gray);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item i {
    font-size: 24px;
}

.nav-item span {
    font-size: 12px;
}

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

/* ==================== Admin Panel ==================== */
.admin-header {
    background: white;
    box-shadow: var(--shadow);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.admin-sidebar {
    width: 260px;
    background: white;
    box-shadow: var(--shadow);
    padding: 24px 0;
}

.admin-nav {
    display: flex;
    flex-direction: column;
}

.admin-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.admin-nav .nav-link:hover {
    background: var(--light);
}

.admin-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.admin-main {
    flex: 1;
    padding: 32px;
    background: var(--light);
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    color: var(--gray);
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

.table thead {
    background: var(--light);
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray);
}

.table td {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.table tbody tr:hover {
    background: var(--light);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: var(--success);
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: var(--danger);
}

/* Filter Form */
.filter-form {
    display: flex;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex: 1;
}

.filter-group .form-control {
    flex: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.page-link {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary);
    color: white;
}

.page-info {
    color: var(--gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 16px;
}

/* Zones Grid */
.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.zone-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.zone-card-header {
    padding: 24px;
    color: white;
    text-align: center;
}

.zone-card-header h3 {
    font-size: 24px;
    font-weight: 700;
}

.zone-card-body {
    padding: 24px;
}

.zone-description {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.8;
}

.zone-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.zone-stat {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zone-stat .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.zone-stat .stat-value {
    font-size: 24px;
}

.zone-stat .stat-label {
    font-size: 12px;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--gray);
    text-align: center;
}

.zone-map-placeholder {
    text-align: center;
    padding: 60px 20px;
    background: var(--light);
    border-radius: var(--radius);
    color: var(--gray);
}

.zone-map-placeholder i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 16px;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 70px;
        height: calc(100vh - 70px);
        z-index: 99;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.active {
        left: 0;
    }
    
    .admin-main {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .zones-grid {
        grid-template-columns: 1fr;
    }
}
