/* ==========================================================================
   K.B. IJAODOLA - LUXURY LEGAL & REALTY PORTAL
   MAIN CUSTOM STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* Color variables and fonts */
:root {
    --emerald-primary: #0B3C26;
    --emerald-dark: #062315;
    --emerald-light: #125134;
    --gold-primary: #C5A85C;
    --gold-hover: #E1C584;
    --gold-light: #F2EADA;
    --ivory-bg: #FDFDFB;
    --white-pure: #FFFFFF;
    --gray-text: #4A5568;
    --dark-neutral: #1A202C;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --ivory-bg: #0A0A0A;
    --white-pure: #121212;
    --gray-text: #A0AEC0;
    --dark-neutral: #E2E8F0;
    --gold-light: #2C2618;
    --emerald-primary: #0B3C26;
    --emerald-dark: #03100A;
}

/* Global Reset & Base Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

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

body {
    background-color: var(--ivory-bg);
    color: var(--dark-neutral);
    font-family: var(--font-sans);
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.preloader-active {
    overflow: hidden;
}

/* Premium preloader experience */
.site-preloader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 18% 20%, rgba(197, 168, 92, 0.2), transparent 42%),
        radial-gradient(circle at 82% 82%, rgba(11, 60, 38, 0.15), transparent 46%),
        linear-gradient(145deg, #fbfaf5 0%, #f2eada 46%, #f8f5eb 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.75s ease;
}

[data-theme="dark"] .site-preloader {
    background:
        radial-gradient(circle at 24% 18%, rgba(197, 168, 92, 0.18), transparent 40%),
        radial-gradient(circle at 76% 78%, rgba(11, 60, 38, 0.36), transparent 50%),
        linear-gradient(150deg, #03100a 0%, #0a1712 45%, #101b16 100%);
}

.site-preloader.is-loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-preloader__inner {
    width: min(88vw, 420px);
    padding: 2.25rem 1.5rem;
    text-align: center;
}

.site-preloader__mark {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 1.5rem;
    display: grid;
    place-items: center;
}

.site-preloader__logo {
    width: 86px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(11, 60, 38, 0.25));
    animation: kb-preloader-logo 1.7s cubic-bezier(0.2, 0.85, 0.25, 1) infinite;
}

[data-theme="dark"] .site-preloader__logo {
    filter: drop-shadow(0 6px 16px rgba(197, 168, 92, 0.3));
}

.site-preloader__ring {
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px solid rgba(11, 60, 38, 0.12);
    border-top-color: rgba(11, 60, 38, 0.45);
    border-right-color: rgba(197, 168, 92, 0.65);
    animation: kb-preloader-orbit 1.2s linear infinite;
}

[data-theme="dark"] .site-preloader__ring {
    border-color: rgba(197, 168, 92, 0.2);
    border-top-color: rgba(197, 168, 92, 0.72);
    border-right-color: rgba(241, 224, 178, 0.82);
}

.site-preloader__lines {
    width: min(260px, 70vw);
    margin: 0 auto 1rem;
    display: grid;
    gap: 0.5rem;
}

.site-preloader__lines span {
    display: block;
    height: 3px;
    border-radius: 999px;
    transform-origin: center;
    background: linear-gradient(90deg, rgba(11, 60, 38, 0.15), rgba(197, 168, 92, 0.9), rgba(11, 60, 38, 0.15));
    animation: kb-preloader-wave 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.site-preloader__lines span:nth-child(2) {
    animation-delay: 0.14s;
}

.site-preloader__lines span:nth-child(3) {
    animation-delay: 0.28s;
}

[data-theme="dark"] .site-preloader__lines span {
    background: linear-gradient(90deg, rgba(197, 168, 92, 0.22), rgba(245, 230, 182, 0.95), rgba(197, 168, 92, 0.22));
}

.site-preloader__text {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(11, 60, 38, 0.84);
}

[data-theme="dark"] .site-preloader__text {
    color: rgba(241, 224, 178, 0.9);
}

@keyframes kb-preloader-orbit {
    to {
        transform: rotate(360deg);
    }
}

@keyframes kb-preloader-wave {
    0% {
        transform: scaleX(0.5);
        opacity: 0.42;
    }
    45% {
        transform: scaleX(1.07);
        opacity: 1;
    }
    100% {
        transform: scaleX(0.54);
        opacity: 0.5;
    }
}

@keyframes kb-preloader-logo {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-preloader,
    .site-preloader * {
        animation: none !important;
        transition: none !important;
    }
}

/* Typography Standards */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--emerald-primary);
    line-height: 1.25;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4 {
    color: var(--gold-primary);
}

p {
    color: var(--gray-text);
}

/* Brand logo sizing helpers */
.brand-logo {
    display: block;
    width: auto;
    height: 48px;
    max-width: 240px;
    object-fit: contain;
}

.brand-logo-footer {
    display: block;
    width: auto;
    height: 64px;
    max-width: 320px;
    object-fit: contain;
}

.brand-logo-admin {
    display: block;
    width: auto;
    height: 34px;
    max-width: 170px;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .brand-logo-admin {
        height: 32px;
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .brand-logo {
        height: 38px;
        max-width: 180px;
    }

    .brand-logo-footer {
        height: 50px;
        max-width: 240px;
    }

    .brand-logo-admin {
        height: 30px;
        max-width: 140px;
    }
}

/* Container limits */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Interactive Navigation bar */
header {
    background-color: rgba(253, 253, 251, 0.95);
    border-bottom: 1px solid rgba(197, 168, 92, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

[data-theme="dark"] header {
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(197, 168, 92, 0.08);
}

header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Premium Button Styling */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--gold-primary);
    color: var(--emerald-dark);
}

.btn-primary:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(197, 168, 92, 0.2);
}

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

.btn-secondary:hover {
    background-color: var(--gold-primary);
    color: var(--emerald-dark);
    transform: translateY(-2px);
}

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

.btn-emerald:hover {
    background-color: var(--emerald-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(11, 60, 38, 0.2);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
    z-index: 999;
    text-decoration: none;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* Cards & Luxury Elements */
.luxury-card {
    background-color: var(--white-pure);
    border: 1px solid rgba(197, 168, 92, 0.1);
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.luxury-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--gold-primary);
    transform: scaleY(0);
    transition: transform 0.4s ease;
    transform-origin: bottom;
}

.luxury-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border-color: var(--gold-primary);
}

.luxury-card:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

/* Property showcase gallery experience */
.property-gallery-grid {
    perspective: 1000px;
}

.property-card {
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

.property-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 50px rgba(11, 60, 38, 0.18);
    border-color: rgba(197, 168, 92, 0.5);
}

.property-card__image {
    transform: scale(1);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

.property-card:hover .property-card__image {
    transform: scale(1.08);
    filter: saturate(1.08);
}

@media (prefers-reduced-motion: reduce) {
    .property-card,
    .property-card__image {
        transition: none !important;
        transform: none !important;
    }
}

/* Team Flip Cards */
.team-flip-container {
    perspective: 1000px;
    height: 420px;
}

.team-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}

.team-flip-container:hover .team-flip-inner {
    transform: rotateY(180deg);
}

.team-flip-front, .team-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid rgba(197, 168, 92, 0.15);
}

.team-flip-front {
    background-color: var(--white-pure);
}

.team-flip-back {
    background-color: var(--emerald-dark);
    color: var(--gold-light);
    transform: rotateY(180deg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Footer structure */
footer {
    background-color: var(--emerald-dark);
    color: #A0AEC0;
    padding: 5rem 0 2rem;
    border-top: 3px solid var(--gold-primary);
}

footer h4 {
    color: var(--white-pure);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

footer a {
    color: #A0AEC0;
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Typography styles inside content */
.section-tagline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--gold-primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--dark-neutral);
}

.form-control {
    width: 100%;
    padding: 1rem;
    font-size: 0.9375rem;
    border: 1px solid rgba(197, 168, 92, 0.2);
    background-color: var(--white-pure);
    color: var(--dark-neutral);
    border-radius: 0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(197, 168, 92, 0.1);
}
