
/* Theme Variables */
:root {
    --primary-color: #1B429C;
    --primary-hover: #152b63;
    --background-color: white;
    --border-color: #ddd;
    --error-color: #dc3545;
    --text-gray: #6c757d;
    --shadow-color: #aaaaaa;
}

/* Calendar Component Styles */
/* Enhanced Calendar Styles */

.calendar-container {
    background-color: var(--background-color);
    border-radius: 12px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    height: 400px;
}

/*#calendar {*/
/*    height: 100%;*/
/*}*/

/* Header styling */
.fc-header-toolbar {
    background-color: var(--primary-color);
    padding: 10px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0 !important;
}

.fc-toolbar-title {
    color: white;
    font-size: 1.2em !important;
    font-weight: bold;
}

/* Navigation buttons */
.fc-prev-button, .fc-next-button {
    background-color: transparent !important;
    border: 1px solid white !important;
    color: white !important;
    border-radius: 50% !important;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.fc-icon {
    font-size: 1em !important;
}

/* Month view styling */
.fc-dayGridMonth-view {
    padding: 10px;
}

/* Day cells */
.fc-daygrid-day {
    cursor: pointer;
    transition: background-color 0.2s;
}

.fc-day-today {
    background-color: rgba(27, 66, 156, 0.1) !important;
}

.fc-day-past {
    color: var(--text-gray);
    background-color: #f5f5f5;
    cursor: not-allowed !important;
}

/* Selected day */
.fc-daygrid-day.fc-day-selected,
.fc-day-today.fc-day-selected {
    background-color: var(--primary-color) !important;
}

.fc-daygrid-day.fc-day-selected .fc-daygrid-day-number,
.fc-day-today.fc-day-selected .fc-daygrid-day-number {
    color: white;
}

/* Current selection highlight */
.fc-highlight {
    background-color: rgba(27, 66, 156, 0.2) !important;
}

/* Day number styling */
.fc-daygrid-day-number {
    padding: 5px !important;
    color: #333;
    font-weight: 500;
}

/* Calendar positioning */
.fc .fc-scrollgrid-liquid {
    height: 100%;
}

/* Weekday headers */
.fc-col-header-cell {
    padding: 8px 0;
    background-color: #f8f9fa;
    font-weight: bold;
    color: var(--primary-color);
}

/* Month/Year display in header */
.fc-toolbar-chunk:nth-child(2) {
    flex-grow: 1;
    text-align: center;
}

/* Calendar grid */
.fc-theme-standard td, .fc-theme-standard th {
    border-color: #e9ecef;
}

/* Better date display */
.date-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#startDateDisplay, #endDateDisplay {
    padding: 8px 15px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-width: 120px;
    text-align: center;
}

.no-date-selected {
    color: var(--text-gray);
}

/* Responsive calendar */
@media (max-width: 768px) {
    .calendar-container {
        height: auto;
        min-height: 300px;
    }
    
    .fc-toolbar-title {
        font-size: 1em !important;
    }
    
    .fc-daygrid-day-number {
        font-size: 12px;
    }
    
    .date-range {
        flex-direction: column;
        gap: 10px;
    }
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: var(--background-color);
    margin: 15% auto;
    padding: 20px;
    width: 300px;
    border-radius: 8px;
    text-align: center;
}

.modal-buttons {
    margin-top: 20px;
}

.modal-button {
    padding: 8px 16px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.confirm-button {
    background-color: var(--primary-color);
    color: var(--background-color);
}

.cancel-button {
    background-color: #e0e0e0;
}

/* Request Form Layout */
.request {
    background-color: var(--background-color);
    margin: auto;
    border-radius: 20px;
    padding: 27px;
    margin-top: 150px;
    display: flex;
    flex-direction: row;
    gap: 27px;
}

.location-container {
    display: flex;
    flex-direction: column;
}

.request-right,
.request-left {
    display: flex;
    flex-direction: column;
}

/* Date Selection Styles */
.selected-date-section {
    margin: 10px 0;
    border-radius: 10px;
}

.selected-date-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* .date-display {
    font-size: 16px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
} */

.no-date-selected {
    color: #666;
    font-size: 0.9rem;
    /* color: var(--text-gray);
    font-style: italic; */
}


/* Location Selection Styles */
.location-section {
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
}

.location-inputs {
    display: flex;
    justify-content: center;
    flex-direction: row;
    gap: 75px;
}

.src-txt,
.dest-txt {
    color: var(--primary-color);
}

.location-inputs select {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--shadow-color);
    border-radius: 50px;
    font-size: 14px;
    max-width: 135px;
    box-shadow: 0px -2px 11px var(--shadow-color);
    text-align: center;
}

.location-inputs select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(27, 66, 156, 0.2);
}

.location-icon {
    background-image: url('locationicon.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 64px;
    height: 64px;
}

/* User Type Section Styles */
.user-type-section {
    margin: 5px 0;
    padding: 5px;
    border-radius: 10px;
}

.user-type-section select {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--shadow-color);
    /* border: 2px solid var(--primary-color); */
    border-radius: 50px;
    font-size: 14px;
    box-shadow: 0px -2px 11px var(--shadow-color);
    text-align: left;
    width: 100%;
    padding: 10px;
    font-size: 18px;
    background-color: var(--background-color);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.user-type-section select:hover {
    border-color: var(--primary-hover);
}

.user-type-section select:focus {
    box-shadow: 0 0 0 2px rgba(27, 66, 156, 0.2);
}

.user-type-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Items Section */
.items-section {
    margin: 20px 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    max-height: 120px;
    /* Keeps height consistent */
    overflow-y: auto;
    /* Enables scrolling */
}

/* Items Container */
.items-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

/* Individual Item Entry */
.item-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.item-entry input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    min-width: 100px;
}

/* Remove Button */
.item-entry button {
    background-color: var(--error-color);
    color: var(--background-color);
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

/* Sidebar for Extra Items */
.items-sidebar {
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border-left: 2px solid var(--border-color);
    padding-left: 10px;
}

/* Error Message */
.error-message {
    color: red;
    font-size: 14px;
    margin-top: 5px;
    display: none;
    /* Hidden by default */
}

/* Form Elements Styles */
.form-group {
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-weight: bold;
}

.form-group input {
    flex: 1;
    border: 1px solid var(--shadow-color);
    border-radius: 50px;
    font-size: 14px;
    box-shadow: 0px -2px 11px var(--shadow-color);
    text-align: left;
    width: 100%;
    padding: 10px;
    font-size: 18px;
}

.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--error-color);
    border-radius: 5px;
    font-size: 14px;
}

/* Error Messages */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Date Range Styles */
.date-range {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* Button Styles */
.add-item-btn {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    margin-top: 10px;
}

.createRequest-parent {
    display: flex;
    justify-content: center;
    align-items: center;

}

.createRequest {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    max-width: 420px;
    border-radius: 40px;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.3s;
}


.createRequest:hover {
    background-color: var(--primary-hover);
}

/* Loading States */
.select-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.select-loading::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Item Selection Styles */
.item-select {
    width: 140px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
}

.item-select optgroup {
    font-weight: bold;
    color: var(--primary-color);
}

.item-select option {
    padding: 8px;
    color: #333;
}

.item-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(27, 66, 156, 0.2);
}

.quantity {
    width: 95px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
}

.unit {
    width: 90px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
}

/* Large screens (desktop) */
@media (max-width: 1200px) {
    .request {
        width: 90%;
        padding: 20px;
        gap: 15px;
    }

    .location-inputs {
        gap: 40px;
    }

    .calendar-container {
        height: 400px;
        width: 100%;
    }
}

/* Medium screens (tablets) */
@media (max-width: 992px) {
    .request {
        width: 95%;
        padding: 15px;
        gap: 20px;
    }

    .location-inputs {
        gap: 30px;
    }

    .request-right,
    .request-left {
        width: 100%;
    }
}

/* Small tablets and large mobile */
@media (max-width: 768px) {
    .request {
        width: 95%;
        padding: 15px;
        margin-top: 0;
        /* Reduce this margin since we added space to main-content */
        margin-bottom: 20px;
        flex-direction: column-reverse;
        gap: 30px;
    }

    main {
        padding-top: 80px;
        /* Increased padding to account for mobile navbar */
        padding-bottom: 20px;
        /* Add some bottom padding for scrolling */
        min-height: 100vh;
        align-items: flex-start;
        /* Align content to top after padding */
    }

    .request-right,
    .request-left {
        width: 100%;

    }

    .location-section {
        flex-direction: row;
    }

    .location-inputs {
        justify-content: space-between;
        gap: 20px;
    }

    .location-inputs select {
        width: 45%;
        max-width: none;
    }

    .location-icon {
        width: 32px;
        height: 32px;
    }

    .calendar-container {
        height: auto;
        margin-bottom: 80px;
        order: -1;
    }

    /* Adjust the calendar days size on mobile */
    .fc-daygrid-day {
        min-height: 45px !important;
        /* Ensure days are not too small */
    }

    /* Make the text in calendar more readable on mobile */
    .fc-daygrid-day-number {
        font-size: 14px;
        padding: 4px !important;
    }

    /* Adjust header sizes */
    .fc-toolbar-title {
        font-size: 1.1em !important;
    }

    .items-section {
        margin-top: 20px;
    }

    .item-entry {
        flex-wrap: wrap;
        gap: 8px;
    }

    .item-select,
    .quantity,
    .unit {
        width: 100%;
        margin-bottom: 8px;
    }

    .createRequest {
        margin-top: 30px;
    }
}

/* Mobile devices */
@media (max-width: 576px) {
    .request {
        width: 100%;
        margin-top: 80px;
        padding: 12px;
    }

    .location-inputs {
        flex-direction: column;
        gap: 15px;
    }

    .location-inputs select {
        width: 100%;
        font-size: 14px;
    }

    .location-icon {
        width: 24px;
        height: 24px;
        margin: 5px auto;
    }

    .calendar-container {
        height: auto;
    }

    /* .selected-date-section .date-range {
        flex-direction: column;
        gap: 10px;
    } */

    /* .date-display {
        padding: 8px;
    } */

    .form-group input,
    .user-type-section select {
        padding: 10px;
        font-size: 14px;
    }

    .items-section h3 {
        font-size: 16px;
    }

    .add-item-btn {
        width: 100%;
        padding: 10px;
    }

    .createRequest {
        padding: 12px;
        font-size: 16px;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .request {
        margin-top: 60px;
        padding: 10px;
    }

    .calendar-container {
        height: auto;
    }

    .location-inputs select,
    .form-group input,
    .user-type-section select,
    .item-select,
    .quantity,
    .unit {
        font-size: 13px;
        padding: 8px;
    }

    .createRequest {
        font-size: 14px;
        padding: 10px;
    }

    .items-section h3 {
        font-size: 15px;
    }
}
 
/* Direction Section Styles */
.direction-section {
    margin-bottom: 20px;
}

.direction-section h3 {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.direction-section .location-inputs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.direction-section select {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: #f8f9fa;
    cursor: pointer;
}

.direction-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Date Range Display */
.date-range-display {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--primary-color);
}

/* User Type Styling */
.user-type-options {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}

.user-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    outline: none;
    position: relative;
}

.user-option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.option-text {
    font-size: 15px;
    font-weight: 500;
}

/* Items Section Enhancements */
.items-section {
    margin: 20px 0;
    max-height: none;
    border: none;
}

.items-section h3 {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.items-list {
    margin-bottom: 15px;
}

.remove-item-btn {
    background-color: #ff5757;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-item-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Improved layout for request container */
.request {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background-color: var(--background-color);
    border-radius: 20px;
    padding: 25px;
    max-width: auto;
    /* margin: 20px auto; */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .request {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .direction-section .location-inputs {
        flex-direction: column;
    }
    
    .direction-icon {
        transform: rotate(90deg);
    }
}