/* 
 * DealXSpace - Main Application Styles
 * Page-specific styles and layouts
 */

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5)),
        url('https://images.unsplash.com/photo-1582407947304-fd86f028f716?q=80&w=2496&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') center center / cover no-repeat;
    overflow: hidden;
    padding: var(--space-12) 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--color-white);
    max-width: 800px;
}

.hero-title {
    font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-6xl));
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    margin-bottom: var(--space-4);
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: clamp(var(--font-size-base), 2vw, var(--font-size-xl));
    font-weight: var(--font-weight-normal);
    color: var(--color-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.hero-search {
    background-color: var(--color-white);
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
}

.hero-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ========================================
   SEARCH SECTION (Separate from Hero)
   ======================================== */

.search-section {
    background: white;
    padding: var(--space-12) 0;
    position: relative;
    overflow: hidden;
}


.search-section-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ========================================
   SECTION STYLES
   ======================================== */

.section {
    padding: var(--space-16) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.section-title {
    font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-3);
}

.section-subtitle {
    font-size: clamp(var(--font-size-base), 2vw, var(--font-size-lg));
    color: var(--color-gray-600);
    max-width: 600px;
    margin: 0 auto;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: var(--space-3) auto;
    border-radius: var(--radius-full);
}

/* ========================================
   SERVICE CARDS
   ======================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-12);
}

.service-card {
    text-align: center;
    padding: var(--space-8);
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2xl);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    font-size: var(--font-size-4xl);
    color: var(--color-white);
    box-shadow: var(--shadow-lg);
}

.service-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-3);
}

.service-description {
    color: var(--color-gray-600);
    line-height: 1.7;
}

/* ========================================
   PROPERTY GRID
   ======================================== */

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-12);
}

/* ========================================
   STATS SECTION
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-12);
}

.stat-card {
    text-align: center;
    padding: var(--space-8);
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: var(--font-size-base);
    color: var(--color-gray-600);
    font-weight: var(--font-weight-medium);
}

/* ========================================
   TESTIMONIALS
   ======================================== */

.testimonials-slider {
    max-width: 900px;
    margin: var(--space-12) auto 0;
}

.testimonial-card {
    background: var(--color-white);
    padding: var(--space-8);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.testimonial-photo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 4px solid var(--color-primary);
    margin: 0 auto var(--space-4);
    object-fit: cover;
}

.testimonial-text {
    font-size: var(--font-size-lg);
    color: var(--color-gray-700);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: var(--space-6);
}

.testimonial-author {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
}

.testimonial-role {
    font-size: var(--font-size-sm);
    color: var(--color-gray-500);
}

.testimonial-rating {
    color: var(--color-primary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--color-white);
    text-align: center;
    padding: var(--space-16) 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>') no-repeat top;
    background-size: cover;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    margin-bottom: var(--space-6);
}

.cta-text {
    font-size: var(--font-size-xl);
    color: var(--color-secondary);
    margin-bottom: var(--space-8);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background-color: var(--color-gray-900);
    color: var(--color-gray-300);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-brand {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.footer-description {
    color: var(--color-gray-400);
    line-height: 1.7;
    margin-bottom: var(--space-6);
}

.footer-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    color: var(--color-gray-400);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-social {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.footer-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-gray-800);
    border-radius: var(--radius-full);
    color: var(--color-gray-400);
    transition: all var(--transition-fast);
}

.footer-social-link:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid var(--color-gray-800);
    padding-top: var(--space-8);
    text-align: center;
    color: var(--color-gray-500);
    font-size: var(--font-size-sm);
}

/* ========================================
   SEARCH WIDGET
   ======================================== */

.search-widget {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-4);
    align-items: end;
}

.search-widget .form-group {
    margin-bottom: 0;
}

/* ========================================
   FILTERS
   ======================================== */

.filters-bar {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-6);
    background-color: var(--color-gray-50);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-8);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* ========================================
   BREADCRUMB
   ======================================== */

.breadcrumb {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    list-style: none;
    margin-bottom: var(--space-6);
    font-size: var(--font-size-sm);
}

.breadcrumb-item {
    color: var(--color-gray-600);
}

.breadcrumb-item.active {
    color: var(--color-gray-900);
    font-weight: var(--font-weight-medium);
}

.breadcrumb-separator {
    color: var(--color-gray-400);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    align-items: center;
    list-style: none;
    margin-top: var(--space-12);
}

.pagination-item {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    color: var(--color-gray-700);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination-item.active {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--space-4);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-6);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .section {
        padding: var(--space-10) 0;
    }

    .section-header {
        margin-bottom: var(--space-8);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .property-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        margin-top: var(--space-8);
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        margin-top: var(--space-8);
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cta-title {
        font-size: var(--font-size-2xl);
    }

    .cta-text {
        font-size: var(--font-size-base);
    }
}

/* Bootstrap Navbar Overrides (if needed) */
/* .navbar-custom styles are currently inline in header.php for specificity */

/* ========================================
   SKELETON LOADING STATES
   ======================================== */

.skeleton-card {
    background: #fff;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.skeleton-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 20px;
}

.skeleton-text {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Properties Container Loading State */
#properties-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth fade-in for loaded properties */
.property-card {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search input loading indicator */
.search-loading {
    position: relative;
}

.search-loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}