/* ============================================================================
 * Zawaya Real Estate - Main Stylesheet
 * Consolidated styles including core design and backend integration
 * ============================================================================ */

/* ============================================================================
 * Core Zawaya Styles (Merged from zawaya.css)
 * ============================================================================ */

/* Custom animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 1s ease-out forwards;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #03c5aa;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #02b597;
}

/* Selection color */
::selection {
    background: #03c5aa;
    color: white;
}

/* Focus visible outline for accessibility */
:focus-visible {
    outline: 2px solid #03c5aa;
    outline-offset: 2px;
}

/* Property card hover effect enhancement */
.group:hover .property-image {
    transform: scale(1.1);
}

/* Gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, #03c5aa 0%, #00515d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Mobile menu transition */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* Hero section text shadow for better readability */
.hero-text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Custom button hover effect */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-hover-effect:hover::after {
    left: 100%;
}

/* Image hover zoom container */
.img-zoom-container {
    overflow: hidden;
}

.img-zoom-container img {
    transition: transform 0.5s ease;
}

.img-zoom-container:hover img {
    transform: scale(1.1);
}

/* Form focus animations */
input:focus,
select:focus,
textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 197, 170, 0.15);
}

/* Navigation blur effect enhancement */
.nav-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ============================================================================
 * Backend Integration Styles
 * These styles support dynamic content loaded from the API
 * ============================================================================ */

/* Loading state for dynamic property cards */
.property-card-loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-card-loading .skeleton {
    width: 100%;
    height: 100%;
    border-radius: 1rem;
}

/* Error state for failed API calls */
.api-error-banner {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    margin: 1rem 0;
}

/* Property grid empty state */
.properties-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
}

.properties-empty i {
    display: block;
    margin-bottom: 1rem;
    color: #03c5aa;
}

/* Auth modal overlay */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 81, 93, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 28rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0);
}

/* Listing detail modal */
.listing-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 81, 93, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.listing-detail-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.listing-detail-modal {
    background: white;
    border-radius: 1.5rem;
    max-width: 56rem;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.listing-detail-overlay.active .listing-detail-modal {
    transform: translateY(0);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #03c5aa;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 360px;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: #EF4444;
}

/* Dashboard Modal */
.dashboard-modal {
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #f8fafc;
}

.dashboard-header {
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.dashboard-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-nav-item {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.dashboard-nav-item.active {
    background: #03c5aa;
    color: white;
}

.dashboard-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Dashboard Cards */
.dash-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Image Upload Grid */
.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-area:hover {
    border-color: #03c5aa;
    background: #f0fdf9;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

/* Post Modal specific */
.post-modal {
    max-width: 800px;
    width: 95%;
}