/* ==========================================================================
   assets/css/trip-form.css
   This file contains all styles for pop-up modals and the forms inside them.
   It is used by both the "Add Trip" and "Add Itinerary Item" features.
   ========================================================================== */

/* --- Generic Modal Container (the dark, blurred background) --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* --- State when the modal is visible --- */
.modal-container.show {
    opacity: 1;
    pointer-events: all;
}

/* --- The Modal Card itself (the white box) --- */
.modal-container .trip-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-container.show .trip-modal {
    transform: scale(1);
}

/* --- Content area inside the modal card --- */
.modal-content {
    padding: 2rem 2.5rem;
    position: relative;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

/* --- The '×' close button --- */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.close-modal:hover {
    color: #333;
    transform: rotate(90deg);
}


/* --- Generic Form Styling (applies to all forms with class="trip-form") --- */

.trip-form .form-group {
    margin-bottom: 1.25rem;
}

.trip-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.trip-form input,
.trip-form textarea,
.trip-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white; /* Explicitly set background */
}

.trip-form input::placeholder,
.trip-form textarea::placeholder {
    color: #aaa;
}

.trip-form input:focus,
.trip-form textarea:focus,
.trip-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.15);
    outline: none;
}

/* Specific styling for date inputs */
.trip-form input[type="date"] {
    color: #666;
}

/* Styling for the custom dropdown arrow */
.trip-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236C63FF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: .65em auto;
    cursor: pointer;
}

/* Container for side-by-side inputs like Date & Time */
.date-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Submit button styling */
.trip-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    margin-top: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
}

/* Spinner for loading states on buttons */
.spinner {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.4);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border-left-color: white;
    animation: spin 1s ease infinite;
}


/* ==========================================================================
   RESPONSIVE STYLES for modals and forms
   ========================================================================== */

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
    }

    .modal-content h3 {
        font-size: 1.5rem;
    }
    
    /* This makes the date/time inputs stack on mobile */
    .date-group {
        grid-template-columns: 1fr;
    }
}