/**
 * Modern Theme - Core Styles
 * Professional Real Estate Portal Layout
 */

/* ==========================================================================
   1. Variables & Reset
   ========================================================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --text-primary: #2d3748;
    --text-secondary: #6c757d;
    --text-light: #a0aec0;
    
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   2. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   3. Layout Utilities
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

.bg-light {
    background-color: var(--bg-light);
}

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

.text-white {
    color: white !important;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    color: white;
    background-color: var(--text-secondary);
    border-color: var(--text-secondary);
}

.btn-outline {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ==========================================================================
   5. Property Card Component
   ========================================================================== */

.property-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.property-card .card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.property-card .card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--bg-light);
}

.property-card .property-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.property-card .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.property-card .card-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.property-card .badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.property-card .badge-featured {
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
}

.property-card .badge-verified {
    background: rgba(23, 162, 184, 0.9);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.property-card .badge-new {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.property-card .favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    z-index: 10;
}

.property-card .favorite-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.property-card .favorite-btn.active {
    background: #ff4757;
    color: white;
}

.property-card .card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-card .card-price {
    margin-bottom: 0.75rem;
}

.property-card .price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.property-card .price-period {
    font-size: 1rem;
    color: var(--text-secondary);
}

.property-card .card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.property-card .card-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.property-card .card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.property-card .spec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.property-card .card-agent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.property-card .agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.property-card .agent-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.property-card .super-agent-badge {
    color: #ffc107;
}

/* ==========================================================================
   6. Empty State
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    color: var(--border-color);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   7. Pagination
   ========================================================================== */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background: white;
    transition: all var(--transition-fast);
}

.pagination li a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination li.active span {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination li.disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   8. Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .container {
        max-width: 960px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .property-card .card-image {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .property-card .card-specs {
        gap: 0.5rem;
    }
}

/* ==========================================================================
   9. Utility Classes
   ========================================================================== */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* ==========================================================================
   10. Print Styles
   ========================================================================== */

@media print {
    .modern-header,
    .modern-footer,
    .favorite-btn,
    .action-buttons,
    .mobile-filters-toggle {
        display: none !important;
    }
    
    .property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
