/* Alpha Course Check-in System Styles */

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 100%;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

/* Statistics Section */
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e8f4f8;
    border-radius: 5px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    margin: 5px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c5aa0;
}

/* Search Section */
.search-box {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.search-box input {
    padding: 8px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-box button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.search-box button:hover {
    background-color: #0056b3;
}

/* Toggle Controls */
.toggle-container {
    margin-bottom: 20px;
}

.toggle-container button {
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
}

.toggle-container button:hover {
    opacity: 0.8;
}

#addRowBtn {
    background-color: #28a745;
}

#importCsvBtn {
    background-color: #17a2b8;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    white-space: nowrap;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    position: relative;
}

.sortable:hover {
    background-color: #e0e0e0;
}

.sortable::after {
    content: '⇅';
    position: absolute;
    right: 5px;
    color: #999;
}

/* Editable cells */
.editable {
    background-color: #fff3cd;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    position: relative;
}

.editable:hover {
    background-color: #fff200;
}

.editable:after {
    content: '✏️';
    position: absolute;
    right: 2px;
    top: 2px;
    font-size: 10px;
    opacity: 0.7;
    pointer-events: none;
}

/* Check-in buttons */
.checkin-btn {
    padding: 4px 8px;
    margin: 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    min-width: 25px;
}

.checked-in {
    background-color: #28a745;
    color: white;
}

.not-checked-in {
    background-color: #dc3545;
    color: white;
}

.checkin-btn:hover {
    opacity: 0.8;
}

/* Person type badges */
.person-type {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
    display: inline-block;
}

.registrant { background-color: #007bff; }
.adult { background-color: #28a745; }
.teenager { background-color: #ffc107; color: black; }
.infant { background-color: #fd7e14; }
.walk-in { background-color: #6f42c1; }

/* Action buttons */
.action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
}

.save-btn {
    background-color: #28a745;
    color: white;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
}

.action-btn:hover {
    opacity: 0.8;
}

/* Dropdown editor styles */
.dropdown-container {
    background: white;
    border: 2px solid #007bff;
    border-radius: 3px;
    max-height: 200px;
    overflow-y: auto;
    position: relative;
    z-index: 1000;
}

.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    user-select: none;
}

.dropdown-option:hover {
    background-color: #f8f9fa;
}

.dropdown-option.selected {
    background-color: #007bff;
    color: white;
}

.dropdown-option:last-child {
    border-bottom: none;
}

/* New row styling */
.new-row {
    background-color: #fff3cd !important;
    border: 2px solid #ffc107 !important;
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Dropdown editing */
.dropdown-container {
    background: white;
    border: 2px solid #007bff;
    border-radius: 4px;
    padding: 5px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    position: relative;
}

.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 3px;
    margin: 2px 0;
    font-size: 14px;
}

.dropdown-option:hover {
    background-color: #f8f9fa;
}

.dropdown-option.selected {
    background-color: #007bff;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 10px;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        margin: 10px 0;
    }
    
    .search-box input {
        width: 100%;
        max-width: 300px;
    }
    
    .toggle-container {
        text-align: center;
    }
    
    .toggle-container button {
        margin: 5px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 4px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .search-box input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-box button {
        margin: 5px 5px 5px 0;
    }
    
    .stat-number {
        font-size: 20px;
    }
}