/* ===== GLOBAL & THEME ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #121212;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('try1.avif') no-repeat center center fixed;
    background-size: cover;
    color: #ecf0f1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===== LOGIN SCREEN ===== */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 20px;
    font-weight: 900;
}

input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    box-sizing: border-box;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-primary {
    background: #00cec9;
    color: #002b36;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #00b8b3;
    transform: translateY(-2px);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
}

.hotel-switcher-container {
    margin-top: 10px;
}

.hotel-select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.hotel-select option {
    background: #1e272e;
    color: white;
}

.add-hotel-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.add-hotel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00cec9;
}

#main-app {
    display: none;
    height: 100vh;
    overflow: auto;
    /* Allow both vertical and horizontal scroll */
    background: linear-gradient(rgba(15, 32, 39, 0.4), rgba(32, 58, 67, 0.4));
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* ===== ROOM ===== */
.room {
    border-radius: 12px;
    padding: 20px 10px;
    min-height: 180px;
    height: auto;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 3px solid #00b894;
    background: linear-gradient(145deg, rgba(0, 184, 148, 0.35), #121212);
    font-weight: bold;
    transition: transform 0.2s ease, all 0.3s;
    box-sizing: border-box;
    color: #fff;
}

.room-id {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 2px;
}

.room-type {
    font-size: 0.9rem;
    color: #00cec9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.guest-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ecf0f1;
    margin: 4px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-status {
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 600;
}

.room-details {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.detail-row {
    font-size: 0.72rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: space-between;
}

.detail-row span {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.room:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.room.booked {
    border-color: #e17055;
    background: linear-gradient(145deg, rgba(225, 112, 85, 0.3), rgba(47, 54, 64, 0.95));
}

.room.checkout-today {
    border-color: #fdcb6e;
    box-shadow: 0 0 15px rgba(253, 203, 110, 0.4);
    background: linear-gradient(145deg, rgba(253, 203, 110, 0.2), rgba(47, 54, 64, 0.95));
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transition: transform 0.3s ease, margin-left 0.3s ease;
    position: relative;
    z-index: 100;
}

.sidebar.hidden {
    transform: translateX(-100%);
    margin-left: -280px;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 900;
    color: #00cec9;
    margin-bottom: 5px;
}

.hotel-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    padding: 15px 20px;
    margin: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #00cec9;
}

.nav-item.active {
    background: rgba(0, 206, 201, 0.2);
    color: #00cec9;
    border-left: 4px solid #00cec9;
}

.nav-icon {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    background: rgba(255, 118, 117, 0.2);
    color: #ff7675;
    border: 1px solid #ff7675;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #ff7675;
    color: white;
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    flex: 1;
    overflow: auto;
    /* Allow both vertical and horizontal scroll */
    padding: 30px;
    transition: margin-left 0.3s ease;
    position: relative;
}

/* ===== TOGGLE BUTTON ===== */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: rgba(0, 206, 201, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    /* Always show toggle button */
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle:hover {
    background: #00cec9;
    transform: scale(1.1);
}

.sidebar-toggle.sidebar-hidden {
    left: 20px;
}

/* Adjust main content when sidebar is toggled on desktop */
.sidebar.hidden~.main-content {
    margin-left: 0;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
}

.mobile-overlay.active {
    display: block;
}

/* Sidebar toggle visibility moved to responsive block at end of file */

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.breadcrumb {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Hide all views by default */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* ===== DASHBOARD STATS ===== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 5px solid;
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: #ecf0f1;
}

.bill-tag {
    margin-top: 8px;
    border-top: 2px dashed rgba(255, 255, 255, 0.2);
    padding-top: 6px;
}

/* ===== GRID & ROOMS ===== */
/* Filter Bar */
.filter-bar {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.filter-bar button {
    padding: 10px 22px;
    margin: 5px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ecf0f1;
    cursor: pointer;
    font-weight: 900;
    transition: all 0.3s ease;
}

.filter-bar button.active {
    background: #00cec9;
    color: #002b36;
}

.floor {
    background: rgba(0, 0, 0, 0.20);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.floor h3 {
    font-size: 1.4rem;
    font-weight: 900;
    border-left: 5px solid #00cec9;
    padding-left: 12px;
    margin-bottom: 15px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.room:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.room.booked {
    border-color: #e17055;
    background: linear-gradient(145deg, rgba(225, 112, 85, 0.3), rgba(47, 54, 64, 0.95));
}

.room.checkout-today {
    border-color: #fdcb6e;
    box-shadow: 0 0 15px rgba(253, 203, 110, 0.4);
    background: linear-gradient(145deg, rgba(253, 203, 110, 0.2), rgba(47, 54, 64, 0.95));
}

/* ===== CALENDAR VIEW ===== */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 14px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-nav button {
    background: rgba(0, 206, 201, 0.2);
    border: 1px solid #00cec9;
    color: #00cec9;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.calendar-nav button:hover {
    background: rgba(0, 206, 201, 0.3);
    transform: translateY(-2px);
}

.calendar-month {
    font-size: 1.5rem;
    font-weight: 900;
    color: #00cec9;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 8px;
}

.view-toggle button {
    padding: 8px 15px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.view-toggle button.active {
    background: #00cec9;
    color: #002b36;
    font-weight: 700;
}

.calendar-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 20px;
    overflow-x: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 100px repeat(auto-fill, minmax(80px, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    min-width: 1200px;
}

.calendar-cell {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calendar-cell.header {
    background: rgba(0, 206, 201, 0.2);
    font-weight: 700;
    font-size: 0.85rem;
    color: #00cec9;
}

.calendar-cell.room-label {
    background: rgba(0, 0, 0, 0.5);
    font-weight: 700;
    justify-content: flex-start;
    padding-left: 15px;
}

.calendar-cell.today {
    background: rgba(253, 203, 110, 0.15);
}

.calendar-booking {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: linear-gradient(135deg, #e17055, #d63031);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

.calendar-booking:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.calendar-booking.checkout-today {
    background: linear-gradient(135deg, #fdcb6e, #f39c12);
}

.calendar-cell.available {
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-cell.available:hover {
    background: rgba(0, 184, 148, 0.2);
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

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

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #2f3640;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-weight: 900;
    color: #00cec9;
}

.floor h3 {
    font-size: 1.4rem;
    font-weight: 900;
    border-left: 5px solid #00cec9;
    padding-left: 12px;
    margin-top: 0;
    color: #fff;
}

.modal-content label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 25px;
}

.btn-save {
    background: #00cec9;
    color: #002b36;
    grid-column: span 2;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save:hover {
    background: #00b8b3;
    transform: translateY(-2px);
}

.btn-close {
    background: #636e72;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close:hover {
    background: #7f8c8d;
}

.btn-checkout {
    background: #d63031;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* ===== HOUSEKEEPING VIEW ===== */
.task-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 20px;
}

.task-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid #00cec9;
    transition: all 0.3s ease;
}

.task-item.completed {
    opacity: 0.5;
    border-left-color: #636e72;
}

.task-status {
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-pending {
    background: rgba(253, 203, 110, 0.2);
    color: #fdcb6e;
}

.status-completed {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.action-card {
    background: rgba(0, 206, 201, 0.1);
    border: 2px solid #00cec9;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.action-card:hover {
    background: rgba(0, 206, 201, 0.2);
    transform: translateY(-5px);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Room card styling already defined above in .room blocks */

/* Bold Room Card Styles */

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s;
        z-index: 999;
        height: 100vh;
    }

    .sidebar:not(.hidden) {
        left: 0;
    }

    .sidebar-toggle {
        display: flex !important;
        font-size: 2rem;
        /* Larger toggle for mobile */
    }

    .main-content {
        padding: 20px 10px;
    }

    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-box {
        padding: 10px 6px;
    }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .nav-icon {
        font-size: 1.6rem;
    }

    /* Flexible Grid for Mobile - Aiming for up to 6 per row */
    .grid {
        display: grid !important;
        /* allow as small as ~48px to fit 6 on narrower screens (iPhone SE etc) */
        grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
        gap: 4px;
        overflow-x: hidden;
        /* remove horizontal scroll if not needed */
        padding-bottom: 10px;
        width: 100%;
    }

    /* Compact Mobile Room Card */
    .room {
        min-height: 70px;
        height: auto;
        padding: 5px 2px;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        min-width: 0;
        /* Critical for Safari grid items to shrink */
        overflow: hidden;
        /* Ensure content doesn't force width */
    }

    .room-id {
        font-size: 0.85rem !important;
        margin-bottom: 2px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .room-type {
        font-size: 0.55rem !important;
        margin-bottom: 2px !important;
        display: block !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: 0.8;
    }

    .guest-name {
        font-size: 0.65rem !important;
        margin: 2px 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .room-status {
        display: none !important;
        /* Hide status text on very small cards */
    }

    .room-details {
        display: none !important;
        /* Hide extra details to save space */
    }

    /* Restore visibility if card is clicked/expanded - optional, for now just compact view */

    .floor {
        padding: 15px;
        margin-bottom: 15px;
    }

    .floor h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
        padding-left: 10px;
    }

    .calendar-header,
    .calendar-nav,
    .date-controls {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .calendar-nav button,
    .date-controls button,
    input[type="date"] {
        width: 100%;
    }
}

/* ===== ACTIVITY SECTION ===== */
.activity-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-list-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    min-height: 150px;
}

.activity-item {
    transition: all 0.2s;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 5px;
}

@media (max-width: 768px) {
    .activity-grid {
        grid-template-columns: 1fr !important;
    }
}