/* GA4 Analytics Dashboard - Modern Advanced UI with Dark/Light Mode */

/* CSS Variables for Theme Support */
:root {
    /* Light Mode Colors */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-tertiary: #f8fafc;
    --bg-quaternary: #e2e8f0;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --success-bg: #c6f6d5;
    --success-text: #22543d;
    --error-bg: #fed7d7;
    --error-text: #c53030;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --bg-secondary: rgba(26, 32, 44, 0.95);
    --bg-tertiary: #2d3748;
    --bg-quaternary: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --success-bg: #22543d;
    --success-text: #c6f6d5;
    --error-bg: #c53030;
    --error-text: #fed7d7;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
.dashboard-header {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-right: 15px;
}

.theme-toggle:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--shadow-hover);
}

.theme-toggle i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

.btn-refresh {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Search Section */
.search-section {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.search-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-input-group i {
    color: var(--text-tertiary);
    margin: 0 15px;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

#property-id-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    transition: color 0.3s ease;
}

#property-id-input::placeholder {
    color: var(--text-tertiary);
}

.website-search {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    transition: color 0.3s ease;
    margin-right: 10px;
}

.website-search::placeholder {
    color: var(--text-tertiary);
}

.property-dropdown {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    transition: color 0.3s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.property-dropdown option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 10px;
}

.property-dropdown:focus {
    color: var(--text-primary);
}

.btn-search {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Property Info */
.property-info {
    margin-top: 25px;
    animation: slideDown 0.3s ease;
}

.property-card {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.property-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.property-header i {
    font-size: 2rem;
    color: #667eea;
}

.property-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.property-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-badge.success {
    background: var(--success-bg);
    color: var(--success-text);
    transition: all 0.3s ease;
}

/* Navigation Tabs */
.analytics-nav {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.nav-tab {
    flex: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.nav-tab:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Analytics Content */
.analytics-content {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
    transition: all 0.3s ease;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.content-header {
    margin-bottom: 30px;
    text-align: center;
}

.content-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: color 0.3s ease;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-hover);
}

.metric-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.metric-label {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

/* Data Sections */
.data-section {
    margin-bottom: 40px;
}

.data-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s ease;
}

.data-table-container {
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--accent-gradient);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.data-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Custom Range Styles */
.custom-range-section {
    margin-bottom: 40px;
}

.custom-range-card {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s ease;
}

.custom-range-card:hover {
    box-shadow: 0 8px 30px var(--shadow-hover);
    transform: translateY(-2px);
}

.custom-range-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s ease;
}

.info-box {
    background: linear-gradient(135deg, #e6f3ff 0%, #f0f8ff 100%);
    border: 1px solid #b3d9ff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s ease;
}

[data-theme="dark"] .info-box {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    border-color: #3182ce;
}

.info-box i {
    color: #3182ce;
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-box span {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
}

.date-inputs {
    display: flex;
    align-items: end;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-input-group {
    flex: 1;
    min-width: 200px;
}

.date-input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.date-input:hover {
    border-color: #667eea;
}

.date-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.btn-update-range {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.btn-update-range:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-update-range:active {
    transform: translateY(0);
}

.selected-range {
    background: var(--bg-quaternary);
    border-radius: 10px;
    padding: 12px 16px;
    border-left: 4px solid #667eea;
}

.selected-range span {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Responsive Design for Custom Range */
@media (max-width: 768px) {
    .custom-range-card {
        padding: 20px;
    }
    
    .date-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .date-input-group {
        min-width: 100%;
    }
    
    .date-arrow {
        transform: rotate(90deg);
        margin: 0;
    }
    
    .btn-update-range {
        width: 100%;
        margin-top: 10px;
    }
}

/* Language Dropdown */
.language-switcher-container {
    position: relative;
    margin-right: 10px;
}

.language-dropdown {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    min-width: 100px;
}

.language-dropdown:hover {
    background: var(--bg-quaternary);
    border-color: #667eea;
    transform: translateY(-1px);
}

.language-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.language-dropdown option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 12px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content p {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

.progress-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
    color: var(--text-primary);
}

.modal-footer {
    padding: 20px 25px;
    background: var(--bg-tertiary);
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Specific Enhancements */
[data-theme="dark"] .data-table tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .progress-text {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .search-input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--bg-quaternary);
}

/* Smooth Theme Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Theme Toggle Animation */
.theme-toggle i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg) scale(1.1);
}

/* Enhanced Dark Mode Colors */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-secondary: rgba(15, 23, 42, 0.95);
    --bg-tertiary: #1e293b;
    --bg-quaternary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-hover: rgba(0, 0, 0, 0.6);
}

/* Enhanced Mobile Responsive Design */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    .dashboard-container {
        padding: 15px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 12px;
    }
    
    .dashboard-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-section h1 {
        font-size: 1.8rem;
    }
    
    .header-actions {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }
    
    .theme-toggle {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .search-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .search-input-group {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .search-input-group i {
        margin: 0;
        order: -1;
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .property-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .property-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .analytics-nav {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-tab {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .analytics-content {
        padding: 20px;
    }
    
    .content-header h2 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .content-header p {
        font-size: 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 2.2rem;
    }
    
    .data-section {
        margin-bottom: 30px;
    }
    
    .data-section h3 {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .data-table-container {
        border-radius: 8px;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 15px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .dashboard-container {
        padding: 10px;
    }
    
    .dashboard-header {
        padding: 15px;
        border-radius: 15px;
    }
    
    .logo-section h1 {
        font-size: 1.5rem;
    }
    
    .logo-section i {
        font-size: 2rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .theme-toggle {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .theme-toggle span {
        display: none;
    }
    
    .btn-refresh {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    
    .search-section {
        padding: 15px;
        border-radius: 15px;
    }
    
    .search-input-group {
        padding: 10px;
        border-radius: 12px;
    }
    
    .btn-search {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .property-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .property-details h3 {
        font-size: 1.1rem;
    }
    
    .property-details p {
        font-size: 0.8rem;
    }
    
    .analytics-nav {
        padding: 12px;
        border-radius: 15px;
    }
    
    .nav-tab {
        padding: 10px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .analytics-content {
        padding: 15px;
        border-radius: 15px;
    }
    
    .content-header h2 {
        font-size: 1.5rem;
    }
    
    .content-header p {
        font-size: 0.9rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .metric-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .metric-icon {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .metric-value {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .metric-label {
        font-size: 0.8rem;
    }
    
    .data-section {
        margin-bottom: 25px;
    }
    
    .data-section h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .data-table-container {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    .data-table th {
        font-size: 0.75rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 360px) {
    .dashboard-container {
        padding: 8px;
    }
    
    .logo-section h1 {
        font-size: 1.3rem;
    }
    
    .content-header h2 {
        font-size: 1.3rem;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .data-table {
        min-width: 450px;
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .dashboard-container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: row;
        gap: 20px;
    }
    
    .logo-section {
        flex-direction: row;
    }
    
    .header-actions {
        flex-direction: row;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .metric-card {
        padding: 15px;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-tab:hover,
    .btn-search:hover,
    .btn-refresh:hover,
    .theme-toggle:hover {
        transform: none;
    }
    
    .nav-tab:active,
    .btn-search:active,
    .btn-refresh:active,
    .theme-toggle:active {
        transform: scale(0.95);
    }
    
    .metric-card:hover {
        transform: none;
    }
    
    .metric-card:active {
        transform: scale(0.98);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-section i,
    .metric-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .dashboard-container {
        padding: 0;
    }
    
    .header-actions,
    .search-section,
    .analytics-nav {
        display: none;
    }
    
    .analytics-content {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .metric-card {
        break-inside: avoid;
    }
}
