/**
 * AE24 Zones Pro - Production Styles
 * Matches the exact design from screenshots
 */

:root {
    --ae24-primary: #66B94A;
    --ae24-primary-rgb: 102, 185, 74;
    --ae24-secondary: #00D563;
    --ae24-gray-50: #f9f9f9;
    --ae24-gray-100: #f5f5f5;
    --ae24-gray-200: #e5e5e5;
    --ae24-gray-300: #d4d4d4;
    --ae24-gray-400: #a3a3a3;
    --ae24-gray-500: #737373;
    --ae24-gray-600: #525252;
    --ae24-gray-700: #404040;
    --ae24-gray-800: #262626;
    --ae24-gray-900: #171717;
    --ae24-white: #ffffff;
    --ae24-black: #000000;
    --ae24-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --ae24-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --ae24-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --ae24-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --ae24-radius: 12px;
    --ae24-radius-sm: 8px;
    --ae24-radius-full: 9999px;
    --ae24-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.ae24-zones-pro-widget {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    width: 100%;
}

.ae24-zones-pro-widget * {
    box-sizing: border-box;
}

/* Search Container */
.ae24-search-container {
    margin-bottom: 30px;
    position: relative;
}

.ae24-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.ae24-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ae24-gray-800);
    background-color: var(--ae24-white);
    border: 2px solid var(--ae24-gray-200);
    border-radius: var(--ae24-radius-full);
    transition: var(--ae24-transition);
    outline: none;
    font-family: inherit;
}

.ae24-search-input:focus {
    border-color: var(--ae24-primary);
    box-shadow: 0 0 0 3px rgba(var(--ae24-primary-rgb), 0.1);
}

.ae24-search-input::placeholder {
    color: var(--ae24-gray-400);
}

.ae24-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ae24-gray-400);
    pointer-events: none;
}

/* Search Suggestions Dropdown */
.ae24-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--ae24-white);
    border-radius: var(--ae24-radius);
    box-shadow: var(--ae24-shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
}

.ae24-suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--ae24-transition);
    border-bottom: 1px solid var(--ae24-gray-100);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.ae24-suggestion-item:hover {
    background-color: var(--ae24-gray-50);
}

.ae24-suggestion-item.active {
    background-color: rgba(var(--ae24-primary-rgb), 0.1);
}

.ae24-suggestion-type {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ae24-primary);
    min-width: 60px;
}

.ae24-suggestion-text {
    flex: 1;
    font-size: 15px;
    color: var(--ae24-gray-700);
}

.ae24-suggestion-text mark {
    background-color: rgba(var(--ae24-primary-rgb), 0.2);
    color: inherit;
    font-weight: 600;
}

/* Zones Grid */
.ae24-zones-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

/* Zone Card */
.ae24-zone-card {
    background: var(--ae24-white);
    border-radius: var(--ae24-radius);
    padding: 20px;
    box-shadow: var(--ae24-shadow);
    transition: var(--ae24-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ae24-zone-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ae24-shadow-xl);
}

.ae24-zone-card.hidden {
    display: none !important;
}

/* Zone Title */
.ae24-zone-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ae24-gray-800);
}

.ae24-zone-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--ae24-transition);
}

.ae24-zone-title a:hover {
    color: var(--ae24-primary);
}

/* Cities Preview */
.ae24-cities-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 40px;
}

/* City Tag */
.ae24-city-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--ae24-gray-100);
    color: var(--ae24-gray-700);
    border-radius: var(--ae24-radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--ae24-transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ae24-city-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--ae24-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.ae24-city-tag:hover {
    color: var(--ae24-white);
    transform: translateY(-2px);
}

.ae24-city-tag:hover::before {
    left: 0;
}

/* More Cities Badge */
.ae24-more-cities {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: transparent;
    color: var(--ae24-gray-500);
    border: 2px solid var(--ae24-gray-200);
    border-radius: var(--ae24-radius-sm);
    font-size: 14px;
    font-weight: 500;
}

/* View All Button */
.ae24-view-all-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--ae24-primary);
    color: var(--ae24-white);
    border: none;
    border-radius: var(--ae24-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ae24-transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.ae24-view-all-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.ae24-view-all-btn:hover {
    background: var(--ae24-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--ae24-primary-rgb), 0.3);
}

.ae24-view-all-btn:hover::before {
    left: 100%;
}

/* Modal */
.ae24-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.ae24-modal.active {
    display: block;
}

.ae24-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.ae24-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--ae24-white);
    border-radius: var(--ae24-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

/* Modal Header - Matching Screenshot */
.ae24-modal-header {
    padding: 30px;
    background: var(--ae24-primary);
    color: var(--ae24-white);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ae24-modal-header.gradient {
    background: linear-gradient(135deg, var(--ae24-primary) 0%, var(--ae24-secondary) 100%);
}

.ae24-modal-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--ae24-white);
    flex: 1;
    min-width: 0;
}

.ae24-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ae24-transition);
    color: var(--ae24-white);
    flex-shrink: 0;
    padding: 0;
}

.ae24-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ae24-modal-close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Modal Body */
.ae24-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background: var(--ae24-gray-50);
}

.ae24-modal-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.ae24-modal-city-link {
    padding: 12px 18px;
    background: var(--ae24-white);
    color: var(--ae24-gray-700);
    text-align: center;
    border-radius: var(--ae24-radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--ae24-transition);
    box-shadow: var(--ae24-shadow-sm);
    position: relative;
    overflow: hidden;
}

.ae24-modal-city-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--ae24-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.ae24-modal-city-link:hover {
    color: var(--ae24-white);
    transform: translateY(-2px);
    box-shadow: var(--ae24-shadow);
}

.ae24-modal-city-link:hover::before {
    left: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Loading State */
.ae24-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--ae24-gray-200);
    border-radius: 50%;
    border-top-color: var(--ae24-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* No Results */
.ae24-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--ae24-gray-500);
}

.ae24-no-zones {
    text-align: center;
    padding: 40px;
    background: var(--ae24-gray-50);
    border-radius: var(--ae24-radius);
    color: var(--ae24-gray-600);
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ae24-zones-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .ae24-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .ae24-modal-header {
        padding: 20px;
    }
    
    .ae24-modal-title {
        font-size: 22px;
    }
    
    .ae24-modal-body {
        padding: 20px;
    }
    
    .ae24-modal-cities-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .ae24-search-input {
        font-size: 14px;
        padding: 12px 45px 12px 18px;
    }
    
    .ae24-city-tag,
    .ae24-more-cities {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .ae24-modal-cities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Elementor Editor Compatibility */
.elementor-editor-active .ae24-modal {
    z-index: 9999;
}

/* Print Styles */
@media print {
    .ae24-search-container,
    .ae24-view-all-btn,
    .ae24-modal {
        display: none !important;
    }
    
    .ae24-zone-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}