/* Base Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 1rem 1rem 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal-content.active {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem;
}

.modal.desktop-mode {
    align-items: center;
}

.modal.desktop-mode .modal-content {
    border-radius: 1rem;
    max-width: 500px;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.modal.desktop-mode .modal-content.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Form Styles */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
    background-color: white;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
    background-color: white;
}

/* Button Styles */
.btn-primary {
    background-color: #0ea5e9;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #0284c7;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #1f2937;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-red {
    background-color: #ef4444;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-red:hover {
    background-color: #dc2626;
}

.btn-green {
    background-color: #10b981;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-green:hover {
    background-color: #059669;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #0ea5e9;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Section Title */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

/* Transport Mode Choice */
.transport-mode-choice {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.transport-mode-choice span {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.transport-mode-choice.active {
    background-color: #f0f9ff;
    border-color: #bae6fd;
    color: #0ea5e9;
}

/* Geocoder Customization */
.geocoder-container .mapboxgl-ctrl-geocoder {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0.5rem;
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}

.geocoder-container .mapboxgl-ctrl-geocoder input {
    height: 44px;
    padding: 6px 45px;
}

.geocoder-container .mapboxgl-ctrl-geocoder--icon {
    top: 10px;
}

/* Dark Mode */
.dark-mode {
    background-color: #0f172a;
    color: #f8fafc;
}

.dark-mode .modal-content,
.dark-mode #notificationBanner,
.dark-mode #lightInfoPanel .bg-white {
    background-color: #1e293b;
    color: #f8fafc;
}

.dark-mode .modal-header {
    border-bottom-color: #334155;
}

.dark-mode .form-input,
.dark-mode .form-select,
.dark-mode .geocoder-container .mapboxgl-ctrl-geocoder {
    background-color: #334155;
    color: #f8fafc;
}

.dark-mode .form-input:focus,
.dark-mode .form-select:focus {
    background-color: #475569;
}

.dark-mode .form-label,
.dark-mode .section-title {
    color: #f8fafc;
}

.dark-mode .text-gray-600,
.dark-mode .text-gray-500,
.dark-mode #notificationMessage {
    color: #cbd5e1;
}

.dark-mode .bg-gray-50,
.dark-mode .bg-gray-100 {
    background-color: #334155;
}

.dark-mode .btn-secondary {
    background-color: #334155;
    color: #f8fafc;
}

.dark-mode .btn-secondary:hover {
    background-color: #475569;
}

.dark-mode .transport-mode-choice {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

.dark-mode .transport-mode-choice.active {
    background-color: #0c4a6e;
    border-color: #0284c7;
    color: #e0f2fe;
}

.dark-mode #routePanel,
.dark-mode #searchContainer {
    background-color: #1e293b;
    color: #f8fafc;
}