/* Base variables */
:root {
    --primary-green: #12753e;
    --primary-blue: #2a3c8f;
    --dark-gray: #333333;
    --medium-gray: #c0c0c0;
    --light-gray: #f5f5f5;
}

.notification-badge {
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    position: relative;
    top: -8px;
    left: -5px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Global Responsive Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.form-header h2 {
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
}

.form-header p {
    color: var(--dark-gray);
    margin: 0;
    font-size: clamp(0.9rem, 3vw, 1rem);
}

/* Section Titles */
.section-title {
    color: var(--primary-green);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
    font-size: clamp(1.1rem, 3vw, 1.3rem);
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-group label {
    width: 100%;
    max-width: 220px;
    font-weight: 500;
    color: var(--primary-green);
    margin-bottom: 0.25rem;
}

/* Form Controls */
.form-control {
    flex: 1;
    width: 100%;
    min-width: 0;
    /* Prevents flex items from overflowing */
    padding: 0.75rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--dark-gray);
    caret-color: var(--dark-gray);
    -webkit-text-fill-color: var(--dark-gray);
    transition: all 0.3s;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea {
    color: var(--dark-gray);
    caret-color: var(--dark-gray);
    -webkit-text-fill-color: var(--dark-gray);
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(18, 117, 62, 0.1);
    outline: none;
}

input::placeholder,
textarea::placeholder,
select::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #6b7280 !important;
    opacity: 1;
}

select.form-control {
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

textarea.form-control {
    min-height: 100px;
}

/* Availability Check */
.availability-check {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

/* Buttons */
.btn-check {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
}

.btn-check:hover {
    background-color: #0e5e30;
}

.btn-submit {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    width: 100%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    background-color: #1a2a7a;
}

/* Additional Elements */
.approver-info {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: var(--light-gray);
    border-radius: 6px;
}

#availability-message {
    padding: 10px 12px;
    border-radius: 4px;
    display: none;
    width: 100%;
    text-align: center;
}

.available {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.not-available {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}


/* Facility Details */
.facility-details {
    margin-top: 1rem;
    width: 100%;
    max-width: 500px;
}

.facility-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    gap: 0.5rem;
}

.detail-icon {
    color: var(--primary-green);
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.detail-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Select2 Styling */
.select2-container {
    width: 100% !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    margin-top: 5vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary-green);
}

/* Success and Error Message Styling */
.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    animation: slideDownAlert 0.4s ease-out;
}

@keyframes slideDownAlert {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpAlert {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Close button styling - hidden */
.alert .close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    opacity: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: none;
    pointer-events: none;
}

.alert .close:hover {
    opacity: 0;
}

/* Auto-dismiss animation */
.alert.auto-dismiss {
    animation: slideDownAlert 0.4s ease-out, slideUpAlert 0.4s ease-in 4.6s forwards;
}

.step-comments {
    background-color: #f9f9f9;
    padding: 10px 15px;
    margin: 10px 0;
    font-style: italic;
    color: #555;
    font-size: 0.9rem;
    border-radius: 5px;
}

.step-comments small {
    display: block;
    line-height: 1.5;
}



/* Custom styling for disabled dates in Flatpickr */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #ff5252 !important;
    background-color: rgba(255, 82, 82, 0.1) !important;
    /* Light red background */
    border-color: transparent !important;
    cursor: not-allowed;
    font-weight: bold;
}

/* Optional: Add a small icon to indicate the date is unavailable */
.flatpickr-day.flatpickr-disabled:after {
    position: absolute;
    font-size: 8px;
    top: 2px;
    right: 2px;
    color: #ff5252;
}

/* Make sure the disabled date styling has higher priority */
.flatpickr-calendar .flatpickr-day.flatpickr-disabled {
    color: #ff5252 !important;
}

/* Navbar styles handled by styles.css */

/* RESPONSIVE BREAKPOINTS */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .form-group {
        flex-direction: row;
        gap: 1rem;
    }
    
    .form-group label {
        max-width: 150px;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
        padding: 1rem;
    }
    
    .form-container {
        max-width: 100%;
        padding: 1.25rem;
        margin: 1rem;
    }
    
    .form-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-group label {
        max-width: 100%;
        width: 100%;
    }
    
    .form-control {
        width: 100%;
    }
    
    .equipment-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .facility-details-grid {
        grid-template-columns: 1fr;
    }
    
    /* Navbar mobile menu handled by styles.css */
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .container {
        max-width: 100%;
        padding: 0.75rem;
    }
    
    .form-container {
        max-width: 100%;
        padding: 1rem;
        margin: 0.75rem;
        border-radius: 8px;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .form-header p {
        font-size: 0.9rem;
    }
    
    .form-group {
        flex-direction: column;
        margin-bottom: 1rem;
        gap: 0.25rem;
    }
    
    .form-group label {
        max-width: 100%;
        width: 100%;
        font-size: 0.9rem;
    }
    
    .form-control {
        width: 100%;
        padding: 0.625rem 0.75rem;
        font-size: 16px;
        min-height: 44px;
    }
    
    .availability-check {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .btn-check {
        width: 100%;
        min-height: 44px;
    }
    
    .btn-submit {
        width: 100%;
        min-height: 44px;
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .equipment-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .facility-details-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .detail-item {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.25rem;
    }
    
    .close-modal {
        top: 10px;
        right: 12px;
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin: 1rem 0 0.75rem;
    }
    
    .alert {
        font-size: 0.9rem;
        padding: 12px;
        padding-left: 40px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0.5rem;
    }
    
    .form-container {
        padding: 0.75rem;
        margin: 0.5rem;
    }
    
    .form-header h2 {
        font-size: 1.25rem;
    }
    
    .form-control {
        padding: 0.625rem 0.75rem;
        font-size: 16px;
    }
    
    .btn-submit {
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
    }
    
    .btn-check {
        font-size: 0.9rem;
        padding: 0.625rem;
    }
    
    .equipment-grid {
        grid-template-columns: 1fr;
    }
    
    .facility-details-grid {
        grid-template-columns: 1fr;
    }
    
    .close-modal {
        top: 8px;
        right: 10px;
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 0.95rem;
    }
}