/**
 * LatviaTravel.lv — Custom Styles
 * 
 * Bootstrap 5 Overrides & Custom Components
 * Mobile-first responsive design
 * Color themes for travel (green) and business (purple) sections
 * 
 * Organization:
 *   1. CSS Variables & Root
 *   2. Base Styles
 *   3. Hero Section
 *   4. Category Cards
 *   5. Profile Cards
 *   6. Profile Detail Page
 *   7. Footer
 *   8. Utility Classes
 *   9. Responsive Breakpoints
 */

/* =========================================================================
   1. CSS Variables & Root
   ========================================================================= */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --travel-accent: #198754;
    --travel-accent-light: #d1e7dd;
    --business-accent: #6f42c1;
    --business-accent-light: #e2d9f3;
    --featured-gold: #f0ad4e;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.1);
    --border-radius: 0.75rem;
    --transition-speed: 0.2s;
}

/* =========================================================================
   2. Base Styles
   ========================================================================= */
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================================================================
    3. Hero Section
    ========================================================================= */
.hero-section {
    background: linear-gradient(135deg, #0d6efd, #6610f2, #0a58ca, #198754);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    color: #ffffff;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes driftSlow {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(15px) translateY(-8px); }
    50% { transform: translateX(-10px) translateY(5px); }
    75% { transform: translateX(8px) translateY(-3px); }
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Tiny diamonds via rotated squares with box-shadow */
.hero-bg::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.12);
    transform: rotate(45deg);
    animation: driftSlow 24s ease-in-out infinite;
    box-shadow:
        60px 30px 0 0 rgba(255,255,255,0.08),
        140px 80px 0 0 rgba(255,255,255,0.06),
        220px 20px 0 0 rgba(255,255,255,0.10),
        300px 100px 0 0 rgba(255,255,255,0.07),
        400px 50px 0 0 rgba(255,255,255,0.05),
        500px 120px 0 0 rgba(255,255,255,0.09),
        620px 35px 0 0 rgba(255,255,255,0.06),
        740px 90px 0 0 rgba(255,255,255,0.08),
        860px 15px 0 0 rgba(255,255,255,0.07),
        980px 110px 0 0 rgba(255,255,255,0.05),
        60px 180px 0 0 rgba(255,255,255,0.06),
        180px 150px 0 0 rgba(255,255,255,0.08),
        320px 200px 0 0 rgba(255,255,255,0.05),
        480px 170px 0 0 rgba(255,255,255,0.07),
        640px 190px 0 0 rgba(255,255,255,0.06),
        800px 160px 0 0 rgba(255,255,255,0.08),
        960px 210px 0 0 rgba(255,255,255,0.05);
}

/* Tiny dots */
.hero-bg::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    animation: driftSlow 20s ease-in-out infinite reverse;
    box-shadow:
        80px 40px 0 0 rgba(255,255,255,0.10),
        200px 70px 0 0 rgba(255,255,255,0.07),
        350px 25px 0 0 rgba(255,255,255,0.12),
        450px 95px 0 0 rgba(255,255,255,0.06),
        590px 55px 0 0 rgba(255,255,255,0.09),
        720px 15px 0 0 rgba(255,255,255,0.08),
        880px 85px 0 0 rgba(255,255,255,0.10),
        1050px 45px 0 0 rgba(255,255,255,0.06),
        130px 130px 0 0 rgba(255,255,255,0.07),
        290px 160px 0 0 rgba(255,255,255,0.09),
        460px 140px 0 0 rgba(255,255,255,0.05),
        630px 180px 0 0 rgba(255,255,255,0.08),
        790px 130px 0 0 rgba(255,255,255,0.06),
        950px 170px 0 0 rgba(255,255,255,0.07);
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease;
}

.hero-section .lead {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-search {
    max-width: 640px;
    margin: 2rem auto;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-search .input-group {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    overflow: hidden;
}

.hero-search .form-control {
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
}

.hero-search .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* =========================================================================
   4. Category Cards
   ========================================================================= */
.category-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: all var(--transition-speed);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    border-color: var(--primary);
    text-decoration: none;
    color: inherit;
}

.category-card .icon-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card h6 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.3;
}

/* Category type color variants */
.travel-icon {
    background: var(--travel-accent-light);
    color: var(--travel-accent);
}

.business-icon {
    background: var(--business-accent-light);
    color: var(--business-accent);
}

/* =========================================================================
   5. Profile Cards
   ========================================================================= */
.profile-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition-speed);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.profile-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.profile-card img {
    height: 180px;
    object-fit: cover;
    width: 100%;
}

.profile-card .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.profile-card .card-text {
    flex: 1;
}

.profile-card .price-level {
    color: var(--travel-accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-card .rating-stars {
    color: var(--featured-gold);
    font-weight: 600;
}

.profile-card .badge-featured {
    background: var(--featured-gold);
    color: #212529;
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-card .text-muted {
    font-size: 0.85rem;
}

/* =========================================================================
   6. Profile Detail Page
   ========================================================================= */
.profile-hero {
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.profile-hero-animated {
    background: linear-gradient(135deg, #0d6efd, #6610f2, #0a58ca, #198754);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
}
.profile-hero-animated::before {
    z-index: 1;
}

.profile-hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
}

.profile-hero .overlay {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
}

.contact-info {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.contact-info i {
    width: 1.25rem;
    color: var(--primary);
    text-align: center;
    margin-right: 0.5rem;
}

.hours-table td {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.hours-table td:first-child {
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e9ecef;
    color: #333;
    margin-right: 0.5rem;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.social-links a:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Map */
#map {
    height: 300px;
    border-radius: 0.5rem;
}

/* Profile tabs */
.nav-tabs .nav-link {
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: transparent;
}

/* =========================================================================
   7. Footer
   ========================================================================= */
footer {
    background: #212529;
    color: #adb5bd;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #ffffff;
    text-decoration: none;
}

footer h5,
footer h6 {
    color: #ffffff;
    font-weight: 600;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.1);
}

/* =========================================================================
   8. Utility Classes
   ========================================================================= */
.section-header {
    border-bottom: 3px solid transparent;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.section-header.travel {
    border-color: var(--travel-accent);
}

.section-header.business {
    border-color: var(--business-accent);
}

/* Banner slots */
.banner-slot img {
    max-width: 100%;
    height: auto;
}

.banner-header img {
    max-height: 120px;
    object-fit: cover;
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: var(--text-muted);
}

/* Language switcher */
.language-switcher .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
    gap: 0.25rem;
}

.pagination .page-link {
    border-radius: 0.5rem;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: #ffffff;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
}

/* Cookie banner */
#cookieBanner {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Search autocomplete dropdown */
.search-autocomplete-dropdown {
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
}

.search-autocomplete-dropdown a:hover {
    background: #f0f6ff;
}

/* Alert / Flash messages */
.alert {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Card general */
.card {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Badge */
.badge {
    font-weight: 500;
}

/* Table */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================================================
   9. Responsive Breakpoints
   ========================================================================= */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .profile-hero {
        height: 200px;
    }

    .social-links a {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }

    .section-header {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .category-card {
        padding: 1rem;
    }

    .category-card .icon-circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .profile-hero {
        height: 160px;
    }

    #map {
        height: 200px;
    }
}