/**
 * Enhanced Product Modal Styles
 * Advanced modal with gallery, map, and detailed information
 */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow: hidden;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal Container - Larger and Always Centered */
.modal-container {
    background: white;
    width: 99vw;
    height: 96vh;
    max-width: 1800px;
    max-height: 96vh;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.8) translateY(100px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    /* Enable scrolling within modal */
    overflow: hidden;
    contain: layout style paint;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Ensure modal stays centered on scroll */
.modal-overlay {
    position: fixed !important;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-overlay::-webkit-scrollbar {
    display: none;
}

.modal-overlay {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Modal Header - Enhanced for larger modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2.5rem 3rem;
    border-bottom: 3px solid var(--primary-color);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    flex-shrink: 0;
    min-height: 120px;
}

.modal-header-content h2 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    max-width: 80%;
}

.modal-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0;
    letter-spacing: 0.5px;
}

.badge-featured {
    background: var(--accent-color);
    color: white;
    border: 2px solid var(--accent-color);
}

.badge-status {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
}

.modal-close {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 1rem;
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.1);
}

/* Modal Content - Enhanced for larger modal with wider content */
.modal-content {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    padding: 4rem;
    flex: 1;
    overflow-y: auto;
    height: calc(95vh - 120px);
    max-width: none;
    width: 100%;
    scroll-behavior: smooth;
    align-items: flex-start;
}

/* Left Column - Larger images */
.modal-left {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    min-height: 100%;
}

/* Image Section - Bigger and more prominent */
.modal-image-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.main-image {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border: 4px solid var(--primary-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 70%,
        rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-image:hover .image-overlay {
    opacity: 1;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.image-nav.prev {
    left: 1rem;
}

.image-nav.next {
    right: 1rem;
}

.image-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Ensure buttons don't overlap */
.image-nav.prev {
    left: 1rem;
}

.image-nav.next {
    right: 1rem;
}

/* Hide navigation when only one image */
.main-image[data-single-image="true"] .image-nav {
    display: none;
}

.image-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 15;
}

/* Gallery Thumbnails - Larger for better visibility */
.modal-gallery {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

.modal-gallery::-webkit-scrollbar {
    height: 8px;
}

.modal-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-gallery::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.gallery-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.3);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumb:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.gallery-thumb:hover img {
    transform: scale(1.1);
}

/* Map Section - Larger and more detailed */
.modal-map-section h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mini-map {
    width: 100%;
    height: 300px;
    border: 4px solid var(--primary-color);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.mini-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Right Column - Contact Card */
.modal-right {
    position: sticky;
    top: 0;
    height: 100%;
    overflow-y: auto;
    padding-right: 1rem;
    padding-bottom: 2rem;
}

/* Contact Card */
.modal-contact-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.modal-contact-card h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.contact-actions .btn {
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-actions .btn i {
    margin-right: 8px;
}

.business-hours {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.business-hours h5 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.business-hours p {
    margin: 0.5rem 0;
    color: #555;
    font-size: 0.95rem;
}

/* Property Details */
.modal-property-details {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.modal-price-section {
    background: #10b981;
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    border: 3px solid #059669;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.modal-price {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.price-per-m2 {
    font-size: 1.4rem;
    opacity: 0.9;
    font-weight: 600;
}

/* Info Grid - Larger and more detailed */
.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #e9ecef;
    border-left-color: var(--accent-color);
    transform: translateX(5px);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.info-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.info-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

/* Description Section */
.modal-description-section h4,
.modal-features-section h4,
.modal-contact-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-description {
    line-height: 1.6;
    color: #333;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
}

.feature-item i {
    color: #28a745;
    font-size: 0.9rem;
}

/* Contact Agent */
.contact-agent {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 2px solid var(--primary-color);
}

.agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.agent-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.agent-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.btn.active {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

/* Responsive Design - Enhanced for larger modal */
@media (max-width: 1400px) {
    .modal-container {
        width: 97vw;
        height: 94vh;
        max-width: 1600px;
    }

    .modal-content {
        grid-template-columns: 1.3fr 1fr;
        gap: 3rem;
        padding: 3rem;
    }

    .main-image {
        height: 450px;
    }

    .modal-price {
        font-size: 3.2rem;
    }
}

@media (max-width: 1200px) {
    .modal-container {
        width: 95vw;
        height: 92vh;
    }

    .modal-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2.5rem;
    }

    .main-image {
        height: 400px;
    }

    .modal-price {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    /* Đổi màu nút đóng modal thành đen */
    .modal-close {
        color: #000000 !important;
    }
    
    .modal-close i {
        color: #000000 !important;
    }
    
    .modal {
        padding: 80px 10px 20px 10px !important; /* Top padding để tránh menu */
        align-items: flex-start !important;
        justify-content: center !important;
    }

    .modal-container {
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 120px) !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
    }

    .modal-content {
        display: block !important; /* Force single column layout */
        grid-template-columns: none !important;
        gap: 0 !important;
        padding: 0 !important;
        height: auto !important;
        max-height: calc(100vh - 200px) !important;
        overflow-y: auto !important;
    }

    /* Force single column layout - no modal-left/modal-right split */
    .modal-left,
    .modal-right {
        display: block !important;
        width: 100% !important;
        position: static !important;
        height: auto !important;
        padding: 1rem !important;
        margin: 0 !important;
    }

    .modal-right {
        border-top: 1px solid #eee;
        margin-top: 1rem !important;
    }

    .modal-header {
        padding: 1rem 1.5rem !important;
        min-height: 80px !important;
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        background: white !important;
        border-bottom: 1px solid #eee !important;
    }

    .modal-header-content {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .modal-header-content h2 {
        font-size: 1.5rem !important;
        max-width: 75% !important;
        margin: 0 !important;
        line-height: 1.3 !important;
    }

    .modal-close {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        padding: 0 !important;
        position: relative !important;
        flex-shrink: 0 !important;
    }

    /* Images section for mobile */
    .modal-images-section {
        width: 100% !important;
        margin-bottom: 1rem !important;
        padding: 0 !important;
    }

    .main-image {
        height: 250px !important;
        width: 100% !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        margin-bottom: 1rem !important;
    }

    .gallery-thumbnails {
        display: flex !important;
        gap: 0.5rem !important;
        overflow-x: auto !important;
        padding: 0.5rem 0 !important;
        margin-bottom: 1rem !important;
    }

    .gallery-thumb {
        width: 80px !important;
        height: 60px !important;
        flex-shrink: 0 !important;
        border-radius: 4px !important;
        object-fit: cover !important;
        cursor: pointer !important;
        border: 2px solid transparent !important;
        transition: border-color 0.2s ease !important;
    }

    .gallery-thumb.active {
        border-color: var(--primary-color) !important;
    }

    .mini-map {
        height: 200px !important;
        width: 100% !important;
        border-radius: 8px !important;
        margin-bottom: 1rem !important;
    }

    /* Image navigation buttons for mobile */
    .image-nav {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 20 !important;
        position: absolute !important;
    }

    .image-nav.prev {
        left: 0.5rem !important;
    }

    .image-nav.next {
        right: 0.5rem !important;
    }

    .image-nav:hover {
        transform: translateY(-50%) scale(1.05) !important;
    }

    /* Content sections for mobile */
    .modal-info-section,
    .modal-features-section,
    .modal-description-section,
    .modal-location-contact-section {
        width: 100% !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .modal-info-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .info-item {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
        background: #f8f9fa !important;
        border-radius: 8px !important;
    }

    .info-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .feature-item {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }

    .action-buttons {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        border-top: 1px solid #eee !important;
        margin: 0 -1rem -1rem -1rem !important;
    }

    .modal-price {
        font-size: 2.5rem;
    }

    .modal-price-section {
        padding: 2rem 1.5rem;
    }

    /* Ensure no content overflows on mobile */
    .modal-content * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Text content responsive */
    .modal-description,
    .modal-long-description,
    .info-value,
    .feature-item {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }

    /* Images responsive */
    .modal-content img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 1rem;
        min-height: 80px;
    }

    .modal-header-content h2 {
        font-size: 1.6rem;
        max-width: 60%;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1rem;
        gap: 1rem;
        height: calc(100vh - 80px);
    }

    .main-image {
        height: 250px;
    }

    .mini-map {
        height: 200px;
    }

    .modal-price {
        font-size: 2rem;
    }

    .modal-price-section {
        padding: 1.5rem 1rem;
    }

    .gallery-thumb {
        width: 80px;
        height: 60px;
    }

    .badge {
        padding: 0.25rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Loading Modal Styles */
.loading-container {
    width: 300px !important;
    height: 200px !important;
    max-width: 300px !important;
    max-height: 200px !important;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Additional info sections */
.modal-long-description-section,
.modal-coordinates-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.modal-long-description-section h4,
.modal-coordinates-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-long-description {
    line-height: 1.6;
    color: var(--text-color);
}

.coordinates-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.coordinates-info p {
    margin: 0.5rem 0;
    font-family: monospace;
    font-size: 0.9rem;
}

.agent-email {
    margin-top: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.agent-email i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Badge styles for status */
.badge-available {
    background: #28a745;
    color: white;
}

.badge-sold {
    background: #dc3545;
    color: white;
}

.badge-unknown {
    background: #6c757d;
    color: white;
}

/* Location and Contact Grid Layout */
.modal-location-contact-section {
    margin-top: 2rem;
}

.location-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-map-section,
.modal-contact-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.modal-map-section h4,
.modal-contact-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-map {
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.mini-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.contact-agent {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--primary-color);
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-info {
    flex: 1;
}

.agent-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.agent-title {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.agent-phone,
.agent-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.agent-phone i,
.agent-email i {
    color: var(--primary-color);
    width: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .location-contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-map-section,
    .modal-contact-section {
        padding: 1rem;
    }

    .mini-map {
        height: 150px;
    }

    .contact-agent {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .agent-avatar {
        width: 50px;
        height: 50px;
    }
}

/**
 * Advanced Search Form Styles
 * Enhanced hero search with multiple filters
 */

/* Advanced Search Container - Moved higher up */
.advanced-search-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.75rem;
    border: 3px solid var(--primary-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1100px;
    margin: -100px 0 0 50px;
    position: relative;
    z-index: 100;
    transform: translateY(-50px);
    transform-origin: left top;
    scale: 0.95;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--primary-color);
}

.search-tab {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-tab:hover {
    background: rgba(44, 90, 160, 0.1);
}

.search-tab.active {
    background: var(--primary-color);
    color: white;
    border-bottom-color: var(--accent-color);
}

/* Search Content */
.search-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-field label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-field input,
.search-field select {
    padding: 1rem;
    border: 2px solid var(--primary-color);
    background: white;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.search-field input:focus,
.search-field select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-field input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Search Actions */
.search-actions {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 150px;
}

/* Responsive Search Form */
@media (max-width: 1200px) {
    .advanced-search-form {
        max-width: 1000px;
        margin: -80px 20px 0 40px;
        transform: translateY(-40px) scale(0.95);
    }
}

@media (max-width: 768px) {
    .advanced-search-form {
        padding: 1.25rem;
        margin: -60px 0.75rem 0 0.75rem;
        transform: translateY(-30px) scale(1);
        max-width: none;
    }

    .search-tabs {
        margin-bottom: 1.5rem;
    }

    .search-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .search-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-large {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .advanced-search-form {
        padding: 1rem;
        margin: -40px 0.5rem 0 0.5rem;
        transform: translateY(-20px);
    }

    .search-tabs {
        flex-direction: column;
        margin-bottom: 1rem;
    }

    .search-tab {
        border-bottom: 1px solid var(--primary-color);
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .search-tab.active {
        border-bottom-color: var(--accent-color);
    }

    .search-field input,
    .search-field select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}
