/* Simple, tablet-friendly styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

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

header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 32px;
    color: #333;
}

#statusBar {
    font-size: 18px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-link {
    color: #2196F3;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 2px solid #2196F3;
    transition: all 0.2s;
}

.admin-link:hover {
    background: #2196F3;
    color: white;
}

/* Mentor badge on kiosk cards */
.mentor-badge {
    display: inline-block;
    background: #2196F3;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Role tag in admin panel */
.role-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #2196F3;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Students Grid */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.student-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

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

.student-card.checked-in {
    border-left: 6px solid #4CAF50;
}

.student-card.checked-out {
    border-left: 6px solid #ccc;
}

.student-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.student-status {
    font-size: 16px;
    color: #4CAF50;
    margin-bottom: 16px;
    min-height: 24px;
}

.action-button {
    width: 100%;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px; /* Tablet-friendly touch target */
}

.checkin-button {
    background: #4CAF50;
    color: white;
}

.checkin-button:hover {
    background: #45a049;
}

.checkout-button {
    background: #ff9800;
    color: white;
}

.checkout-button:hover {
    background: #e68900;
}

.action-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading and Error */
.loading {
    text-align: center;
    font-size: 20px;
    color: #666;
    padding: 40px;
}

.error {
    background: #f44336;
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

/* Admin Login */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f5f5f5;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 300px;
}

.login-box h2 {
    margin-bottom: 20px;
    color: #333;
}

.login-box input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.login-box button:hover {
    background: #0b7dda;
}

/* Admin Panel */
.admin-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.add-form input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.add-form select {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
}

.add-form button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.list-item.inactive {
    opacity: 0.5;
}

.list-item button {
    padding: 8px 16px;
    font-size: 14px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.filters button {
    padding: 10px 20px;
    font-weight: 600;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.export-button {
    background: #4CAF50 !important;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f5f5f5;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    font-weight: 600;
    color: #333;
}

td input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.save-button {
    padding: 6px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.save-button:hover {
    background: #45a049;
}

.delete-button {
    padding: 6px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.logout-button {
    padding: 10px 20px;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* Leaderboard */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: #f5f5f5;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.rank-cell {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    width: 80px;
}

.time-cell {
    font-weight: 600;
    color: #2196F3;
    font-size: 18px;
}

.progress-cell {
    width: 200px;
}

.progress-bar {
    background: #e0e0e0;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    transition: width 0.3s ease;
}

.inactive-row {
    opacity: 0.5;
}

.inactive-tag {
    display: inline-block;
    background: #ffebee;
    color: #f44336;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.filters select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: white;
}

/* Collapsible Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
    padding: 4px;
    margin: -4px -4px 16px -4px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.section-header:hover {
    background-color: #f5f5f5;
}

.collapse-icon {
    font-size: 20px;
    color: #666;
    transition: color 0.2s;
}

.collapsible-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.collapsed {
    max-height: 0;
}

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day-header {
    background: #f5f5f5;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 8px;
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background: #f9f9f9;
}

.calendar-day-number {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
}

.calendar-day-empty {
    opacity: 0.3;
}

.calendar-day-today {
    border: 2px solid #2196F3;
    background: #e3f2fd;
}

.calendar-student-entry {
    font-size: 12px;
    color: #666;
    padding: 4px;
    margin-top: 4px;
    background: #f5f5f5;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-more-indicator {
    font-size: 11px;
    color: #999;
    padding: 4px;
    margin-top: 4px;
    text-align: center;
    font-style: italic;
}

.day-detail-modal {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.day-detail-modal h3 {
    color: #333;
    margin: 0;
}

.day-detail-modal h4 {
    color: #333;
    margin: 0;
}

.nav-button {
    padding: 10px 20px;
    font-weight: 600;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-button:hover {
    background: #0b7dda;
}

.today-button {
    padding: 10px 20px;
    font-weight: 600;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.today-button:hover {
    background: #45a049;
}

/* Responsive */
@media (max-width: 768px) {
    .students-grid {
        grid-template-columns: 1fr;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters button {
        width: 100%;
    }

    .progress-cell {
        width: 100px;
    }

    .rank-cell {
        width: 60px;
        font-size: 20px;
    }

    .calendar-day {
        min-height: 80px;
        font-size: 12px;
    }

    .calendar-day-number {
        font-size: 14px;
    }

    .calendar-student-entry {
        font-size: 10px;
    }
}
