/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* ============================================
   HEADER
   ============================================ */
header {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 50px;
    padding: 40px 20px;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    z-index: -1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: none;
    font-weight: 800;
    letter-spacing: -0.5px;
    animation: fadeInDown 0.6s ease-out;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-medium);
    margin-bottom: 8px;
    font-weight: 500;
    animation: fadeInDown 0.6s ease-out 0.1s both;
}

.dataset-info {
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.disclaimer {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    animation: fadeInDown 0.6s ease-out 0.3s both;
}

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

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    min-width: 180px;
}

.dropdown-toggle {
    width: 100%;
    padding: 18px 45px 18px 24px;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.dropdown-toggle span {
    flex: 1;
    text-align: left;
}

.dropdown-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dropdown-toggle:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.dropdown-toggle svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.custom-dropdown.active .dropdown-toggle svg {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown.active .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 100%;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 14px 24px;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 1.05rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

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

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-item:active {
    background: rgba(102, 126, 234, 0.1);
}

.search-input {
    flex: 1;
    padding: 18px 24px;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn,
.clear-btn {
    padding: 18px 36px;
    font-size: 1.05rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.search-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7c8ef0 0%, #8a5fb8 100%);
}

.search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.clear-btn {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 2px solid var(--border-color);
}

.clear-btn:hover {
    background: white;
    border-color: var(--text-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   STATUS MESSAGES
   ============================================ */
.loading,
.error {
    text-align: center;
    padding: 24px;
    font-size: 1.1rem;
    background: white;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.4s ease-out;
}

.loading {
    color: var(--primary-color);
    font-weight: 500;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    color: #e53e3e;
    background: #fed7d7;
    border-left: 4px solid #e53e3e;
}

/* ============================================
   PROPERTY CARDS
   ============================================ */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    animation: fadeIn 0.6s ease-out;
}

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

.property-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.property-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.property-card:hover::before {
    transform: scaleX(1);
}

.property-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.property-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: block;
    transition: transform 0.4s ease;
}

.property-card:hover .property-image {
    transform: scale(1.05);
}

.property-image-placeholder {
    width: 100%;
    height: 280px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}

.property-image-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.property-content {
    padding: 24px;
}

.property-address {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.property-city {
    color: var(--text-medium);
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.property-owner {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    line-height: 1.5;
}

.property-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: #edf2f7;
    transform: translateY(-2px);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: 600;
}

.detail-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.property-value {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.property-value::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.value-label {
    font-size: 0.9rem;
    opacity: 0.95;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.value-amount {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.view-details-btn {
    margin-top: 20px;
    padding: 14px 24px;
    width: 100%;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-details-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.export-btn {
    margin-top: 15px;
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.export-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding: 24px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.pagination button {
    padding: 12px 24px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 120px;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination button:active:not(:disabled) {
    transform: translateY(0);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
}

.pagination .page-info {
    padding: 0 20px;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    color: var(--text-light);
    font-size: 32px;
    font-weight: 300;
    position: absolute;
    right: 24px;
    top: 20px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
}

.modal-close:hover,
.modal-close:focus {
    color: var(--primary-color);
    background: #edf2f7;
    transform: rotate(90deg);
}

.modal-image-container {
    text-align: center;
    margin-bottom: 30px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-image-container img {
    max-width: 100%;
    max-height: 450px;
    width: 100%;
    object-fit: cover;
    display: block;
}

.modal-detail-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--border-color);
}

.modal-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-detail-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.modal-detail-item:hover {
    background: white;
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.modal-detail-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-detail-value {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.5;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-section {
        padding: 24px;
        border-radius: 16px;
    }

    .search-container {
        flex-direction: column;
        gap: 10px;
    }

    .custom-dropdown,
    .search-input,
    .search-btn,
    .clear-btn {
        width: 100%;
    }

    .results {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .property-details {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .pagination button {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 24px;
        border-radius: 20px;
    }

    .modal-detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-close {
        right: 16px;
        top: 16px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .property-image,
    .property-image-placeholder {
        height: 220px;
    }

    .property-content {
        padding: 20px;
    }
}