/* CSS Variables for easy theme customization */
:root {
    --primary-color: #23556e;
    --primary-hover: #2a4d7a;
    --secondary-color: #4a90e2;
    --accent-color: #e2e8f0;
    --success-color: #38a169;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --background-color: #f7fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --border-radius: 8px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
    position: relative;
}

.search-container {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#addressSearch {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-background);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#addressSearch:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#searchBtn {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#searchBtn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

#searchBtn:active {
    transform: translateY(0);
}

/* Suggestions */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 70px;
    background-color: var(--card-background);
    
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestions-container.hidden {
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--accent-color);
    transition: background-color 0.2s ease;
}

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

.suggestion-item:hover {
    background-color: var(--accent-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent-color);
    border-left: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Results */
.results-container {
    margin-top: 20px;
}

.results-header {
    margin-bottom: 20px;
    text-align: center;
}

.results-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 600;
}

/* Property Cards */
.property-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
/*
.property-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}*/

.property-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.property-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.record-count {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Tables */
.records-table {
    overflow-x: auto;
}

.records-table table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th {
    background-color: var(--accent-color);
    color: var(--text-primary);
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.records-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.records-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.records-table tr:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

/* No Results / Error Messages */
.no-results,
.error-message {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.no-results h3,
.error-message h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.no-results p,
.error-message p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.error-message {
    border-left: 4px solid #e53e3e;
}

.error-message h3 {
    color: #e53e3e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .suggestions-container {
        right: 0;
    }
    
    .property-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .property-header h3 {
        font-size: 1.1rem;
    }
    
    .records-table {
        font-size: 0.9rem;
    }
    
    .records-table th,
    .records-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.7rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .records-table {
        font-size: 0.8rem;
    }
    
    .records-table th,
    .records-table td {
        padding: 8px 6px;
    }
    
    .property-header {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .search-section,
    .loading {
        display: none;
    }
    
    .property-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
        break-inside: avoid;
        margin-bottom: 15px;
    }
    
    .property-header {
        background-color: var(--accent-color) !important;
        color: var(--text-primary) !important;
    }
}