/* ============================================
   Digikraal V2 - Modern Hero-Style Design
   Brand Guide Compliant Styles
   ============================================ */

/* ============================================
   CSS Variables - Brand Guide Aligned
   ============================================ */
:root {
    /* Brand Colors - Exact from Brand Guide */
    --color-azure-blue: #307CBB;
    --color-vivi-orange: #FA8312;
    --color-white: #FFFFFF;
    --color-light-gray: #E8E9E9;
    --color-dark-gray: #545454;
    --color-black: #000000;

    /* Semantic Color Mapping */
    --color-primary: var(--color-azure-blue);
    --color-secondary: var(--color-vivi-orange);
    --color-text-primary: var(--color-black);
    --color-text-secondary: var(--color-dark-gray);
    --color-bg-light: var(--color-light-gray);
    --color-bg-white: var(--color-white);

    /* Typography - Brand Guide Specified */
    --font-heading: 'Lexend', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-size-body: 1.125rem; /* 18px */

    /* Spacing Scale */
    --space-xs: 0.5rem;    /* 8px */
    --space-sm: 1rem;      /* 16px */
    --space-md: 1.5rem;    /* 24px */
    --space-lg: 2.5rem;    /* 40px */
    --space-xl: 4rem;      /* 64px */
    --space-2xl: 6rem;     /* 96px */

    /* Transparency - Brand Guide: 60% opacity */
    --overlay-opacity: 0.6;

    /* Border Radius */
    --radius-sm: 0.5rem;   /* 8px */
    --radius-md: 1rem;     /* 16px */
    --radius-lg: 1.5rem;   /* 24px */

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);

    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ============================================
   Dark Mode Overrides
   ============================================ */
html.dark-mode {
    --color-text-primary: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-bg-white: #0f172a;
    --color-bg-light: #1e293b;
    --color-white: #1e293b;
    --color-light-gray: #334155;
}

html.dark-mode body {
    background-color: #0f172a;
    color: #e2e8f0;
}

html.dark-mode nav#tour-navbar {
    background-color: #1e293b !important;
    border-color: #307CBB;
}

html.dark-mode nav#tour-navbar a,
html.dark-mode nav#tour-navbar button {
    color: #e2e8f0;
}

html.dark-mode .navbar-menu nav {
    background-color: #1e293b !important;
}

html.dark-mode .v2-footer {
    background-color: #0b1120;
}

html.dark-mode .bg-white,
html.dark-mode [class*="bg-white"] {
    background-color: #1e293b !important;
}

html.dark-mode .bg-gray-50,
html.dark-mode .bg-gray-100 {
    background-color: #0f172a !important;
}

html.dark-mode .text-gray-900,
html.dark-mode .text-gray-800,
html.dark-mode .text-gray-700 {
    color: #e2e8f0 !important;
}

html.dark-mode .text-gray-600,
html.dark-mode .text-gray-500 {
    color: #94a3b8 !important;
}

html.dark-mode .border-gray-100,
html.dark-mode .border-gray-200 {
    border-color: #334155 !important;
}

html.dark-mode .shadow-lg,
html.dark-mode .shadow-md {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

html.dark-mode .v2-feature-card,
html.dark-mode .v2-listing-card,
html.dark-mode .v2-info-card,
html.dark-mode .v2-seller-card {
    background-color: #1e293b;
}

/* ============================================
   Recently Viewed Cards
   ============================================ */
.v2-recent-section { padding: 2rem 0; }

.v2-recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.v2-recent-card {
    display: block;
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    text-decoration: none;
}

.v2-recent-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.v2-recent-img {
    height: 120px;
    overflow: hidden;
    background: var(--color-bg-light);
}

.v2-recent-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-recent-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 2rem;
}

.v2-recent-info { padding: 0.75rem; }

.v2-recent-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-recent-price {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 0.25rem;
}

/* Back to Top hover */
#v2BackToTop:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(48,124,187,0.4);
}

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

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

body {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Ensure V2 page has clean slate - no inherited styles */
.v2-hero ~ * {
    position: relative;
    z-index: 1;
}

/* Hide any inherited sidebars/search overlays from main site */
.sidebar,
.side-menu,
.search-overlay,
#searchOverlay,
.mobile-sidebar,
[class*="sidebar"]:not([class*="agent-sidebar"]),
.inner-sidebar-wrapper {
    display: none !important;
}

/* Ensure main content takes full width */
main {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ============================================
   Typography - Brand Guide Compliant
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700; /* Always bold per brand guide */
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 { font-size: 3.5rem; }   /* 56px */
h2 { font-size: 2.5rem; }   /* 40px */
h3 { font-size: 2rem; }     /* 32px */
h4 { font-size: 1.5rem; }   /* 24px */
h5 { font-size: 1.25rem; }  /* 20px */
h6 { font-size: 1rem; }     /* 16px */

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--color-secondary);
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: #2868a3;
    border-color: #2868a3;
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: #e07510;
    border-color: #e07510;
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-outline:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.btn-lg {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

/* ============================================
   Container & Layout Utilities
   ============================================ */
.v2-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.v2-container-wide {
    max-width: 1400px;
}

.v2-container-narrow {
    max-width: 900px;
}

.v2-section {
    padding: var(--space-2xl) 0;
}

.v2-section--sm {
    padding: var(--space-xl) 0;
}

/* ============================================
   Header/Navigation
   ============================================ */
.v2-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-base);
    padding: var(--space-md) 0;
}

.v2-header--transparent {
    background-color: transparent;
}

.v2-header--solid {
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.v2-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v2-nav__logo img {
    height: 50px;
    width: auto;
}

.v2-nav__menu {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    list-style: none;
}

.v2-nav__link {
    color: var(--color-white);
    font-weight: 500;
    transition: var(--transition-base);
}

.v2-header--solid .v2-nav__link {
    color: var(--color-text-primary);
}

.v2-nav__link:hover {
    color: var(--color-secondary);
}

.v2-nav__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.v2-nav__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.5rem;
    cursor: pointer;
}

.v2-header--solid .v2-nav__toggle {
    color: var(--color-text-primary);
}

/* ============================================
   Hero Section
   ============================================ */
.v2-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-2xl) 0;
    background-color: var(--color-black);
    width: 100%;
    margin: 0 auto;
}

.v2-hero__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.v2-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(48, 124, 187, var(--overlay-opacity)) 0%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 2;
}

.v2-hero__content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--color-white);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.v2-hero__subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.v2-hero__title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.v2-hero__description {
    font-size: 1.375rem;
    margin-bottom: var(--space-xl);
    opacity: 0.9;
    line-height: 1.6;
}

.v2-hero__actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Stats Bar
   ============================================ */
.v2-stats {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-bg-light);
    border-bottom: 1px solid var(--color-bg-light);
    padding: var(--space-xl) 0;
}

.v2-stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    text-align: center;
}

.v2-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.v2-stat__icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.v2-stat__number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-heading);
}

.v2-stat__label {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ============================================
   Feature Cards
   ============================================ */
.v2-features {
    background-color: var(--color-bg-white);
}

.v2-features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.v2-feature-card {
    background-color: var(--color-white);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    text-align: center;
}

.v2-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.v2-feature-card__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    font-size: 2rem;
    color: var(--color-white);
}

.v2-feature-card__title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.v2-feature-card__description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================================
   Section Headers
   ============================================ */
.v2-section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.v2-section-header__subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--space-sm);
}

.v2-section-header__title {
    font-size: 2.5rem;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.v2-section-header__description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   Listing Cards
   ============================================ */
.v2-listings {
    background-color: var(--color-bg-light);
}

.v2-listings__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.v2-listing-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}

.v2-listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.v2-listing-card__image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.v2-listing-card__content {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.v2-listing-card__badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    align-self: flex-start;
}

.v2-listing-card__title {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.v2-listing-card__meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.v2-listing-card__meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.v2-listing-card__price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-top: auto;
    font-family: var(--font-heading);
}

/* ============================================
   Testimonial Section
   ============================================ */
.v2-testimonials {
    background: linear-gradient(135deg, var(--color-primary) 0%, #245a8f 100%);
    color: var(--color-white);
}

.v2-testimonials .v2-section-header__subtitle {
    color: var(--color-secondary);
}

.v2-testimonials .v2-section-header__title,
.v2-testimonials .v2-section-header__description {
    color: var(--color-white);
}

.v2-testimonial-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.v2-testimonial-card__quote {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
    font-style: italic;
}

.v2-testimonial-card__author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.v2-testimonial-card__avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-white);
}

.v2-testimonial-card__name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.v2-testimonial-card__title {
    font-size: 0.9375rem;
    opacity: 0.8;
}

/* ============================================
   CTA Section
   ============================================ */
.v2-cta {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #c96d0e 100%);
    color: var(--color-white);
    text-align: center;
    padding: var(--space-2xl) 0;
}

.v2-cta__title {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    color: var(--color-white);
}

.v2-cta__description {
    font-size: 1.25rem;
    margin-bottom: var(--space-xl);
    opacity: 0.95;
}

.v2-cta__form {
    display: flex;
    gap: var(--space-sm);
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.v2-cta__input {
    flex: 1;
    min-width: 280px;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-body);
}

.v2-cta__input:focus {
    outline: none;
    border-color: var(--color-white);
}

/* ============================================
   Footer
   ============================================ */
.v2-footer {
    background-color: var(--color-text-primary);
    color: var(--color-white);
    padding: var(--space-xl) 0 var(--space-md);
}

.v2-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.v2-footer__column h4 {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    color: var(--color-white);
}

.v2-footer__links {
    list-style: none;
}

.v2-footer__link {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-sm);
    transition: var(--transition-base);
}

.v2-footer__link:hover {
    color: var(--color-secondary);
    padding-left: var(--space-xs);
}

.v2-footer__social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.v2-footer__social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--color-white);
    transition: var(--transition-base);
}

.v2-footer__social-link:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
}

.v2-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9375rem;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.v2-animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* ============================================
   Responsive Design - Mobile First
   ============================================ */

/* Tablets and below */
@media (max-width: 768px) {
    :root {
        --space-xl: 3rem;
        --space-2xl: 4rem;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .v2-nav__menu {
        display: none;
    }

    .v2-nav__toggle {
        display: block;
    }

    .v2-hero__title {
        font-size: 2.5rem;
    }

    .v2-hero__description {
        font-size: 1.125rem;
    }

    .v2-hero__actions {
        flex-direction: column;
        width: 100%;
    }

    .v2-hero__actions .btn {
        width: 100%;
    }

    .v2-features__grid,
    .v2-listings__grid {
        grid-template-columns: 1fr;
    }

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

    .v2-section-header__title {
        font-size: 2rem;
    }

    .v2-cta__form {
        flex-direction: column;
    }

    .v2-cta__input {
        width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .v2-hero__title {
        font-size: 2rem;
    }

    .v2-stats__grid {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   Bootstrap Modal Compatibility
   (minimal styles for Bootstrap JS modals)
   ============================================ */
.modal { display: none; position: fixed; top: 0; left: 0; z-index: 1055; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.show { display: block; }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 1050; width: 100vw; height: 100vh; background-color: #000; }
.modal-backdrop.show { opacity: 0.5; }
.modal-backdrop.fade { opacity: 0; transition: opacity 0.15s linear; }
.modal-dialog { position: relative; width: auto; margin: 1.75rem auto; max-width: 500px; pointer-events: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3.5rem); }
.modal-lg { max-width: 800px; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; border-radius: 1rem; box-shadow: 0 10px 40px rgba(0,0,0,0.2); outline: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid #e5e7eb; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1.5rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid #e5e7eb; gap: 0.5rem; }
.fade { transition: opacity 0.15s linear; }
.fade:not(.show) { opacity: 0; }
.modal.fade .modal-dialog { transition: transform 0.3s ease-out; transform: translateY(-50px); }
.modal.show .modal-dialog { transform: none; }
body.modal-open { overflow: hidden; }
