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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Auth Page Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-card h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.hidden {
    display: none !important;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    min-height: 20px;
}

.success-message {
    color: #27ae60;
    font-size: 14px;
    min-height: 20px;
}

/* Calendar Page Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    color: #667eea;
}

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

#userName {
    font-weight: 500;
    color: #555;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Hamburger Menu */
.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    transition: background 0.3s;
}

.hamburger-btn:hover {
    background: #e0e0e0;
}

.hamburger-icon {
    display: block;
    width: 22px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn.active .hamburger-icon:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger-btn.active .hamburger-icon:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-icon:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    text-align: left;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #eee;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.available {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.legend-color.booked {
    background: #ffebee;
    border: 2px solid #ef5350;
}

.legend-color.my-booking {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

/* Calendar Navigation */
.calendar-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* Calendars */
.calendars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.calendar {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    text-align: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 10px 0;
    font-size: 0.9rem;
}

.day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 0.95rem;
    overflow: hidden;
}

.day:not(.empty):not(.past):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.day.empty {
    cursor: default;
}

.day.past {
    color: #ccc;
    cursor: default;
}

.day.available {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.day.booked {
    background: #ffebee;
    border: 2px solid #ef5350;
    color: #c62828;
}

.day.my-booking {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1565c0;
}

.day .date-number {
    font-weight: 600;
}

.day .booker-name {
    font-size: 0.65rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content p {
    margin-bottom: 24px;
    font-size: 1.1rem;
    color: #333;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.modal-content .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.modal-content .form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

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

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Admin Panel Styles */
.admin-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.admin-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
    color: #667eea;
    margin-bottom: 24px;
}

.create-user-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.create-user-form button[type="submit"] {
    grid-column: 1 / -1;
    width: fit-content;
}

.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s;
}

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

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

.user-table thead {
    background: #f8f9fa;
}

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

.user-table th {
    font-weight: 600;
    color: #555;
}

.user-table tbody tr:hover {
    background: #f8f9fa;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.role-badge.role-admin {
    background: #e3f2fd;
    color: #1565c0;
}

.role-badge.role-user {
    background: #f3e5f5;
    color: #6a1b9a;
}

.btn-danger {
    background: #ef5350;
    color: white;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .calendars {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

    .day .booker-name {
        display: none;
    }

    .create-user-form {
        grid-template-columns: 1fr;
    }

    .user-table {
        font-size: 0.85rem;
    }

    .user-table th,
    .user-table td {
        padding: 10px;
    }
}
