/* =============================================
   DerikPlus - Main Stylesheet
   ============================================= */

:root {
    --primary: #0F4C81;
    --secondary: #00A896;
    --accent: #F4A261;
    --dark: #1E293B;
    --light: #F8FAFC;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
}

* {
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.navbar .nav-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #0a3a63 50%, var(--secondary) 100%);
    padding: 4rem 0 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Search Box */
.search-box {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.search-box .form-control,
.search-box .form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
}

.search-box .form-control:focus,
.search-box .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 2rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-search:hover {
    background: #0a3a63;
    color: white;
    transform: translateY(-1px);
}

/* Property Cards */
.property-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid #f1f5f9;
}

.property-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.property-card .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.property-card .badge-featured {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
    z-index: 2;
}

.property-card .badge-purpose {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
    z-index: 2;
}

.property-card .card-body {
    padding: 1.25rem;
}

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

.property-card .property-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #64748b;
}

.property-card .property-meta i {
    color: var(--secondary);
}

/* Section Titles */
.section-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

/* Stats */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.9rem;
}

/* About Section */
.about-section {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Footer */
.footer {
    background: #0a2540;
    color: white;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    display: block;
    padding: 0.3rem 0;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Forms */
.form-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.65rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 1.25rem;
}

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

.btn-primary:hover {
    background: #0a3a63;
    border-color: #0a3a63;
}

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

.btn-secondary:hover {
    background: #008f7e;
    border-color: #008f7e;
}

/* Property Detail */
.property-gallery {
    border-radius: 16px;
    overflow: hidden;
}

.property-gallery .main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    cursor: pointer;
}

.property-gallery .thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}

.property-gallery .thumb:hover,
.property-gallery .thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

.detail-box {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    margin-bottom: 1.25rem;
}

.detail-box h5 {
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.info-item i {
    color: var(--secondary);
    font-size: 1.1rem;
    width: 24px;
}

.info-item .label {
    color: #64748b;
}

.info-item .value {
    font-weight: 600;
    color: var(--dark);
}

/* Map */
#map, .map-container {
    height: 450px;
    border-radius: 16px;
    z-index: 1;
}

/* Dashboard Sidebar */
.dashboard-sidebar {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.dashboard-sidebar .nav-link {
    color: var(--dark);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.dashboard-sidebar .nav-link:hover,
.dashboard-sidebar .nav-link.active {
    background: var(--primary);
    color: white;
}

.dashboard-sidebar .nav-link i {
    width: 24px;
}

/* Admin Table */
.table-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    overflow-x: auto;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748b;
    border-bottom-width: 1px;
    white-space: nowrap;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.4em 0.7em;
    border-radius: 6px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .property-gallery .main-image {
        height: 250px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .about-section {
        padding: 1.5rem;
    }
    
    .search-box {
        padding: 1rem;
    }
}

/* Leaflet popup RTL fix */
.leaflet-popup-content {
    text-align: right;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

/* Favorite heart */
.btn-favorite {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 2;
    transition: all 0.2s;
}

.btn-favorite:hover,
.btn-favorite.active {
    background: #fee2e2;
    color: #ef4444;
}

.btn-favorite.active i {
    color: #ef4444;
}


/* ========== Splash Screen ========== */
.app-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(145deg, #0F4C81 0%, #0a3a63 45%, #00A896 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.app-splash.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-inner {
    text-align: center;
    color: #fff;
    padding: 2rem;
}
.splash-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
    border-radius: 22px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    animation: splashPulse 1.5s ease-in-out infinite;
}
.splash-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
}
.splash-title span { color: #F4A261; }
.splash-slogan {
    opacity: 0.9;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}
.splash-loader {
    width: 160px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}
.splash-bar {
    height: 100%;
    width: 0%;
    background: #F4A261;
    border-radius: 4px;
    animation: splashProgress 6s linear forwards;
}
.splash-credit {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
@keyframes splashProgress {
    from { width: 0%; }
    to { width: 100%; }
}


/* PWA Install button */
.pwa-install-wrap {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0F4C81;
    padding: 8px 12px 8px 8px;
    border-radius: 50px;
    box-shadow: 0 8px 28px rgba(15, 76, 129, 0.45);
}
.pwa-install-btn {
    border-radius: 40px !important;
    font-weight: 700;
    white-space: nowrap;
}
.pwa-install-close {
    opacity: 0.85;
    margin-right: 4px;
}
