/*
 * Adwar Real Estate - Ultra Professional Design
 * Inspired by: Stripe, Apple, Linear, Professional SaaS
 * Color Palette: Neutral, Clean, Sophisticated
 */

/* ========================================
   Professional Neutral Palette
   ======================================== */
:root {
    /* Logo-led core palette (deep plum + wine + champagne) */
    --primary: #0f0a14;
    --primary-light: #1b1226;
    --primary-dark: #07040d;

    --accent: #7a2149;
    --accent-light: #a63a68;
    --accent-dark: #5a1636;

    --secondary: #c9a57a;
    --secondary-light: #e4c9a8;
    --secondary-dark: #8b6b47;

    --success: #2f6f58;
    --success-light: #4a8d74;
    --warning: #8b6b2f;
    --danger: #6f2a36;

    --white: #ffffff;
    --cream: #f7f3f6;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Legacy aliases to keep older Blade inline styles working */
    --primary-color: var(--accent);
    --secondary-color: var(--secondary-dark);
    --text-dark: var(--gray-900);
    --light-bg: var(--cream);

    --shadow-xs: 0 1px 2px 0 rgb(2 6 23 / 0.08);
    --shadow-sm: 0 2px 8px -4px rgb(2 6 23 / 0.18);
    --shadow-md: 0 10px 24px -12px rgb(2 6 23 / 0.28);
    --shadow-lg: 0 18px 40px -20px rgb(2 6 23 / 0.34);
    --shadow-xl: 0 24px 54px -24px rgb(2 6 23 / 0.38);
    --shadow-2xl: 0 28px 70px -22px rgb(2 6 23 / 0.45);

    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.25rem;
    --space-2xl: 1.5rem;
    --space-3xl: 2rem;

    --font-sans: 'Alexandria', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Alexandria', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: var(--transition-base);

    /* Bootstrap semantic overrides for accessible bg-* + text-white combos */
    --bs-primary: #2a1730;
    --bs-primary-rgb: 42, 23, 48;
    --bs-secondary: #6b2d45;
    --bs-secondary-rgb: 107, 45, 69;
    --bs-success: #2f6f58;
    --bs-success-rgb: 47, 111, 88;
    --bs-info: #5a4a73;
    --bs-info-rgb: 90, 74, 115;
    --bs-warning: #8b6b2f;
    --bs-warning-rgb: 139, 107, 47;
    --bs-danger: #6f2a36;
    --bs-danger-rgb: 111, 42, 54;
    --bs-dark: #120a16;
    --bs-dark-rgb: 18, 10, 22;
    --bs-light: #fbf8f4;
    --bs-light-rgb: 251, 248, 244;
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at 14% 18%, rgba(122, 33, 73, 0.08), transparent 34%),
        radial-gradient(circle at 87% 6%, rgba(201, 165, 122, 0.14), transparent 36%),
        var(--gray-50);
    color: var(--gray-800);
    line-height: 1.75;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 15px;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
    filter: blur(46px);
}

body::before {
    width: min(44vw, 560px);
    height: min(44vw, 560px);
    top: -180px;
    right: -120px;
    background: radial-gradient(circle, rgba(122, 33, 73, 0.34) 0%, rgba(122, 33, 73, 0.04) 58%, transparent 74%);
}

body::after {
    width: min(34vw, 420px);
    height: min(34vw, 420px);
    bottom: -120px;
    left: -90px;
    background: radial-gradient(circle, rgba(201, 165, 122, 0.3) 0%, rgba(201, 165, 122, 0.03) 64%, transparent 78%);
}

::selection {
    background: rgba(122, 33, 73, 0.24);
    color: var(--gray-900);
}

/* ========================================
   Typography - Clean & Minimal
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.5;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
}

h1 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h2 { font-size: clamp(1.35rem, 2.75vw, 1.85rem); }
h3 { font-size: clamp(1.15rem, 1.85vw, 1.4rem); }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.85rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.8;
    font-weight: 400;
}

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

a:hover {
    color: var(--accent-light);
}

/* ========================================
   Icons - Global Rules (Font Awesome Fix)
   ======================================== */

/* Solid Icons (Free) */
i.fas, i.far, i.fal,
.fas, .far, .fal,
i[class*="fa-"]:not(.fab),
span.fas, span.far, span.fal {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Brand Icons (Brands) */
i.fab, .fab,
i.fa-whatsapp, i.fa-facebook-f, i.fa-instagram, i.fa-twitter,
i.fa-google, i.fa-apple, i.fa-youtube, i.fa-linkedin,
.fa-whatsapp, .fa-facebook-f, .fa-instagram, .fa-twitter {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
    font-style: normal !important;
    display: inline-block;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all icons are visible and properly sized */
.fa, .fas, .far, .fab, .fal,
i[class*="fa-"] {
    min-width: 1em;
    text-align: center;
    vertical-align: middle;
}

/* ========================================
   Buttons - Professional
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    line-height: 1.6;
}

.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.02) 36%, rgba(255, 255, 255, 0.12) 100%);
    transform: translateX(-108%);
    transition: transform 0.65s ease;
}

.btn:hover::before {
    transform: translateX(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #241734 0%, var(--primary-light) 100%);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, #765735 0%, var(--secondary-dark) 100%);
    color: var(--white);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #8f6d45 0%, #6f5436 100%);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    color: var(--white);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #6a1d41 0%, var(--accent-light) 100%);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(190, 166, 136, 0.36);
    color: var(--accent-dark);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.84);
    border-color: rgba(122, 33, 73, 0.34);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* ========================================
   Header - Minimal & Clean
   ======================================== */
.header {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(16px) saturate(140%);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(190, 166, 136, 0.24);
    isolation: isolate;
}

.header::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(122, 33, 73, 0.35) 30%, rgba(201, 165, 122, 0.4) 70%, transparent 100%);
    pointer-events: none;
}

.header .logo {
    height: 70px;
}

.header .nav-link {
    color: var(--gray-600);
    padding: 0.5rem 0.875rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color var(--transition-fast), transform var(--transition-fast);
    border-radius: var(--radius-md);
    position: relative;
}

.header .nav-link:hover {
    color: var(--gray-900);
    background: var(--gray-50);
    transform: translateY(-1px);
}

.header .nav-link.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
}

.header .phone-btn {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.header .phone-btn:hover {
    background: linear-gradient(135deg, #6a1d41 0%, var(--accent-light) 100%);
    color: var(--white);
    transform: translateY(-1px);
}

/* ========================================
   Hero - Professional
   ======================================== */
.hero {
    background:
        radial-gradient(circle at 18% 16%, rgba(166, 58, 104, 0.28), transparent 40%),
        radial-gradient(circle at 84% 12%, rgba(201, 165, 122, 0.2), transparent 42%),
        linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.25rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    width: min(52vw, 640px);
    height: min(52vw, 640px);
    top: -220px;
    left: -160px;
    background: radial-gradient(circle, rgba(228, 201, 168, 0.24) 0%, rgba(228, 201, 168, 0.02) 62%, transparent 76%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    width: min(40vw, 460px);
    height: min(40vw, 460px);
    right: -120px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(166, 58, 104, 0.24) 0%, rgba(166, 58, 104, 0.03) 60%, transparent 78%);
    pointer-events: none;
}

.hero h1 {
    color: var(--white);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: var(--space-lg);
    font-weight: 700;
}

.hero p {
    color: var(--gray-300);
    font-size: clamp(0.9375rem, 2vw, 1.125rem);
    margin-bottom: var(--space-2xl);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   Cards - Minimal & Clean
   ======================================== */
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.96) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid rgba(190, 166, 136, 0.34);
    position: relative;
    isolation: isolate;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(201, 165, 122, 0.52);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.24) 0%, transparent 34%, rgba(122, 33, 73, 0.04) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover::after {
    opacity: 1;
}

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

.card-body {
    padding: 0.875rem;
}

.card-title {
    font-size: 0.9375rem;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    font-weight: 700;
    line-height: 1.3;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

.card-location {
    color: var(--gray-500);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: var(--space-md);
}

.card-location i {
    color: var(--accent);
    font-size: 0.75rem;
}

.property-features {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 600;
}

.feature-icon {
    color: var(--accent);
    font-size: 0.75rem;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-featured {
    background: var(--accent);
    color: var(--white);
}

.badge-first-sale {
    background: var(--primary);
    color: var(--white);
}

.badge-new {
    background: var(--success);
    color: var(--white);
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8125rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
    font-family: inherit;
    background: var(--white);
    color: var(--gray-800);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-left: 2.25rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background:
        radial-gradient(circle at 8% 28%, rgba(122, 33, 73, 0.24), transparent 34%),
        linear-gradient(180deg, #100915 0%, #0b101d 100%);
    color: var(--gray-400);
    padding: 2rem 0 1rem;
    border-top: 1px solid rgba(201, 165, 122, 0.26);
}

.footer h4 {
    color: var(--white);
    margin-bottom: var(--space-md);
    font-weight: 700;
    font-size: 0.9375rem;
}

.footer a {
    color: var(--gray-400);
    transition: color var(--transition-fast);
    font-size: 0.875rem;
}

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

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: var(--space-lg);
    margin-top: var(--space-xl);
    text-align: center;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* ========================================
   Utilities
   ======================================== */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 2rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title::before {
    content: "";
    width: 58px;
    height: 3px;
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--accent) 100%);
    border-radius: 999px;
    display: block;
    margin: 0 auto 14px;
}

.section-title h2 {
    margin-bottom: var(--space-sm);
}

.section-title p {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.whatsapp-float {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0b6b5f 0%, #075e54 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: transform var(--transition-fast);
}

.whatsapp-float:hover {
    transform: translateY(-2px) scale(1.05);
    color: white;
}

.admin-sidebar {
    background: var(--gray-900);
}

.admin-sidebar .nav-link {
    color: var(--gray-400);
    padding: 0.625rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.admin-sidebar .nav-link:hover {
    background: var(--gray-800);
    color: var(--white);
}

.admin-sidebar .nav-link.active {
    background: var(--accent);
    color: var(--white);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin-bottom: var(--space-md);
}

.swiper {
    border-radius: var(--radius-xl);
}

.swiper-slide img {
    width: 100%;
    height: 380px;
    object-fit: cover;
}

.swiper-button-next,
.swiper-button-prev {
    background: rgba(255, 255, 255, 0.9);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--primary) !important;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 0.875rem;
    font-weight: 700;
}

.swiper-pagination-bullet {
    background: var(--white);
    opacity: 0.6;
}

.swiper-pagination-bullet-active {
    background: var(--accent);
    opacity: 1;
    width: 18px;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 320px;
        padding: 2rem 1rem;
    }

    .section {
        padding: 1.5rem 0;
    }

    .swiper-slide img {
        height: 280px;
    }
}

/* ========================================
   Modern Enhancements + Accessibility
   ======================================== */
.header.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(122, 33, 73, 0.24);
    outline-offset: 2px;
}

.admin-card,
.property-info-card,
.inquiry-card,
.login-card {
    border: 1px solid rgba(190, 166, 136, 0.34);
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.96) 100%);
    backdrop-filter: blur(12px);
}

.admin-card:hover,
.property-info-card:hover,
.inquiry-card:hover {
    border-color: rgba(201, 165, 122, 0.52);
}

.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-success,
.badge.bg-info,
.badge.bg-warning,
.badge.bg-danger,
.badge.bg-dark {
    color: #ffffff !important;
}

.badge.bg-light {
    color: var(--gray-900) !important;
}

.status-badge.success {
    background: #2f6f58 !important;
    color: #ffffff !important;
}

.status-badge.warning {
    background: #8b6b2f !important;
    color: #ffffff !important;
}

.status-badge.danger {
    background: #6f2a36 !important;
    color: #ffffff !important;
}

.status-badge.info {
    background: #5a4a73 !important;
    color: #ffffff !important;
}

.status-badge.gray {
    background: #334155 !important;
    color: #ffffff !important;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #0b6b5f 0%, #075e54 100%) !important;
    color: #ffffff !important;
    border-color: #075e54 !important;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #0a5f54 0%, #064f47 100%) !important;
    color: #ffffff !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
