html {
    scroll-behavior: smooth;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #FAFAF5;
    min-height: 100vh;
    padding: 20px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.05);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
    overflow-y: visible;
}

.header {
    background: linear-gradient(135deg, #FF8204 0%, #E67300 100%);
    color: white;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    position: relative;
}

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

.header-logo {
    height: 80px;
    width: auto;
    flex-shrink: 0;
}

.header h1 {
    font-size: 2.5em;
    margin: 0;
    font-weight: 600;
    text-align: center;
    grid-column: 2;
    justify-self: center;
}

.user-info {
    grid-column: 3;
    justify-self: end;
}

.date-selector {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.quick-date-buttons {
    display: flex;
    gap: 10px;
}

.quick-date-btn {
    padding: 10px 20px;
    background: white;
    color: #FF8204;
    border: 2px solid #FF8204;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-date-btn:hover {
    background: #FF8204;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 130, 4, 0.3);
}

.quick-date-btn:active {
    transform: translateY(0);
}

.date-form {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.date-form label {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.date-form input[type="date"] {
    padding: 12px 16px;
    border: 2px solid #FF8204;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
}

.date-form input[type="date"]:focus {
    outline: none;
    border-color: #E67300;
    box-shadow: 0 0 0 3px rgba(255, 130, 4, 0.1);
}

.date-form button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #FF8204 0%, #E67300 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.date-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 130, 4, 0.4);
}

.date-form button:active {
    transform: translateY(0);
}

.building-nav {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.building-nav-btn {
    padding: 8px 16px;
    background: white;
    color: #FF8204;
    border: 2px solid #FF8204;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.building-nav-btn:hover {
    background: #FF8204;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 130, 4, 0.3);
}

.building-nav-btn:active {
    transform: translateY(0);
}

.content {
    padding: 30px;
}

.building-section {
    margin-bottom: 40px;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    scroll-margin-top: 20px;
    overflow: visible;
}

.building-header {
    font-size: 1.5em;
    font-weight: 600;
    color: #FF8204;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FF8204;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.room-section {
    margin-bottom: 0;
    border-radius: 8px;
    padding: 5px;
    border: 1px solid #FF8204;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.room-header {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-left: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px;
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95em;
}

thead {
    background: linear-gradient(135deg, #FF8204 0%, #E67300 100%);
    color: white;
}

th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

th:nth-child(1),
td:nth-child(1) {
    width: 15%;
    white-space: nowrap;
    padding: 10px 30px 10px 12px !important;
    min-width: 120px;
}

th:nth-child(2),
td:nth-child(2) {
    width: 85%;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 10px 12px;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
}

.booking-row {
    position: relative;
    cursor: help;
}

.booking-row.past-event {
    opacity: 0.5;
    color: #999;
}

.booking-row.past-event td {
    color: #999;
}

.booking-row.past-event:hover {
    opacity: 1;
}

.booking-row.ongoing-event td:first-child::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background-color: #ff0000;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.booking-row {
    position: relative;
}

.booking-row .tooltip {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 10000;
    transform: translateX(-50%);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.booking-row .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.booking-row:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.booking-row .tooltip.tooltip-below {
    top: 100%;
    bottom: auto;
    margin-top: 8px;
    margin-bottom: 0;
}

.booking-row .tooltip.tooltip-below::after {
    top: -6px;
    bottom: auto;
    border-top-color: transparent;
    border-bottom-color: #333;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.empty-state .icon {
    font-size: 3em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.login-container {
    text-align: center;
    padding: 100px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-container h2 {
    display: none;
}

.login-container p {
    display: none;
}

.sign-in-separator {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin-bottom: 40px;
}

.sign-in-separator::before,
.sign-in-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.sign-in-separator span {
    padding: 0 15px;
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: #f3f3f3;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    max-width: 400px;
    width: 100%;
}

.login-btn:hover {
    background: #e8e8e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.microsoft-logo {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: white;
    font-size: 0.9em;
}

.logout-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}


@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }

    .header-content {
        justify-self: center;
    }

    .header h1 {
        font-size: 1.8em;
        grid-column: 1;
    }

    .header-logo {
        height: 65px;
    }

    .user-info {
        grid-column: 1;
        justify-self: center;
    }

    .date-selector {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 15px;
        min-width: 0;
    }

    .quick-date-buttons {
        width: 100%;
        justify-content: center;
    }

    .quick-date-btn {
        flex: 1;
    }

    .date-form {
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
        width: 100%;
    }

    .date-form label {
        flex-shrink: 0;
    }

    .date-form input[type="date"],
    .date-form button {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 8px;
    }

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

    .user-info {
        position: static;
        margin-top: 15px;
        justify-content: center;
    }
}

/* Support redirect page */
body.support-redirect {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #FAFAF5 0%, #f0ebe0 50%, #e8e2d5 100%);
    box-shadow: none;
}

.support-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1), 0 2px 12px rgba(0, 0, 0, 0.06);
    text-align: center;
    max-width: 480px;
    width: 100%;
    border: 1px solid rgba(255, 130, 4, 0.12);
    position: relative;
}

.lang-switcher {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.lang-btn {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
}

.lang-btn[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.95);
    color: #E67300;
    border-color: white;
}

.support-logo-wrap {
    background: linear-gradient(135deg, #FF8204 0%, #E67300 100%);
    padding: 24px 32px;
}

.support-logo {
    display: block;
    margin: 0 auto;
    height: 150px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

.support-card-content {
    padding: 36px 56px 48px;
}

.support-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.support-intro {
    margin: 0 0 28px;
    font-size: 0.95rem;
    color: #555;
}

.support-links {
    display: grid;
    gap: 12px;
}

.support-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    padding: 14px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    color: #FF8204;
    background: rgba(255, 130, 4, 0.08);
    border: 2px solid rgba(255, 130, 4, 0.25);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.support-link .bi {
    font-size: 1.15em;
}

.support-link:hover {
    background: linear-gradient(135deg, #FF8204 0%, #E67300 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 130, 4, 0.35);
}

.support-link:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    body.support-redirect {
        padding: 16px;
    }

    .lang-switcher {
        top: 8px;
        right: 8px;
    }

    .lang-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .support-logo-wrap {
        padding: 20px 24px;
    }

    .support-logo {
        height: 42px;
        max-width: 190px;
    }

    .support-card-content {
        padding: 28px 24px 36px;
    }

    .support-title {
        font-size: 1.5rem;
    }
}
