.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.modal-content.modal-sm {
    max-width: 400px;
}

.modal-content.modal-md {
    max-width: 600px;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-content.modal-xl {
    max-width: 1000px;
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    margin: 0;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.modal-close:hover svg {
    stroke: #dc3545;
}

.modal-body {
    padding: 2rem;
}

.modal-header.primary {
    background: var(--gradient-primary);
    border-bottom: none;
}

.modal-header.primary h3 {
    color: white;
}

.modal-header.primary .modal-close svg {
    stroke: white;
}

.modal-header.primary .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-header.primary .modal-close:hover svg {
    stroke: white;
}

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.route-modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.route-modal-overlay.show {
    display: block;
}

.route-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background-color: #2C3E50;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUpFromBottom 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.route-sheet-handle {
    width: 40px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 12px auto 8px auto;
    flex-shrink: 0;
    cursor: grab;
}

.route-sheet-handle:active {
    cursor: grabbing;
}

.route-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.route-sheet-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.route-sheet-header h3 i {
    color: #0066B3;
}

.route-sheet-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
}

.route-sheet-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.route-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.route-sheet-content::-webkit-scrollbar {
    width: 6px;
}

.route-sheet-content::-webkit-scrollbar-track {
    background: transparent;
}

.route-sheet-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.transport-options {
    margin-bottom: 25px;
}

.transport-options h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.transport-hint {
    color: #95A5A6;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.transport-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.transport-buttons .transport-btn {
    flex: 1;
    min-width: 70px;
    height: 70px;
    flex-direction: column;
    gap: 6px;
}

.transport-buttons .transport-btn i {
    font-size: 24px;
}

.transport-buttons .transport-btn span {
    font-size: 12px;
}

.route-inputs {
    margin: 25px 0;
    position: relative;
}

.route-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.route-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.route-icon.start-icon {
    background-color: #0066B3;
}

.route-icon.end-icon {
    background-color: #2Ecc71;
}

.route-icon i {
    color: white;
    font-size: 16px;
}

.route-input-wrapper {
    flex: 1;
    position: relative;
}

.route-input-wrapper label {
    display: block;
    color: #95A5A6;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.route-input {
    width: 100%;
    background-color: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 15px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.route-input:focus {
    border-color: #0066B3;
    background-color: #3E5568;
}

.route-input::placeholder {
    color: #7F8C8D;
}

.route-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
}

.route-suggestions.show {
    display: block;
}

.route-suggestion-item {
    padding: 12px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-suggestion-item:last-child {
    border-bottom: none;
}

.route-suggestion-item:hover {
    background-color: #3E5568;
}

.route-suggestion-item:first-child {
    background-color: #3E5568;
}

.route-suggestion-item:first-child:hover {
    background-color: #475F77;
}

.route-suggestion-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.route-suggestion-name i {
    margin-right: 8px;
    color: #0066B3;
}

.route-suggestion-details {
    font-size: 0.85rem;
    color: #95A5A6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-suggestion-details i {
    font-size: 0.75rem;
}

.route-suggestions::-webkit-scrollbar {
    width: 6px;
}

.route-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.route-suggestions::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.route-connector {
    position: absolute;
    left: 17px;
    top: 45px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connector-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #0066B3 0%, #2Ecc71 100%);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.swap-btn {
    background-color: #34495E;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 1;
    transition: all 0.3s;
}

.swap-btn:hover {
    background-color: #0066B3;
    border-color: #0066B3;
    transform: rotate(180deg);
}

.swap-btn i {
    font-size: 14px;
}

.route-actions {
    margin-top: 25px;
}

.route-search-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0066B3, #004D8A);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.route-search-btn:hover {
    background: linear-gradient(135deg, #3399DD, #0066B3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 179, 0.3);
}

.route-search-btn:active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .route-bottom-sheet {
        left: 50%;
        transform: translateX(-50%);
        max-width: 600px;
        border-radius: 25px;
        max-height: 90vh;
        bottom: 20px;
    }

    .route-sheet-handle {
        display: none;
    }
}

.place-modal-info {
    margin-bottom: 1.5rem;
}

.place-modal-info p {
    margin: 0.75rem 0;
    color: #2c3e50;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.place-modal-info p i {
    color: #4A90E2;
    min-width: 20px;
    text-align: center;
}

.place-modal-category {
    font-size: 1.1rem;
}

.place-modal-category strong {
    color: #4A90E2;
}

.place-modal-address,
.place-modal-phone,
.place-modal-website,
.place-modal-lines,
.place-modal-distance {
    padding-left: 0;
}

.place-modal-phone a,
.place-modal-website a {
    color: #4A90E2;
    text-decoration: none;
}

.place-modal-phone a:hover,
.place-modal-website a:hover {
    text-decoration: underline;
}

.place-modal-distance {
    font-weight: 600;
    color: #27ae60;
}

.place-modal-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.place-modal-actions .btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498DB, #2980B9);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.place-modal-actions .btn:hover {
    background: linear-gradient(135deg, #5DADE2, #3498DB);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.place-modal-actions .btn:active {
    transform: translateY(0);
}

.place-modal-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}

#modalAjouterCarte {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

#modalAjouterCarte .modal-content {
    animation: slideUp 0.4s ease;
}

.color-option:hover div {
    transform: scale(1.05);
}

.color-option input[type="radio"]:checked + div {
    border-color: #4A90E2 !important;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
}
