* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Initial Login Screen */
#initialLoginScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

.login-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #5a6fd8;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
    font-weight: bold;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.header h1 {
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Admin Login Button */
.admin-login-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.admin-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    width: auto;
}

.admin-btn:hover {
    background: #c0392b;
}

/* User Login Form */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.user-login {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-login input {
    padding: 0.5rem;
    border: 2px solid #34495e;
    border-radius: 5px;
    background: white;
    color: #2c3e50;
    font-size: 0.9rem;
    width: 150px;
}

.user-login input:focus {
    outline: none;
    border-color: #3498db;
}

.user-login button {
    padding: 0.5rem 1rem;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    width: auto;
}

.user-login button:hover {
    background: #229954;
}

.user-logged-in {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info button {
    width: auto;
    padding: 0.5rem 1rem;
    background: #e74c3c;
    font-size: 0.9rem;
}

.user-info button:hover {
    background: #c0392b;
}

/* Board Container */
.board-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.action-btn {
    width: auto;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.3s;
}

.break-btn {
    background: #3498db;
}

.break-btn:hover {
    background: #2980b9;
}

.short-lunch-btn {
    background: #f39c12;
}

.short-lunch-btn:hover {
    background: #e67e22;
}

.lunch-btn {
    background: #e67e22;
}

.lunch-btn:hover {
    background: #d35400;
}

.return-btn {
    background: #27ae60;
}

.return-btn:hover {
    background: #229954;
}

.action-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Spots Grid */
.spots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.spots-container h2 {
    text-align: center;
    margin: 0;
    color: #2c3e50;
}

.last-update {
    font-size: 0.8rem;
    color: #27ae60;
    background: #f8fff8;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    border: 1px solid #27ae60;
}

.spots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.spot {
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.spot.available {
    border-color: #27ae60;
    background: #f8fff8;
}

.spot.occupied {
    border-color: #e74c3c;
    background: #fff8f8;
}

.spot.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.spot-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.spot.available .spot-header {
    color: #27ae60;
}

.spot.occupied .spot-header {
    color: #e74c3c;
}

.spot-info {
    margin-bottom: 1rem;
}

.spot-user {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.spot-type {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.spot-time {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.timer {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e67e22;
    margin-bottom: 0.5rem;
}

.timer.expired {
    color: #e74c3c;
    animation: blink 1s infinite;
}

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

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* Sync Indicator */
.sync-indicator {
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Admin Panel */
.admin-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-controls h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.admin-controls .form-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-controls input {
    width: 100px;
}

.admin-controls button {
    width: auto;
    padding: 0.5rem 1rem;
}

.admin-spots {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-spots h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.admin-actions {
    text-align: center;
}

.danger-btn {
    background: #e74c3c;
    width: auto;
    padding: 0.75rem 2rem;
}

.danger-btn:hover {
    background: #c0392b;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close {
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .admin-login-btn {
        position: static;
        transform: none;
        order: -1;
    }

    .user-login {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-login input {
        width: 200px;
    }

    .board-container,
    .admin-container {
        padding: 1rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .spots-grid {
        grid-template-columns: 1fr;
    }

    .admin-controls .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-controls input,
    .admin-controls button {
        width: 100%;
    }
}