/*!
 * 🏠 TAVITOUR – Home Page Visual Improvements
 * Modern & Elegant Design System
 */

/* ========================================
   HERO BANNER (Admin Configurable)
   ======================================== */
.hero-banner-home {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(30, 41, 59, 0.35);
    overflow: hidden;
    position: relative;
}

@media (max-width: 767.98px) {
    .hero-banner-home {
        border-radius: 12px;
    }
}

.hero-banner-home-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.36;
    z-index: 0;
}

.hero-banner-home-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.72) 55%, rgba(15, 23, 42, 0.86) 100%);
    z-index: 1;
}

.hero-banner-home.has-banner-image .hero-banner-home-media {
    opacity: 1;
    filter: saturate(1.06) contrast(1.02);
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    padding: 0;
    background: transparent;
}

.hero-banner-home.has-banner-image {
    height: auto;
    background: transparent;
    padding: 0;
    line-height: 0;
}

@media (max-width: 575.98px) {
    .hero-banner-home.has-banner-image {
        height: auto;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-banner-home.has-banner-image {
        height: auto;
    }
}

.hero-banner-home.has-banner-image .hero-banner-home-overlay {
    display: none;
}

.hero-banner-home.has-banner-image::before,
.hero-banner-home.has-banner-image::after {
    display: none;
}

.hero-banner-home.has-banner-image .carousel,
.hero-banner-home.has-banner-image .carousel-inner,
.hero-banner-home.has-banner-image .carousel-item {
    height: auto;
}

.hero-banner-slide-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.hero-banner-home.has-banner-image .carousel-control-prev,
.hero-banner-home.has-banner-image .carousel-control-next {
    width: 8%;
    opacity: 0.35;
}

.hero-banner-home.has-banner-image .carousel-control-prev:hover,
.hero-banner-home.has-banner-image .carousel-control-next:hover {
    opacity: 0.65;
}

.hero-banner-home::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-banner-home::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-banner-home::before,
.hero-banner-home::after {
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-banner-home h1 {
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero-banner-home .lead {
    color: rgba(255,255,255,0.95);
    font-size: 1.15rem;
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
}

.hero-banner-home .btn-primary {
    background: #F97316;
    border-color: #F97316;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.hero-banner-home .btn-primary:hover {
    background: #EA580C;
    border-color: #EA580C;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.hero-banner-home .btn-outline-light {
    border-color: rgba(255,255,255,0.6);
    color: #FFFFFF;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.hero-banner-home .btn-outline-light:hover {
    background: rgba(255,255,255,0.2);
    border-color: #FFFFFF;
    transform: translateY(-2px);
}

/* ========================================
   HOME CTA BAND (Above Favorite Drivers)
   ======================================== */
.home-cta-band {
    background: transparent;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    padding: 1.1rem 0;
}

@media (max-width: 767.98px) {
    .home-cta-band {
        padding: 1rem 0;
    }
}

.home-cta-title {
    color: #2ea8de;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.8px;
    font-size: clamp(1.4rem, 5vw, 3.9rem);
}

@media (max-width: 575.98px) {
    .home-cta-title {
        font-size: clamp(1.3rem, 6vw, 2.2rem);
    }
}

.home-cta-desc {
    color: #334155;
    font-size: clamp(.9rem, 2vw, 1rem);
    max-width: 640px;
}

.home-cta-btn-primary {
    background: linear-gradient(135deg, #16b6d0 0%, #2563eb 100%);
    border: none;
    color: #FFFFFF;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

@media (max-width: 575.98px) {
    .home-cta-btn-primary, .home-cta-btn-secondary {
        padding: .625rem 1rem;
        font-size: .9rem;
    }
}

.home-cta-btn-primary:hover,
.home-cta-btn-primary:focus {
    background: linear-gradient(135deg, #0fa7c1 0%, #1d4ed8 100%);
    color: #FFFFFF;
}

.home-cta-btn-secondary {
    background: transparent;
    border: 1px solid #b6c3d4;
    color: #0f172a;
    font-weight: 700;
    border-radius: 12px;
}

.home-cta-btn-secondary:hover,
.home-cta-btn-secondary:focus {
    background: rgba(148, 163, 184, 0.12);
    border-color: #94a3b8;
    color: #0f172a;
}

.home-cta-metrics {
    align-items: stretch;
}

.home-cta-stat {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    padding: 0.65rem 1rem;
    min-height: 0;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .home-cta-stat {
        padding: .5rem .75rem;
    }
}

.home-cta-stat-value {
    color: #1492b2;
    font-size: clamp(1.2rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.6px;
}

.home-cta-stat-label {
    color: #1e293b;
    font-size: clamp(.8rem, 2vw, .9rem);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .home-cta-stat-label {
        font-size: .75rem;
    }
}

/* ========================================
   HOMEPAGE AD SLOTS
   ======================================== */
.home-page-shell {
    max-width: min(1700px, calc(100vw - 1.25rem)) !important;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.home-page-shell.home-layout-no-ads {
    max-width: min(1380px, calc(100vw - 2.5rem)) !important;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.home-ad-col {
    display: flex;
    justify-content: center;
}

.home-ad-col-left {
    justify-content: flex-start;
}

.home-ad-col-right {
    justify-content: flex-end;
    padding-right: 0 !important;
}

.home-ad-col-right .home-ad-slot-side {
    max-width: 170px;
    margin-right: -0.75rem;
}

.home-ad-col-right .home-ad-slot-side .card-body {
    padding: 0.35rem !important;
}

.home-ad-slot-side {
    width: 100%;
    max-width: 184px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    z-index: 2;
}

.home-ad-slot-side .card-body {
    padding: 0.75rem !important;
}

.home-ad-inner-side {
    width: 160px;
    max-width: 160px;
    min-height: 600px;
    overflow: hidden;
}

.home-ad-inner-side iframe,
.home-ad-inner-side ins {
    max-width: 160px !important;
}

.home-ad-slot-bottom {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.home-ad-slot-bottom .card-body {
    padding: 0.75rem !important;
}

.tt-banner-slot {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.tt-banner-slot > * {
    max-width: 100%;
}

.tt-banner-slot img,
.tt-banner-media,
.home-ad-inner img,
.home-ad-inner iframe,
.home-ad-inner ins,
.home-ad-inner video,
.home-ad-inner object,
.home-ad-inner embed {
    display: block;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto;
}

.home-ad-slot,
.home-ad-inner {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.hero-banner-home .carousel,
.hero-banner-home .carousel-inner,
.hero-banner-home .carousel-item {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.home-ad-inner-bottom {
    width: 728px;
    max-width: 728px;
    min-height: 90px;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

.home-ad-inner-bottom iframe,
.home-ad-inner-bottom ins {
    width: 728px !important;
    max-width: 728px !important;
    min-height: 90px !important;
}

/* ========================================
   SECTION SPACING
   ======================================== */
.home-main-content {
    background: transparent !important;
}

.home-main-content > section {
    background: transparent !important;
}

.favorite-section {
    position: relative;
    border-radius: 12px;
    padding: 2rem 0;
    background: transparent !important;
}

.favorite-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, #E2E8F0, transparent);
}

.favorite-section h2 {
    color: #0F172A;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.favorite-section h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 4px;
    background: #F97316;
    border-radius: 2px;
}

/* ========================================
   CARD CATEGORIES (Distinct Styles)
   ======================================== */

/* Driver Cards (Blue Theme) */
.card-driver {
    border-left: 4px solid #3B82F6 !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #EFF6FF 100%);
    transition: all 0.3s ease;
}

.card-driver:hover {
    border-left-color: #2563EB !important;
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2) !important;
    transform: translateY(-6px);
}

.card-driver .card-body {
    position: relative;
}

.card-driver .card-body::before {
    content: '🚗';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    opacity: 0.15;
}

/* Employer Cards (Green Theme) */
.card-employer {
    border-left: 4px solid #10B981 !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #ECFDF5 100%);
    transition: all 0.3s ease;
}

.card-employer:hover {
    border-left-color: #059669 !important;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2) !important;
    transform: translateY(-6px);
}

.card-employer .card-body::before {
    content: '🏢';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    opacity: 0.15;
}

/* Job Cards (Purple Theme) */
.card-job {
    border-left: 4px solid #8B5CF6 !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #F5F3FF 100%);
    transition: all 0.3s ease;
}

.card-job:hover {
    border-left-color: #7C3AED !important;
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.2) !important;
    transform: translateY(-6px);
}

.card-job .card-body::before {
    content: '💼';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    opacity: 0.15;
}

/* Tour Cards (Orange Theme) */
.card-tour {
    border-left: 4px solid #F59E0B !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #FEF3C7 100%);
    transition: all 0.3s ease;
}

.card-tour:hover {
    border-left-color: #D97706 !important;
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.2) !important;
    transform: translateY(-6px);
}

.card-tour .card-body::before {
    content: '🗺️';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    opacity: 0.15;
}

/* Listing Cards (Red Theme) */
.card-listing {
    border-left: 4px solid #EF4444 !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #FEF2F2 100%);
    transition: all 0.3s ease;
}

.card-listing:hover {
    border-left-color: #DC2626 !important;
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.2) !important;
    transform: translateY(-6px);
}

.card-listing .card-body::before {
    content: '📋';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    opacity: 0.15;
}

/* ========================================
   CARD COMMON ENHANCEMENTS
   ======================================== */
.favorite-section .card {
    border-radius: 14px;
    overflow: hidden;
}

.favorite-section .card .rounded-circle {
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.favorite-section .card .fw-bold {
    color: #0F172A;
    font-size: 0.95rem;
}

.favorite-section .card .text-muted {
    color: #64748B !important;
    font-size: 0.8rem;
}

.favorite-section .card .btn-primary {
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* ========================================
   STAT BADGES
   ======================================== */
.badge.text-bg-light {
    background: #F1F5F9 !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========================================
   METRICS CARDS
   ======================================== */
.card .h4 {
    color: #F97316;
    font-weight: 800;
}

.home-metric-grid .h4 {
    font-size: clamp(1.45rem, 2.8vw, 2.45rem);
    line-height: 1.05;
}

.home-metric-grid .small {
    font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 991.98px) {
    .home-page-shell {
        max-width: 100% !important;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .home-ad-col-left,
    .home-ad-col-right {
        justify-content: center;
    }

    .hero-banner-home {
        border-radius: 12px;
    }

    .hero-banner-home.has-banner-image {
        height: clamp(200px, 34vw, 270px);
    }
    
    .hero-banner-home h1 {
        font-size: 2rem;
    }
    
    .hero-banner-home .lead {
        font-size: 1rem;
    }
    
    .favorite-section {
        padding: 1.5rem 0;
    }
    
    .favorite-section h2 {
        font-size: 1.25rem;
    }

    .home-cta-band {
        padding: 0.9rem 0;
    }

    .home-cta-title,
    .home-cta-desc {
        text-align: center;
    }

    .home-cta-band .d-flex {
        justify-content: center;
    }

    .home-cta-stat-value {
        font-size: clamp(1.3rem, 7vw, 2rem);
    }

    .home-cta-stat {
        width: min(100%, 210px);
        padding: 0.6rem 0.85rem;
    }

    .home-cta-stat-label {
        white-space: normal;
    }

    .home-ad-inner-bottom {
        width: min(100%, 728px);
        max-width: 100%;
    }

    .home-ad-inner-bottom iframe,
    .home-ad-inner-bottom ins {
        width: 100% !important;
        max-width: 100% !important;
    }

    .home-ad-inner-side {
        width: min(100%, 160px);
        max-width: 100%;
        min-height: 0;
    }
}

@media (max-width: 575.98px) {
    .hero-banner-home.has-banner-image {
        height: clamp(160px, 42vw, 210px);
    }

    .hero-banner-home h1 {
        font-size: 1.75rem;
    }
    
    .hero-content {
        padding: 3rem 1.5rem !important;
    }
    
    .card-driver .card-body::before,
    .card-employer .card-body::before,
    .card-job .card-body::before,
    .card-tour .card-body::before,
    .card-listing .card-body::before {
        font-size: 1.25rem;
    }

    .tt-banner-slot-home-top,
    .tt-banner-slot-footer,
    .home-ad-slot-bottom,
    .home-ad-inner-bottom {
        width: 100% !important;
        max-width: 100% !important;
    }

    .home-ad-slot-bottom .card-body {
        padding: 0.5rem !important;
    }
}

/* ========================================
   LOADING STATES
   ======================================== */
.card[data-loading="true"] {
    opacity: 0.6;
    pointer-events: none;
}

.card[data-loading="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #F97316;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .hero-banner-home {
        background: none;
        border: 1px solid #E2E8F0;
    }
    
    .card-driver,
    .card-employer,
    .card-job,
    .card-tour,
    .card-listing {
        background: #FFFFFF !important;
        box-shadow: none !important;
    }
}
