/* =========================================
   1. GENERAL STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal mess on mobile */
}

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 10%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative; /* For mobile menu positioning */
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: bold;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.logo span {
    color: #C59D5F; /* Montana Gold */
}

/* NEW: Mobile Toggle Button (Hidden on Desktop) */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #C59D5F;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #C59D5F;
}

/* Navbar Buttons */
.login-btn,
.register-btn,
.logout-btn {
    background: #C59D5F;
    color: #fff !important;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
}

.login-btn:hover,
.register-btn:hover,
.logout-btn:hover {
    background: #a3814d;
    color: #fff !important;
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../images/kab.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 60px;
    margin-bottom: 20px;
    line-height: 1.2;
    max-width: 800px;
}

.hero h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    color: #C59D5F;
    margin-bottom: 10px;
    font-weight: 400;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
}

.cta-button {
    padding: 15px 40px;
    background: transparent;
    border: 2px solid #C59D5F;
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cta-button:hover {
    background: #C59D5F;
}

/* =========================================
   4. AUTH SECTION
   ========================================= */
.auth-page-wrapper {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.auth-box.highlighted {
    border-top: 5px solid #C59D5F;
}

.auth-box h3 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    text-align: center;
    margin-bottom: 10px;
}

.auth-subtitle {
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: #C59D5F;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 20px;
    transition: 0.3s;
}

.auth-btn:hover {
    background: #333;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-footer a {
    color: #C59D5F;
    text-decoration: none;
    font-weight: 600;
}

/* =========================================
   5. RULES SECTION
   ========================================= */
.rules-section {
    padding: 80px 10%;
    background: #f9f9f9;
    text-align: center;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    margin-bottom: 40px;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.rule-card {
    background: #fff;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-bottom: 3px solid #C59D5F;
}

.rule-card h3 {
    margin-bottom: 15px;
    color: #C59D5F;
}

/* =========================================
   6. TABLES & SLOTS SECTION
   ========================================= */
.slots-container {
    padding: 60px 10%;
    min-height: 80vh;
}

.table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eee;
}

.slots-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.slots-table th {
    background-color: #f8f9fa;
    padding: 18px 20px;
    border-bottom: 2px solid #C59D5F;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.slots-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    vertical-align: middle; 
    white-space: nowrap;
}

.slots-table td.cell-wrap {
    white-space: normal;
	word-wrap: break-word;
    min-width: 250px;
	text-align: inherit;
	padding: 18px 20px;
}

.slots-table td.cell-wrap .italic {
	display: inline;
}

.slots-table td.cell-wrap .details-btn {
	margin-top: 8px;
	display: inline-block;
}
	
.slots-table tr:hover {
    background-color: #fcfcfc;
}

.report-container .cell-wrap {
    max-width: 300px;
    white-space: normal;
    line-height: 1.5;
    color: #444;
}

/* =========================================
   7. STATUS BADGES & ALERTS
   ========================================= */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.status.available { background-color: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.status.approved, .status.full { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status.pending { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; text-transform: uppercase; }
.status.rejected, .status.occupied { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status.maintenance { background-color: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.status.urgent, .status.high { background-color: #e74c3c; color: #ffffff !important; }
.status.medium { background-color: #f39c12; color: #ffffff !important; }
.status.low { background: #3498db; color: #fff !important; }

.book-btn {
    background: #C59D5F;
    color: white;
    padding: 8px 18px;
    text-decoration: none;
    border-radius: 4px;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.book-btn:hover { background: #333; }
.book-btn.disabled { background: #ccc; cursor: not-allowed; }

.alert {
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.floating-alert {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 10000;
    background-color: #2ecc71;
    color: white;
    padding: 16px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
    display: flex;
    align-items: center;
    border-left: 6px solid #1f8b4c;
}

.floating-alert.success { background-color: #2ecc71; border-left: 6px solid #1f8b4c; color: white !important; }
.floating-alert.error { background-color: #e74c3c; border-left: 6px solid #c0392b; color: white !important; }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.floating-alert { animation: slideInRight 0.5s ease-out; }
.alert-content { display: flex; align-items: center; gap: 12px; }
.floating-alert p { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0.3px; }

/* =========================================
   8. DATE PICKER & FILTER
   ========================================= */
.date-picker-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.date-picker-filter form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-picker-filter label { font-weight: 600; color: #333; }
.date-picker-filter input[type="date"] { padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-family: 'Poppins', sans-serif; }
.filter-btn { padding: 10px 20px; background: #333; color: #fff; border: none; border-radius: 4px; cursor: pointer; transition: 0.3s; }
.filter-btn:hover { background: #C59D5F; }

/* =========================================
   9. BOOKING & REPORT FORMS
   ========================================= */
.booking-form-width { max-width: 600px; }
.booking-summary { background: #f9f9f9; padding: 15px; border-radius: 5px; margin-bottom: 25px; border-left: 5px solid #C59D5F; font-size: 15px; }
.booking-textarea, .report-textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-family: 'Poppins', sans-serif; resize: vertical; }
.booking-textarea { height: 100px; }
.report-textarea { height: 120px; resize: none; }
.report-page-section { padding: 60px 10%; background-color: #f9f9f9; min-height: 85vh; display: flex; justify-content: center; align-items: center; }
.report-container { width: 100%; max-width: 650px; }
.report-card { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-top: 5px solid #C59D5F; }
.form-title { font-family: 'Playfair Display', serif; font-size: 28px; text-align: center; margin-bottom: 10px; }
.form-subtitle { text-align: center; color: #777; font-size: 14px; margin-bottom: 30px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #333; }
.report-input, .report-dropdown { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-family: 'Poppins', sans-serif; margin-bottom: 20px; }
.urgency-selector { display: flex; justify-content: space-around; background: #f1f2f6; padding: 15px; border-radius: 8px; margin-bottom: 25px; }
.radio-group, .radio-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio-group { gap: 20px; padding: 10px 0; }
.radio-item { font-weight: 500; font-size: 14px; }
.radio-item input[type="radio"] { width: auto !important; }
.submit-report-btn { width: 100%; padding: 12px; background: #C59D5F; color: white; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; text-transform: uppercase; transition: 0.3s; }
.submit-report-btn:hover { background: #333; }

/* =========================================
   10. ADMIN DASHBOARD
   ========================================= */
.dashboard-wrapper { padding: 40px 10%; min-height: 80vh; }
.welcome-banner { margin-bottom: 30px; }
.welcome-banner h2 { font-family: 'Playfair Display', serif; font-size: 32px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center; border-top: 4px solid #C59D5F; }
.stat-card.warning { border-top-color: #e74c3c; }
.stat-card.info { border-top-color: #3498db; }
.stat-card h3 { font-size: 42px; margin-bottom: 5px; color: #333; }
.stat-card p { font-size: 14px; color: #777; text-transform: uppercase; letter-spacing: 1px; }
.stat-total { color: #777; display: block; margin-top: 5px; font-size: 0.85rem; font-weight: 400; text-transform: none; letter-spacing: normal; }

/* Normalized Action Container */
.admin-actions { 
    display: flex; 
    gap: 10px; 
    justify-content: center; 
    align-items: center;
    height: 100%;
}

.action-btn, .view-btn, .approve-btn, .reject-btn, .maintenance-btn, .cancel-btn { 
    padding: 8px 16px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 600; 
    transition: 0.3s; 
    display: inline-flex; /* Changed to inline-flex for better alignment */
    align-items: center;
    border: none; 
    cursor: pointer; 
    white-space: nowrap; 
    margin: 0;
}
.approve-btn { background-color: #27ae60; color: white !important; }
.reject-btn, .cancel-btn { background-color: #e74c3c; color: #fff !important; }
.view-btn, .maintenance-btn { background: #C59D5F; color: #fff !important; }
.action-btn:hover, .view-btn:hover, .approve-btn:hover, .reject-btn:hover, .maintenance-btn:hover, .cancel-btn:hover { filter: brightness(90%); box-shadow: 0 4px 8px rgba(0,0,0,0.1); transform: translateY(-1px); }

/* =========================================
   11. FOOTER & UTILITIES
   ========================================= */
footer { text-align: center; padding: 40px; background: #1a1a1a; color: #fff; font-size: 14px; margin-top: 60px; }
.action-link { color: #C59D5F; text-decoration: none; font-weight: 600; }
.user-welcome { background: #f8f4eb !important; color: #C59D5F !important; padding: 8px 16px; border-radius: 50px; font-weight: 600; font-size: 14px; margin-right: 15px; display: inline-flex; align-items: center; border: 1px solid #eaddca; }
.italic { font-style: italic; color: #666; }
.text-center { text-align: center; vertical-align: middle !important; }
.cancel-link, .back-home-link { display: block; text-align: center; margin-top: 15px; color: #777; text-decoration: none; font-size: 14px; transition: 0.3s; }
.cancel-link:hover, .back-home-link:hover { color: #C59D5F; }
small { color: #888; display: block; margin-top: 4px; }
.history-page { padding: 40px 5% !important; }
.section-header { text-align: center; margin-bottom: 40px; }
.time-range { color: #888; font-size: 0.85rem; }
.ref-id { color: #999; font-family: monospace; }
.empty-state { text-align: center; padding: 40px !important; color: #999; }
.empty-state a { color: #C59D5F; text-decoration: underline; font-weight: 600; }
.no-action-text { font-style: italic; color: #bbb; font-size: 13px; }
.slots-table td:last-child { text-align: center; }

/* ========================
   12. THE RESPONSIVE MAGIC 
   ======================== */
@media (max-width: 992px) {
    .navbar { padding: 20px 5%; }
}

@media (max-width: 768px) {
    /* Navbar Hamburger Setup */
    .menu-toggle { display: block; }
    
    .nav-links {
        display: none; /* Hide by default */
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; /* Show when toggled */
    }

    .nav-links li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }

    .nav-links li { margin-left: 0; }
	
	.nav-links li .logout-btn {
		width: 80%;
		margin: 10px auto;
	}

    /* Hero Scaling */
    .hero { background-attachment: scroll; } 
    .hero h1 { font-size: 36px; }
    .hero h3 { font-size: 22px; }

    /* Layout & Grids */
    .rules-section, .slots-container, .dashboard-wrapper { padding: 40px 5%; }
    .rules-grid, .stats-grid { grid-template-columns: 1fr; }
    
    .floating-alert {
        width: 90%;
        left: 5%;
        right: 5%;
        text-align: center;
    }

    /* Form Scaling */
    .auth-box, .report-card { padding: 25px; }
    .urgency-selector { flex-direction: column; gap: 10px; align-items: flex-start; }

	/* Mobile Stacked Table */
	.slots-table thead {
		display: none;
	}

	.slots-table, .slots-table tbody, .slots-table tr, .slots-table td {
		display: block;
		width: 100%;
	}

	.slots-table tr {
		margin-bottom: 20px;
		border: 1px solid #eaddca;
		border-radius: 10px;
		background: #fff;
		padding: 10px;
	}

	.slots-table td {
		text-align: right;
		padding: 10px 15px;
		position: relative;
		border-bottom: 1px solid #f9f9f9;
		white-space: normal;
		display: flex;
		justify-content: flex-end;
		align-items: flex-start;
	}
	
	.slots-table td.cell-wrap {
		text-align: right;
		width: 100%;
	}

	.slots-table td:last-child {
		border-bottom: none;
		text-align: center;
		background: #fdfaf5;
	}	

	.slots-table td::before {
		content: attr(data-label);
		position: absolute;
		left: 15px;
		width: 45%;
		text-align: left;
		font-weight: 600;
		color: #C59D5F;
		text-transform: uppercase;
		font-size: 11px;
	}
	
	.slots-table td[data-label="Date & Session"] {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-end;
		text-align: right;
	}
	
	.slots-table td[data-label="Category"] strong {
		display: block;
		margin-top: 2px;
		margin-left: auto;
	}
	
	.slots-table td[data-label="Date & Session"] br {
		display: none;
	}
	
	.slots-table td[data-label="Date & Session"] small {
		width: 100%;
		text-align: right;
		margin-top: 2px;
		display: block;
	}
	
	.slots-table td.cell-wrap {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-end;
		width: 100%;
		text-align: right;
	}
	
	.slots-table td.cell-wrap span.italic {
		margin-left: auto;
	}
	
	.slots-table td.cell-wrap .details-btn {
		width: 100%;
		text-align: right;
		margin-top: 8px !important;
		display: inline-block;
	}
		
}

@media (max-width: 480px) {
    .hero h1 { font-size: 28px; }
    .cta-button { padding: 12px 25px; font-size: 14px; }
}

/* --- Modal Background --- */
.modal-overlay {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6);
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(3px); 
}

/* --- Modal Box --- */
.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 15px; 
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #e67e22;
}

.modal-header { 
    border-bottom: 1px solid #eee; 
    margin-bottom: 15px; 
    padding-bottom: 10px; 
}

.modal-header h3 {
    font-family: 'Playfair Display', serif;
    color: #333;
}

.member-list { 
    list-style: decimal; 
    padding-left: 25px; 
    line-height: 2; 
    color: #444;
}

/* --- Details Link/Button in Table --- */
.details-btn {
    background: none;
    border: none;
    color: #e67e22;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-top: 5px;
    display: block;
    font-weight: 600;
}

.details-btn:hover {
    color: #d35400;
}