/**
 * Frontend CSS for Anonymous Dealer Locator - WordPress native styling
 */

/* Container and layout */
.adl-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.adl-container h2 {
    margin-bottom: 0.5em;
}

.adl-container .subtitle {
    color: #666;
    margin-bottom: 2em;
}

/* Search box styling - Modern design */
.adl-search-container {

    padding: 20px;
    border-radius: 4px;
}

.adl-search-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.adl-search-box {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    align-items: stretch;
}

.adl-search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.adl-search-input-wrapper:focus-within {
    border-color: #e09900;
    box-shadow: 0 0 0 2px rgba(224, 153, 0, 0.1);
}

.adl-search-box input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    outline: none;
}

.adl-search-box input[type="text"]::placeholder {
    color: #999;
}

.adl-search-box input[type="text"]:focus {
    outline: none;
}

.adl-search-icon-btn {
    padding: 0;
    margin: 0;
    width: 50px;
    height: 100%;
    background: #e09900;
    color: white;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.adl-search-icon-btn:hover {
    background: #c08500;
}

.adl-search-icon-btn:focus {
    background: #c08500;
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.adl-search-icon-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.adl-search-icon-btn i {
    font-size: 16px;
    line-height: 1;
}

.adl-search-icon-btn.adl-loading i {
    animation: adl-spin 1s linear infinite;
}

/* Geolocation button - Map overlay icon button */
.adl-geo-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #333 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

.adl-geo-btn:before {
    content: "\f3c5";
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
    display: block;
    font-size: 18px;
    line-height: 1;
    color: #333;
}

.adl-geo-btn:hover {
    background: #f8f9fa !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-2px);
}

.adl-geo-btn:hover:before {
    color: #0073aa;
}

.adl-geo-btn:focus {
    background: #f8f9fa !important;
    border-color: #0073aa !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    outline: none;
}

.adl-geo-btn:focus:before {
    color: #0073aa;
}

.adl-geo-btn:active {
    transform: translateY(0);
}

.adl-geo-btn:disabled,
.adl-geo-btn.adl-geo-loading {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.adl-geo-btn.adl-geo-loading:before {
    content: "\f01e";
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
    animation: adl-spin 1s linear infinite;
}

@keyframes adl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Search results - WordPress style */
.adl-search-results {
    margin-bottom: 20px;
}

.adl-results-header {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    color: #1d2327;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.adl-no-results {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
}

.adl-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
}

/* Map styling - WordPress style */
.adl-map {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.adl-map-container {
    margin-top: 20px;
    position: relative;
}

.adl-map-title {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.adl-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    padding: 20px;
    border-radius: 4px;
    z-index: 1000;
    text-align: center;
}

.adl-map-loading p {
    margin: 0;
    color: #1d2327;
}

/* Kort markører - Moderne design */
.adl-marker {
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adl-marker-icon {
    width: 32px;
    height: 32px;
    background-color: #98c82f;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adl-marker-icon::before {
    content: '';
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
}

.adl-marker:hover .adl-marker-icon {
    background-color: #87b027;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
    transform: scale(1.1);
}

/* Bruger marker (geolocation) - Moderne design */
.adl-user-marker {
    cursor: default;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adl-user-marker-icon {
    width: 40px;
    height: 40px;
    background-color: #28a745;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    position: relative;
    animation: adl-pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adl-user-marker-icon::before {
    content: '';
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.adl-user-marker-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

@keyframes adl-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4), 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4), 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4), 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Modal styling - WordPress style */
.adl-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 160000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.adl-modal-content {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.adl-modal-header {
    background: #f0f0f1;
    border-bottom: 1px solid #c3c4c7;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.adl-modal-header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    color: #1d2327;
}

.adl-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #646970;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.adl-modal-close:hover {
    color: #1d2327;
}

.adl-modal-body {
    padding: 20px;
}

/* Form styling - WordPress style */
.adl-form-group {
    margin-bottom: 20px;
}

.adl-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1d2327;
}

.adl-form-group input,
.adl-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background-color: #fff;
    color: #2c3338;
    font-size: 14px;
    line-height: 1.42857143;
    box-sizing: border-box;
}

.adl-form-group input:focus,
.adl-form-group textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}

.adl-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.adl-form-group:last-child {
    margin-bottom: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Buttons - WordPress style */
.adl-submit-btn,
.adl-cancel-btn {
    display: inline-block;
    text-decoration: none;
    font-size: inherit;
    font-family: inherit;
    line-height: 2.15384615;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
}

.adl-submit-btn {
    background: #e09900;
    border-color: #e09900;
    color: #fff;
}

.adl-submit-btn:hover,
.adl-submit-btn:focus {
    background: #c08500;
    border-color: #c08500;
    color: #fff;
}

.adl-submit-btn:disabled {
    color: #a7aaad !important;
    border-color: #dcdcde !important;
    background: #f6f7f7 !important;
    box-shadow: none !important;
    cursor: default;
}

.adl-cancel-btn {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #2c3338;
}

.adl-cancel-btn:hover,
.adl-cancel-btn:focus {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

/* Messages - WordPress style */
.adl-form-messages {
    margin-top: 15px;
}

.adl-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 16px;
    border-radius: 4px;
}

.adl-form-messages .adl-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
}


/* Mapbox overrides */
.mapboxgl-popup-content {
    padding: 15px !important;
    border-radius: 8px !important;
}

.mapboxgl-popup-close-button {
    font-size: 18px !important;
    padding: 5px !important;
    color: #999 !important;
}

.mapboxgl-popup-close-button:hover {
    background-color: #f8f9fa !important;
    color: #333 !important;
}

/* Tilgængelighed */
.adl-search-box button:focus,
.adl-submit-btn:focus,
.adl-cancel-btn:focus,
.adl-modal-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styling */
@media print {
    .adl-modal {
        display: none !important;
    }
    
    .adl-search-container {
        display: none !important;
    }
    
    .adl-map {
        page-break-inside: avoid;
    }
}
