/* Global styles */
:root {
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --active-color: var(--bs-primary);
    --active-bg: rgba(var(--bs-primary-rgb), 0.1);
}

/* Dark theme colors */
[data-bs-theme="dark"] {
    --bs-primary: #ffc107;
    --bs-primary-rgb: 255, 193, 7;
    --active-color: var(--bs-primary);
    --active-bg: rgba(var(--bs-primary-rgb), 0.1);
}

/* Theme toggle */
#themeToggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
}

#themeToggle:hover {
    background-color: var(--active-bg);
}

.theme-icon-light,
.theme-icon-dark {
    display: none;
}

[data-bs-theme="light"] .theme-icon-light {
    display: block;
}

[data-bs-theme="dark"] .theme-icon-dark {
    display: block;
}

/* Date Time Container */
.date-time-container {
    min-height: 380px;
    margin-bottom: 1.5rem;
    position: relative;
}

.calendar-container,
.time-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.calendar-wrapper {
    display: flex;
    justify-content: center;
}

/* Room Selector */
.room-button {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    min-height: 100px;
    background-color: white;
    color: #495057;
    cursor: pointer;
    border-radius: 0.5rem;
}

.room-button:hover:not(.selected) {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.room-button.selected {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
    position: relative;
    z-index: 1;
}

.room-button.selected:hover {
    background-color: var(--bs-primary);
    color: white;
}

.room-button.selected small {
    color: rgba(255, 255, 255, 0.9);
}

/* Calendar */
.calendar {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.calendar table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.calendar th,
.calendar td {
    text-align: center;
    padding: 0.5rem;
}

.calendar td button {
    width: 2rem;
    height: 2rem;
    line-height: 2rem;
    padding: 0;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
}

.calendar td button:not(:disabled):hover {
    background-color: var(--active-bg);
}

.calendar td button.selected {
    background-color: var(--bs-primary);
    color: white;
}

.calendar td button:disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar td button.text-muted {
    color: #6c757d;
}

/* Time Selector */
#timeSelector {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    margin-top: 1rem;
    overflow-y: auto;
}

.time-columns-container {
    display: flex;
    gap: 2rem;
    height: 100%;
}

.time-slots-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.time-slots-grid {
    display: grid;
    gap: 0.5rem;
    width: 100%;
}

.hour-container {
    margin-bottom: 1rem;
}

.hour-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.time-slot {
    font-size: 0.875rem;
    padding: 0.5rem;
    border: 1px solid var(--bs-primary);
    border-radius: 0.5rem;
    background: white;
    color: var(--bs-primary);
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.time-slot:hover:not(:disabled) {
    background-color: var(--active-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.1);
}

.time-slot.selected {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.2);
}

.time-slot.selected:hover:not(:disabled) {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.time-slot:disabled {
    border-color: #dee2e6;
    color: #6c757d;
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.time-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0;
}

/* Unavailable Message */
#unavailableMessage {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(3px);
    margin-top: 0px;
}

.message-content {
    text-align: center;
    padding: 1rem;
    border: none;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    width: 90%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message-icon-wrapper {
    background-color: rgba(220, 53, 69, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.message-icon {
    font-size: 2rem;
    color: #dc3545;
}

.message-text-wrapper {
    color: #212529;
}

.message-title {
    font-weight: 600;
    color: #dc3545;
    font-size: 1.25rem;
}

.message-description {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Controls */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Time Selection Info */
.time-selection-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.time-selection-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.continuous-time,
.interval {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: white;
    color: var(--bs-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Dark theme specific styles */
[data-bs-theme="dark"] .time-slot {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: transparent;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .time-slot:hover:not(:disabled) {
    background-color: var(--bs-primary);
    color: #000;
    border-color: #fff;
}

[data-bs-theme="dark"] .time-slot.selected {
    background-color: var(--bs-primary);
    color: #000;
    border-color: #fff;
}

[data-bs-theme="dark"] .time-slot.selected:hover:not(:disabled) {
    background-color: #e6af06;
    border-color: #fff;
    color: #000;
}

[data-bs-theme="dark"] .time-slot:disabled {
    border-color: rgba(255, 255, 255, 0.3);
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

[data-bs-theme="dark"] .room-button.selected {
    background-color: var(--bs-primary);
    color: #000;
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .room-button.selected:hover {
    background-color: var(--bs-primary);
    color: #000;
}

[data-bs-theme="dark"] .room-button.selected small {
    color: rgba(0, 0, 0, 0.8);
}

/* Dark theme specific styles for time selection info */
[data-bs-theme="dark"] .time-selection-info {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .continuous-time,
[data-bs-theme="dark"] .interval {
    background-color: rgba(255, 193, 7, 0.15);
    color: var(--bs-primary);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Dark theme styles for room buttons */
[data-bs-theme="dark"] .room-button {
    background-color: transparent;
    color: var(--bs-body-color);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .room-button:hover:not(.selected) {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-bs-theme="dark"] .room-button.selected {
    background-color: var(--bs-primary);
    color: #000;
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .room-button.selected:hover {
    background-color: var(--bs-primary);
    color: #000;
}

[data-bs-theme="dark"] .room-button.selected small {
    color: rgba(0, 0, 0, 0.8);
}

/* Dark theme styles for calendar */
[data-bs-theme="dark"] .calendar td button.selected {
    background-color: var(--bs-primary);
    color: #000;
}

/* Current date styles */
.calendar td button.current-day {
    position: relative;
}

.calendar td button.current-day::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--bs-primary);
}

[data-bs-theme="dark"] .calendar td button.current-day::after {
    background-color: var(--bs-primary);
}

/* Dark theme styles for submit button */
[data-bs-theme="dark"] .btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #000;
}

[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:focus,
[data-bs-theme="dark"] .btn-primary:active {
    background-color: #e6af06; /* Slightly darker yellow */
    border-color: #e6af06;
    color: #000;
}

/* Toast Notifications */
.toast {
    min-width: 300px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast.success .toast-header {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.toast.error .toast-header {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.toast.warning .toast-header {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.toast.info .toast-header {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

[data-bs-theme="dark"] .toast.success .toast-header {
    background-color: rgba(25, 135, 84, 0.2);
}

[data-bs-theme="dark"] .toast.error .toast-header {
    background-color: rgba(220, 53, 69, 0.2);
}

[data-bs-theme="dark"] .toast.warning .toast-header {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

[data-bs-theme="dark"] .toast.info .toast-header {
    background-color: rgba(13, 110, 253, 0.2);
}

/* Dark theme styles for unavailable message */
[data-bs-theme="dark"] .message-content {
    background-color: var(--bs-body-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .message-icon-wrapper {
    background-color: rgba(220, 53, 69, 0.2);
}

[data-bs-theme="dark"] .message-icon {
    color: #ff6b6b;
}

[data-bs-theme="dark"] .message-title {
    color: #ff6b6b;
}

[data-bs-theme="dark"] .message-description {
    color: #ff8585;
}

[data-bs-theme="dark"] #unavailableMessage {
    background-color: var(--bs-body-bg);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Room Selector Container */
    .room-selector-wrapper {
        position: relative;
        margin: 0 -1rem 1.5rem;
    }

    /* Scroll Indicators */
    .scroll-indicator {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 32px;
        pointer-events: none;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .scroll-indicator::after {
        content: '';
        width: 24px;
        height: 24px;
        background-color: var(--bs-primary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.2rem;
    }

    .scroll-indicator.left {
        left: 0;
        background: linear-gradient(to right, var(--bs-body-bg) 0%, transparent 100%);
    }

    .scroll-indicator.right {
        right: 0;
        background: linear-gradient(to left, var(--bs-body-bg) 0%, transparent 100%);
    }

    .scroll-indicator.left::after {
        content: '←';
    }

    .scroll-indicator.right::after {
        content: '→';
    }

    .scroll-indicator.visible {
        opacity: 1;
    }

    /* Room Selector */
    #roomSelector {
        flex-direction: row !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 0.75rem;
        padding: 0.5rem 1rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        position: relative;
    }

    #roomSelector::-webkit-scrollbar {
        display: none;
    }

    .room-button {
        flex: 0 0 85% !important;
        width: 85% !important;
        min-height: 80px;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        transition: transform 0.3s ease;
    }

    .room-button.selected {
        transform: scale(1.02);
    }

    .room-button:first-child {
        margin-left: 0;
    }

    .room-button:last-child {
        margin-right: 1rem;
    }

    /* Date Time Container */
    .date-time-container .row {
        flex-direction: column;
    }

    .calendar-container,
    .time-container {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    /* Calendar */
    .calendar {
        margin: 0 auto 2rem;
    }

    /* Divider */
    .col-md-1.d-flex {
        display: none !important;
    }

    /* Time Selector */
    .time-columns-container {
        flex-direction: column;
        gap: 1rem;
    }

    .time-slots-container {
        width: 100%;
    }

    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Form Controls */
    .row.g-3 > [class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Toast Notifications */
    .toast-container {
        width: 100%;
        padding: 1rem;
    }

    .toast {
        width: 100%;
        min-width: auto;
    }

    /* Time Selection Info */
    .time-selection-info {
        margin-top: 1rem;
    }

    .continuous-time,
    .interval {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    /* Theme Toggle */
    #themeToggle {
        position: fixed !important;
        bottom: 1rem;
        right: 1rem;
        z-index: 1000;
        width: 48px;
        height: 48px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    /* Card Body Padding */
    .card-body {
        padding: 1rem;
    }

    /* Submit Button */
    .btn-primary {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 375px) {
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .calendar td button {
        width: 1.8rem;
        height: 1.8rem;
        line-height: 1.8rem;
        font-size: 0.9rem;
    }

    .calendar th {
        font-size: 0.9rem;
        padding: 0.3rem;
    }
}

/* Mobile Calendar Modal */
.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bs-body-bg);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calendar-modal.show {
    opacity: 1;
    display: block;
}

.calendar-modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-modal-body {
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.calendar-modal .calendar {
    width: 100%;
    max-width: 350px;
}

.calendar-close-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: var(--bs-body-color);
    cursor: pointer;
}

/* Mobile Date Input */
.mobile-date-input .input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-date-input .input-group-text {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.mobile-date-input .form-control {
    border-color: var(--bs-primary);
    cursor: pointer;
    font-weight: 500;
}

[data-bs-theme="dark"] .mobile-date-input .input-group-text {
    color: #000;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Calendar */
    .calendar-container {
        margin-bottom: 1.5rem;
    }

    .calendar-modal .calendar td button {
        width: 2.5rem;
        height: 2.5rem;
        line-height: 2.5rem;
        font-size: 1rem;
    }
    
    // ... rest of existing mobile styles ...
}

/* Time Selector Styles */
.time-slots-grid {
    display: grid;
    gap: 0.5rem;
}

/* Mobile Time Selector */
@media (max-width: 768px) {
    .time-slots-container {
        position: relative;
        margin-bottom: 1rem;
    }

    .time-slots-wrapper {
        position: relative;
        margin: 0 1.5rem;
    }

    .mobile-time-grid {
        display: flex !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0;
        gap: 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100%;
    }

    .mobile-time-grid::-webkit-scrollbar {
        display: none;
    }

    .mobile-time-grid .time-slot {
        flex: 0 0 calc((100% - 1rem) / 3);
        min-width: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    /* Hide desktop grid on mobile */
    .desktop-time-grid {
        display: none !important;
    }

    /* Show mobile grid */
    .mobile-time-grid {
        display: flex !important;
    }

    /* Scroll Indicators */
    .time-scroll-indicator {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        background-color: var(--bs-primary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.2rem;
        z-index: 2;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .time-scroll-indicator.left {
        left: -0.75rem;
    }

    .time-scroll-indicator.right {
        right: -0.75rem;
    }

    .time-scroll-indicator.visible {
        opacity: 1;
    }

    [data-bs-theme="dark"] .time-scroll-indicator {
        color: #000;
    }

    /* Hide period labels on mobile */
    .time-slots-container::before {
        display: none !important;
    }

    /* Adjust container layout for mobile */
    .time-columns-container {
        flex-direction: column;
        gap: 0;
    }

    /* Hide second container on mobile */
    .time-slots-container:nth-child(2) {
        display: none !important;
    }
}

/* Desktop Time Selector */
@media (min-width: 769px) {
    /* Hide mobile elements */
    .mobile-time-grid,
    .time-scroll-indicator {
        display: none !important;
    }

    /* Show desktop grid */
    .desktop-time-grid {
        display: grid !important;
    }

    /* Desktop specific styles */
    .time-columns-container {
        display: flex;
        gap: 2rem;
    }

    .time-slots-container {
        flex: 1;
    }

    .time-slots-container::before {
        content: attr(data-period);
        display: block;
        margin-bottom: 0.75rem;
        font-weight: 500;
        color: var(--bs-body-color);
        padding-left: 0.5rem;
    }
} 