/**
 * DabDash Vue Zone Selection Modal Styles
 *
 * Event-driven Vue.js modal styles based on existing zone-modal.php styles
 * with enhanced modularity and responsiveness
 */

/* Modal Overlay */
.dabdash-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

/* Modal Content */
.dabdash-modal-content {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    animation: dabdashModalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Modal Animation */
@keyframes dabdashModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.dabdash-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 20px 20px 0 0;
    position: relative;
}

.dabdash-modal-header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.dabdash-modal-logo-img {
    max-height: 60px;
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

.dabdash-modal-branding {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dabdash-modal-site-title {
    margin: 0;
    color: #333333 !important;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.5px;
}

.dabdash-modal-site-tagline {
    margin: 0;
    color: #666666 !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

/* Close Button */
.dabdash-modal-close {
    position: absolute;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    font-size: 32px !important;
    color: #1d1d1f !important;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    font-weight: 300;
    outline: none !important;
    box-shadow: none !important;
}

.dabdash-modal-close:hover {
    color: #666666;
}

.dabdash-modal-close:focus {
    outline: none !important;
    box-shadow: none !important;
}

.dabdash-modal-close:focus-visible {
    outline: 2px solid #666666;
    outline-offset: 2px;
}

/* Body */
.dabdash-modal-body {
    padding: 32px;
    background: #ffffff;
}

.dabdash-zone-selector {
    width: 100%;
}

.dabdash-delivery-title {
    margin: 0 0 10px;
    color: #1d1d1f !important;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.3px;
}

.dabdash-delivery-description {
    margin: 0 0 25px;
    color: #666666;
    font-size: 15px;
    text-align: center;
    line-height: 1.5;
    font-weight: 400;
}

/* Map Container */
.dabdash-map-container {
    position: relative;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1);
    background: #f8f8f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dabdash-zone-map {
    height: 300px;
    width: 100%;
    border-radius: 12px;
    background: #f5f5f5;
}

/* Loading Overlays */
.dabdash-map-loading,
.dabdash-location-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    gap: 16px;
    text-align: center;
    z-index: 1001;
}

.dabdash-location-loading {
    transition: opacity 0.5s ease-in-out;
}

.dabdash-location-loading.fade-out {
    opacity: 0;
}

/* Modern Loader */
.dabdash-modern-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: dabdashModernSpin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes dabdashModernSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* OR Divider */
.dabdash-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.dabdash-divider::before,
.dabdash-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.dabdash-divider span {
    background: #fff;
    color: #888888;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 10px;
}

/* Zone Dropdown */
.dabdash-zone-dropdown-container {
    margin-bottom: 25px;
}

.dabdash-zone-dropdown {
    width: 100%;
    padding: 16px 50px 16px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    background: #ffffff;
    color: #1d1d1f;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.dabdash-zone-dropdown:focus {
    outline: none;
    border-color: #666666;
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.dabdash-zone-dropdown:hover {
    border-color: #999999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Selected Zone Display */
.dabdash-selected-zone {
    background: #e8f5e8;
    border: 1px solid #27ae60;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-zone-info strong {
    color: #27ae60;
    margin-right: 8px;
}

/* Error Display */
.dabdash-location-error {
    background: #fff2cd;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-icon {
    font-size: 18px;
}

/* Action Buttons */
.dabdash-modal-actions {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.dabdash-btn {
    padding: 16px 32px;
    border-radius: 12px !important;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    white-space: nowrap;
    letter-spacing: -0.3px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dabdash-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.dabdash-btn-primary {
    background: linear-gradient(135deg, #1d1d1f 0%, #333333 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dabdash-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #000000 0%, #1d1d1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.dabdash-btn-secondary {
    background: #ffffff;
    color: #666666;
    border: 2px solid #e0e0e0;
}

.dabdash-btn-secondary:hover:not(:disabled) {
    background: #f5f5f5;
    color: #333333;
    border-color: #999999;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.dabdash-btn:disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dabdash-btn-secondary:disabled {
    background: #ffffff;
    border-color: #bdc3c7;
    color: #7f8c8d;
}

/* Footer */
.dabdash-modal-footer {
    border-top: 1px solid #e8e8e8;
    padding: 24px 32px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.dabdash-footer-content {
    flex: 1;
    text-align: left;
}

.dabdash-footer-branding {
    flex-shrink: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dabdash-modal-note {
    margin: 0;
    color: #666666;
    font-size: 13px;
    line-height: 1.4;
}

.dabdash-powered-by-label {
    margin: 0 0 4px 0;
    color: #777777;
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dabdash-powered-by-link {
    margin: 0;
    line-height: 1;
}

.dabdash-powered-by-link a {
    color: #555555;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: color 0.2s ease;
}

.dabdash-powered-by-link a:hover {
    color: #333333;
    text-decoration: underline;
}

.dabdash-version {
    margin: 0;
    color: #777777;
    font-size: 10px;
    line-height: 1;
    opacity: 0.8;
}

/* Age Verification - Responsive Scaling */
.dabdash-age-verification {
    margin: 16px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.dabdash-age-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    margin: 0;
    line-height: 1.3;
}

.dabdash-age-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.dabdash-age-checkbox .checkmark {
    display: none;
}

/* Mobile Extra Small - Age Verification */
@media (max-width: 480px) {
    .dabdash-age-verification {
        margin: 12px 0;
        padding: 8px;
        border-radius: 4px;
    }

    .dabdash-age-checkbox {
        gap: 6px;
        font-size: 11px;
        line-height: 1.2;
    }

    .dabdash-age-checkbox input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }
}

/* Desktop - Age Verification */
@media (min-width: 1024px) {
    .dabdash-age-verification {
        margin: 12px 0;
        padding: 10px;
    }

    .dabdash-age-checkbox {
        font-size: 13px;
        gap: 8px;
    }

    .dabdash-age-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dabdash-modal-content {
        width: 95%;
        margin: 20px 10px;
        max-height: 95vh;
    }

    .dabdash-modal-header,
    .dabdash-modal-body,
    .dabdash-modal-footer {
        padding: 20px;
    }

    .dabdash-delivery-title {
        font-size: 18px;
    }

    .dabdash-zone-map {
        height: 200px;
    }

    .dabdash-modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .dabdash-btn {
        width: 100%;
        padding: 15px;
        min-width: auto;
    }

    .dabdash-divider {
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .dabdash-modal-content {
        width: 98%;
        margin: 10px 5px;
    }

    .dabdash-modal-header,
    .dabdash-modal-body,
    .dabdash-modal-footer {
        padding: 15px;
    }

    .dabdash-modal-header-content {
        flex-direction: column;
        gap: 10px;
    }

    .dabdash-zone-map {
        height: 180px;
    }

    .dabdash-delivery-title {
        font-size: 16px;
    }

    .dabdash-delivery-description {
        font-size: 13px;
    }

    .dabdash-modal-site-title {
        font-size: 20px;
    }

    .dabdash-modal-logo-img {
        max-height: 50px;
    }
}

/* Vue.js Specific Transitions */
.v-enter-active,
.v-leave-active {
    transition: opacity 0.3s ease;
}

.v-enter-from,
.v-leave-to {
    opacity: 0;
}

/* Loading States */
.dabdash-btn.loading {
    position: relative;
    color: transparent;
}

.dabdash-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: dabdashModernSpin 1s linear infinite;
}

/* Vue Component Wrapper */
#dabdash-vue-zone-modal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Leaflet Map Enhancements */
.dabdash-zone-map .leaflet-container {
    border-radius: 12px;
}

.dabdash-zone-map .leaflet-control-zoom {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dabdash-zone-map .leaflet-control-zoom a {
    background: white;
    color: #333;
    border: 1px solid #ccc;
    font-weight: bold;
}

.dabdash-zone-map .leaflet-control-zoom a:hover {
    background: #f4f4f4;
}

/* Store and User Marker Popups */
.store-popup {
    text-align: center;
    min-width: 150px;
}

.store-popup strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

/* Zone Polygon Hover Effects */
.zone-polygon {
    cursor: pointer;
    transition: fill-opacity 0.3s ease;
}

.zone-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Accessibility Enhancements */
.dabdash-btn:focus-visible,
.dabdash-zone-dropdown:focus-visible {
    outline: 2px solid #27ae60;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .dabdash-modal-content {
        border: 2px solid #000;
    }

    .dabdash-btn-primary {
        border: 2px solid #000;
    }

    .dabdash-zone-dropdown {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .dabdash-modal-content,
    .dabdash-btn,
    .dabdash-modern-loader,
    .dabdash-location-loading {
        animation: none;
        transition: none;
    }
}

/* Dark Theme Support - DISABLED to prevent conflicts with theme styling */
/* @media (prefers-color-scheme: dark) {
    .dabdash-modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .dabdash-modal-footer {
        background: #f8f8f8;
        border-top-color: #e5e5e7;
    }

    .dabdash-zone-dropdown {
        background: #f8f8f8;
        color: #1d1d1f;
        border-color: #e0e0e0;
    }

    .dabdash-delivery-title {
        color: #ecf0f1;
    }
} */