/* KG Student Management System - Modern Kindergarten Theme */

:root {
    /* Color Palette */
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #45b7d1;
    --success-color: #96ceb4;
    --warning-color: #feca57;
    --danger-color: #ff9ff3;
    --info-color: #54a0ff;
    
    /* Status Colors */
    --waiting-color: #feca57;
    --ready-color: #96ceb4;
    --complete-color: #a4b0be;
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #343a40;
    --black: #2c3e50;
    
    /* Typography */
    --font-primary: 'Fredoka', 'Niramit', sans-serif;
    --font-display: 'Fredoka One', 'Niramit', cursive;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--black);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.app-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--light-gray);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success-color);
}

.status-dot.unstable {
    background: var(--warning-color);
}

.status-dot.disconnected {
    background: var(--danger-color);
}

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.welcome-section h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.welcome-section p {
    font-size: 1.1rem;
    color: var(--gray);
}

/* Class Grid */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.class-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.class-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.class-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.class-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-md);
}

.class-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-bars {
    display: flex;
    height: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--light-gray);
}

.status-bar {
    height: 100%;
    transition: width var(--transition-normal);
}

.status-bar.waiting {
    background: var(--waiting-color);
}

.status-bar.ready {
    background: var(--ready-color);
}

.status-bar.complete {
    background: var(--complete-color);
}

.status-bar.queued {
    background: #fd7e14;
}

/* Scanner Section */
.scanner-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.scanner-container h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.scanner-input-group {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.scanner-input-group input {
    flex: 1;
    padding: var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-family: var(--font-primary);
    transition: border-color var(--transition-fast);
}

.scanner-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.scanner-status {
    text-align: center;
    font-weight: 500;
    min-height: 1.5rem;
}

.scanner-status.success {
    color: var(--success-color);
}

.scanner-status.error {
    color: var(--danger-color);
}

/* Students Section */
.students-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.section-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--gray);
    font-size: 0.875rem;
}

.refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.students-table, .logs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.students-table th, .logs-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.students-table td, .logs-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
}

.students-table tr:hover, .logs-table tr:hover {
    background: var(--light-gray);
}

.student-id {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
}

.student-name {
    font-weight: 500;
    color: var(--dark-gray);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-waiting {
    background: var(--waiting-color);
    color: var(--black);
}

.status-ready-to-pickup {
    background: var(--ready-color);
    color: var(--white);
}

.status-complete {
    background: var(--complete-color);
    color: var(--white);
}

.status-new {
    background: var(--info-color);
    color: var(--white);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: var(--spacing-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

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

.btn-back {
    background: var(--light-gray);
    color: var(--dark-gray);
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* Filters */
.filters-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.filters-section h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-lg);
}

.filter-form {
    display: flex;
    gap: var(--spacing-lg);
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.filter-group label {
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.filter-group select,
.filter-group input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    transition: border-color var(--transition-fast);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Summary Stats */
.summary-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.summary-section h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
}

.stat-card {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--light-gray);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logs Section */
.logs-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.logs-section h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-lg);
}

.no-data {
    text-align: center;
    color: var(--gray);
    font-style: italic;
    padding: var(--spacing-xl);
}

/* Full Screen Layout - Students Only */
.full-screen-layout {
    height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
}

.students-full-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.students-grid-full {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--spacing-sm);
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    align-content: start;
    width: 100%;
}

.student-card-large {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 120px;
    position: relative;
    width: 100%;
}

.student-card-large:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.student-card-large.status-waiting {
    border-color: var(--waiting-color);
    background: rgba(254, 202, 87, 0.1);
}

.student-card-large.status-ready-to-pickup {
    border-color: var(--ready-color);
    background: rgba(150, 206, 180, 0.1);
}

.student-card-large.status-complete {
    border-color: var(--complete-color);
    background: rgba(164, 176, 190, 0.1);
}

.student-card-large .student-id {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

.student-card-large .student-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.8rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    word-break: break-word;
}

.student-card-large .student-status {
    margin-top: auto;
}

.student-card-large .status-badge {
    font-size: 0.7rem;
    padding: var(--spacing-xs);
    font-weight: 600;
}

/* TV Layout - 16:9 Optimized (for other pages) */
.tv-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    height: calc(100vh - 120px);
    overflow: hidden;
}

.students-column {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stats-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    overflow-y: auto;
}

.class-stats-section,
.quick-actions-section,
.recent-activity-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.class-stats-section h3,
.quick-actions-section h3,
.recent-activity-section h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.stat-card {
    text-align: center;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast);
    border: 3px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.waiting {
    background: rgba(254, 202, 87, 0.2);
    border-color: var(--waiting-color);
}

.stat-card.ready {
    background: rgba(150, 206, 180, 0.2);
    border-color: var(--ready-color);
}

.stat-card.complete {
    background: rgba(164, 176, 190, 0.2);
    border-color: var(--complete-color);
}

.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
}

.stat-card .stat-label {
    font-size: 1.1rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.2rem;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), var(--accent-color));
    color: var(--white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #ff9f43);
    color: var(--black);
}

.activity-list {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.5rem;
}

.activity-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--gray);
}

.no-activity {
    text-align: center;
    color: var(--gray);
    font-style: italic;
    padding: var(--spacing-lg);
}

/* Students Grid for Class Page */
.students-grid-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.student-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 120px;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.student-card.status-waiting {
    border-color: var(--waiting-color);
    background: rgba(254, 202, 87, 0.05);
}

.student-card.status-ready-to-pickup {
    border-color: var(--ready-color);
    background: rgba(150, 206, 180, 0.05);
}

.student-card.status-complete {
    border-color: var(--complete-color);
    background: rgba(164, 176, 190, 0.05);
}

.student-card.status-อยู่ในคิว {
    border-color: #fd7e14;
    background: rgba(253, 126, 20, 0.05);
}

.student-card .student-id {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

.student-card .student-name {
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
    word-break: break-word;
}

.student-card .student-status {
    margin-top: auto;
}

.student-card .status-badge {
    font-size: 0.9rem;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* TV Table Styles (for other pages) */
.tv-table {
    font-size: 1.1rem;
}

.tv-table th {
    font-size: 1.2rem;
    padding: var(--spacing-lg);
}

.tv-table td {
    padding: var(--spacing-lg);
    font-size: 1rem;
}

.tv-table .student-id {
    font-size: 1.1rem;
    font-weight: bold;
}

.tv-table .student-name {
    font-size: 1rem;
    font-weight: 500;
}

.tv-table .status-badge {
    font-size: 0.9rem;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Large TV Display Optimization */
@media (min-width: 1920px) {
    .full-screen-layout {
        height: calc(100vh - 140px);
    }
    
    .students-grid-full {
        grid-template-columns: repeat(8, 1fr);
        gap: var(--spacing-sm);
    }
    
    .student-card-large {
        min-height: 140px;
        padding: var(--spacing-md);
    }
    
    .student-card-large .student-id {
        font-size: 1.2rem;
    }
    
    .student-card-large .student-name {
        font-size: 0.9rem;
    }
    
    .student-card-large .status-badge {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .tv-layout {
        height: calc(100vh - 140px);
    }
    
    .class-stats-section h3,
    .quick-actions-section h3,
    .recent-activity-section h3 {
        font-size: 2.2rem;
    }
    
    .stat-card .stat-number {
        font-size: 4rem;
    }
    
    .stat-card .stat-label {
        font-size: 1.3rem;
    }
    
    .btn-large {
        font-size: 1.5rem;
        min-height: 80px;
        padding: var(--spacing-xl) var(--spacing-xxl);
    }
    
    .students-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .student-card {
        min-height: 150px;
        padding: var(--spacing-xl);
    }
    
    .student-card .student-id {
        font-size: 1.4rem;
    }
    
    .student-card .student-name {
        font-size: 1.2rem;
    }
    
    .student-card .status-badge {
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .tv-table {
        font-size: 1.3rem;
    }
    
    .tv-table th {
        font-size: 1.5rem;
        padding: var(--spacing-xl);
    }
    
    .tv-table td {
        padding: var(--spacing-xl);
        font-size: 1.2rem;
    }
    
    .tv-table .student-id {
        font-size: 1.3rem;
    }
    
    .tv-table .student-name {
        font-size: 1.2rem;
    }
    
    .tv-table .status-badge {
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }
}

/* Responsive Design */
@media (max-width: 1366px) {
    .students-grid-full {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--spacing-xs);
    }
    
    .student-card-large {
        min-height: 100px;
        padding: var(--spacing-sm);
    }
    
    .student-card-large .student-id {
        font-size: 0.9rem;
    }
    
    .student-card-large .student-name {
        font-size: 0.7rem;
    }
    
    .student-card-large .status-badge {
        font-size: 0.6rem;
        padding: 2px var(--spacing-xs);
    }
    
    .tv-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 2fr 1fr;
        height: auto;
    }
    
    .stats-column {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .class-stats-section,
    .quick-actions-section,
    .recent-activity-section {
        min-width: 300px;
        flex-shrink: 0;
    }
}

@media (max-width: 1200px) {
    .students-grid-full {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .students-grid-full {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .student-card-large {
        min-height: 100px;
        padding: var(--spacing-sm);
    }
    
    .student-card-large .student-id {
        font-size: 0.9rem;
    }
    
    .student-card-large .student-name {
        font-size: 0.7rem;
    }
    
    .student-card-large .status-badge {
        font-size: 0.6rem;
        padding: 2px var(--spacing-xs);
    }
    
    .container {
        padding: var(--spacing-sm);
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .class-grid {
        grid-template-columns: 1fr;
    }
    
    .scanner-input-group {
        flex-direction: column;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    .students-table th,
    .students-table td,
    .logs-table th,
    .logs-table td {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .class-card {
        padding: var(--spacing-lg);
    }
}

/* Animation for table updates */
@keyframes highlight {
    0% { background-color: var(--success-color); }
    100% { background-color: transparent; }
}

.highlight {
    animation: highlight 1s ease-out;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Status Change Animations */
.status-change-highlight {
    animation: statusChangePulse 2s ease-in-out;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
}

@keyframes statusChangePulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 144, 226, 0);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 144, 226, 0);
    }
}

/* Status Change Notification */
.status-change-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md);
    z-index: 1000;
    max-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-normal);
    border-left: 4px solid var(--success-color);
}

.status-change-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notification-icon {
    font-size: 1.5rem;
    color: var(--success-color);
}

.notification-text {
    flex: 1;
    color: var(--dark-gray);
}

.notification-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.notification-text small {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Reset Button Styling */
.btn-reset {
    background: linear-gradient(135deg, var(--warning-color), #ff9f43);
    color: var(--white);
    border: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-reset:hover {
    background: linear-gradient(135deg, #ff9f43, var(--warning-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-reset:active {
    transform: translateY(0);
}

/* Reset Notification Styling */
.reset-notification {
    background: var(--white);
    border-left: 4px solid var(--warning-color);
}

.reset-notification.error {
    border-left-color: var(--danger-color);
}

.reset-notification .notification-text strong {
    color: var(--warning-color);
}

.reset-notification.error .notification-text strong {
    color: var(--danger-color);
}

/* Status-based Student Card Colors */
.student-card-large.status-พร้อมรับ {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid #ffc107;
}

.student-card-large.status-กำลังมา {
    background: linear-gradient(135deg, #d4edda, #a8e6cf);
    border-left: 4px solid #28a745;
}

.student-card-large.status-เรียกแล้ว {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-left: 4px solid #17a2b8;
}

.student-card-large.status-รับแล้ว {
    background: linear-gradient(135deg, #e2e3e5, #c6c8ca);
    border-left: 4px solid #6c757d;
}

.student-card-large.status-อยู่ในคิว {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-left: 4px solid #fd7e14;
}

/* Status badge colors */
.status-badge.status-พร้อมรับ {
    background: #ffc107;
    color: #212529;
}

.status-badge.status-กำลังมา {
    background: #28a745;
    color: white;
}

.status-badge.status-เรียกแล้ว {
    background: #17a2b8;
    color: white;
}

.status-badge.status-รับแล้ว {
    background: #6c757d;
    color: white;
}

.status-badge.status-อยู่ในคิว {
    background: #fd7e14;
    color: white;
}

/* Faster refresh indicator animation */
.refresh-dot {
    transition: background-color var(--transition-fast);
}

/* Enhanced student card transitions */
.student-card-large {
    transition: all var(--transition-normal);
}

.student-card-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Status badge transitions */
.status-badge {
    transition: all var(--transition-fast);
}
