/* Quibble RM Color Scheme and Optimized Styles */
:root {
    --primary-blue: #0ea5e9;        /* Sky blue */
    --secondary-blue: #06b6d4;      /* Cyan/Teal */
    --accent-blue: #22d3ee;         /* Light cyan */
    --light-blue: #f0f9ff;          /* Very light sky blue */
    --text-primary: #0c4a6e;        /* Deep sky blue for text */
    --text-secondary: #0e7490;      /* Medium teal for secondary text */
    --text-muted: #0891b2;          /* Medium cyan for muted text */
    --light-gray: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-color: #bae6fd;        /* Light blue border */
    --shadow: rgba(14, 165, 233, 0.15);
    --shadow-hover: rgba(14, 165, 233, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--light-blue) 0%, #e0f2fe 50%, var(--white) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: var(--primary-blue);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.brand-name {
    color: var(--primary-blue);
    font-weight: 800;
    font-size: 2.2rem;
}

.brand-subtitle {
    color: var(--secondary-blue);
    font-weight: 500;
    font-size: 1.4rem;
    margin-left: 0.5rem;
}

.header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Navigation */
.nav-tabs {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    background: var(--white);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.nav-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.nav-tab.active,
.nav-tab:hover {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background: rgba(14, 165, 233, 0.08);
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.card-header {
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

/* Loading Button */
.btn.loading {
    pointer-events: none;
}

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

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0.5rem;
    background: rgba(14, 165, 233, 0.08);
    border-radius: 8px;
    border: 1px solid var(--light-blue);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

.form-check-label {
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

/* Table Styles */
.table-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.table-responsive {
    overflow-x: auto;
}

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

.table th {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--secondary-blue);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--light-blue);
}

.table tbody tr:nth-child(even) {
    background: rgba(14, 165, 233, 0.04);
}

.table tbody tr:nth-child(even):hover {
    background: var(--light-blue);
}

/* Data formatting in tables */
.table .currency {
    font-weight: 600;
    color: var(--success);
}

.table .property-id {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    background: var(--light-gray);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    position: relative;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--light-blue);
    color: var(--primary-blue);
    border-color: var(--accent-blue);
}

/* Loading States */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    flex-direction: column;
    gap: 1rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--light-blue);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Search Form Specific */
.search-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: end;
}

.search-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-blue);
    border-radius: 8px;
}

.results-count {
    font-weight: 600;
    color: var(--primary-blue);
}

.export-btn {
    margin-left: auto;
}

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

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .search-controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-tab.active,
    .nav-tab:hover {
        border-bottom-color: var(--primary-blue);
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .export-btn {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .search-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.fw-bold { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .header,
    .nav-tabs,
    .btn,
    .search-form {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .table {
        font-size: 12px;
    }
}