/* Custom styles to match the original design */

/* CSS Variables for consistent design */
:root {
    /* Colors */
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;

    /* Neutral colors */
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border radius */
    --radius-sm: 0.125rem;
    --radius: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;

    /* Typography */
    --font-family-sans: 'Sarabun', 'Noto Sans Thai', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    /* Line heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
}

/* Global styles with enhanced Thai language support */
body {
    font-family: 'Sarabun', 'Noto Sans Thai', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa; /* เปลี่ยนเป็นพื้นหลังสีเทาอ่อน */
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Enhanced Thai text rendering */
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Apply enhanced Thai language support to all text elements */
h1, h2, h3, h4, h5, h6, p, span, div, a, button, input, textarea, select, label,
.form-control, .form-select, .btn, .card, .alert, .nav-link, .dropdown-item,
.navbar-brand, .navbar-nav, .breadcrumb, .pagination, .badge, .toast, .modal {
    font-family: 'Sarabun', 'Noto Sans Thai', 'Helvetica Neue', Arial, sans-serif;
    /* Thai language support */
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Specific Thai text rendering improvements for headings */
h1, h2, h3, h4, h5, h6 {
    font-variant-ligatures: common-ligatures;
    font-kerning: auto;
    /* Ensure proper spacing for Thai vowels and tone marks */
    letter-spacing: 0.01em;
    line-height: 1.4;
    /* Prevent text clipping for Thai characters */
    padding-top: 0.1em;
    padding-bottom: 0.1em;
}

/* Enhanced text rendering for paragraphs and content */
p, .lead, .text-content {
    line-height: 1.7;
    letter-spacing: 0.005em;
    word-spacing: 0.01em;
    /* Prevent text clipping for Thai characters */
    padding-top: 0.05em;
    padding-bottom: 0.05em;
}

/* Home wrapper */
.home-wrapper {
    position: relative;
    padding-top: 0;
    margin-top: 0;
    overflow: hidden;
}

/* Header styles */
header {
    padding: 10px 0;
    z-index: 1070;
    position: sticky;
    top: 0;
}

.not-home header {
    /* background: controlled by settings in app.blade.php */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Homepage header positioning and transitions */
.home-page header {
    /* background: transparent when not scrolled, settings color when scrolled */
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    width: 100%;
    z-index: 1070; /* Higher than hero section */
}

/* Ensure transparent background for non-scrolled home page header */
.home-page header:not(.scrolled) {
    background: transparent !important;
}

/* Mobile navbar improvements */
@media (max-width: 991.98px) {
    /* Ensure navbar toggler is visible on homepage */
    .home-page .navbar-toggler {
        background-color: rgba(0, 0, 0, 0.8) !important;
        border: 2px solid rgba(255, 255, 255, 0.8) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    .home-page .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.5) !important;
    }

    /* Disable navbar brand hover effects in mobile for all pages */
    .navbar-brand,
    .home-page .navbar-brand,
    body:not(.home-page) .navbar-brand {
        transition: none !important;
    }

    .navbar-brand:hover,
    .home-page .navbar-brand:hover,
    body:not(.home-page) .navbar-brand:hover {
        /* color: controlled by settings in app.blade.php */
        text-shadow: inherit !important;
        transform: none !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
    }
}

/* Navbar when scrolled - background controlled by dynamic styles */
.home-page header.scrolled {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1070;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add padding to body when navbar is scrolled to prevent content jump */
body.navbar-scrolled .hero {
    padding-top: 180px;
}

/* Consistent spacing between navbar and content for all pages */
main {
    margin-top: 80px; /* Base spacing for desktop */
}

/* Homepage hero section - adjust for navbar overlap */
.home-page main {
    margin-top: 0; /* Reset for homepage since hero handles its own spacing */
}

/* Non-homepage content spacing */
body:not(.home-page) main {
    margin-top: 80px; /* Consistent spacing for all other pages */
}

/* Hero section spacing adjustments */
.hero {
    padding-top: 120px; /* Ensure hero content doesn't overlap with navbar */
    padding-bottom: 80px;
}

/* When navbar is scrolled on homepage, add extra padding */
body.navbar-scrolled .hero {
    padding-top: 180px;
}

.navbar {
    padding: 0;
    min-height: 60px;
}

/* Mobile spacing adjustments */
@media (max-width: 767.98px) {
    /* Adjust main content spacing for mobile */
    main {
        margin-top: 75px; /* Slightly less spacing on mobile */
    }

    body:not(.home-page) main {
        margin-top: 75px;
    }

    /* Hero section mobile adjustments */
    .hero {
        padding-top: 100px; /* Less padding on mobile */
        padding-bottom: 60px;
    }

    /* When navbar is scrolled on mobile homepage */
    body.navbar-scrolled .hero {
        padding-top: 160px;
    }

    .navbar {
        min-height: 65px;
        padding: 8px 0;
    }

    .navbar-brand {
        font-size: 1.4rem !important;
        height: 65px !important;
        font-weight: 700 !important;
        letter-spacing: -0.5px !important;
    }

    .navbar-brand img {
        height: 50px !important;
        margin-right: 12px !important;
    }

    .navbar-brand i {
        font-size: 2.2rem !important;
        margin-right: 12px !important;
    }

    header {
        padding: 8px 0;
    }
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0;
    height: 60px;
    letter-spacing: -0.5px;
}

/* Navbar brand base styles - color controlled by settings */
.navbar-brand,
.navbar-brand:link,
.navbar-brand:visited,
.navbar-brand:hover,
.navbar-brand:focus,
.navbar-brand:active,
.home-page .navbar-brand,
.home-page .navbar-brand:link,
.home-page .navbar-brand:visited,
.home-page .navbar-brand:hover,
.home-page .navbar-brand:focus,
.home-page .navbar-brand:active,
body:not(.home-page) .navbar-brand,
body:not(.home-page) .navbar-brand:link,
body:not(.home-page) .navbar-brand:visited,
body:not(.home-page) .navbar-brand:hover,
body:not(.home-page) .navbar-brand:focus,
body:not(.home-page) .navbar-brand:active {
    /* color: controlled by settings in app.blade.php */
    text-decoration: none !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Override Bootstrap link styles for navbar brand */
a.navbar-brand,
a.navbar-brand:link,
a.navbar-brand:visited,
a.navbar-brand:hover,
a.navbar-brand:focus,
a.navbar-brand:active {
    /* color: controlled by settings in app.blade.php */
    text-decoration: none !important;
}

/* Override any child elements in navbar brand */
.navbar-brand *,
.navbar-brand *:hover,
.navbar-brand *:focus,
.navbar-brand *:active {
    /* color: controlled by settings in app.blade.php */
    text-decoration: none !important;
}

/* Enhanced navbar brand for larger mobile screens (tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Adjust main content spacing for tablets */
    main {
        margin-top: 85px; /* Medium spacing for tablets */
    }

    body:not(.home-page) main {
        margin-top: 85px;
    }

    /* Hero section tablet adjustments */
    .hero {
        padding-top: 110px; /* Medium padding for tablets */
        padding-bottom: 70px;
    }

    /* When navbar is scrolled on tablet homepage */
    body.navbar-scrolled .hero {
        padding-top: 170px;
    }

    .navbar {
        min-height: 70px;
        padding: 10px 0;
    }

    .navbar-brand {
        font-size: 1.6rem !important;
        height: 70px !important;
        font-weight: 700 !important;
        letter-spacing: -0.6px !important;
    }

    .navbar-brand img {
        height: 55px !important;
        margin-right: 14px !important;
    }

    .navbar-brand i {
        font-size: 2.4rem !important;
        margin-right: 14px !important;
    }

    header {
        padding: 10px 0;
    }
}

/* Large desktop spacing adjustments */
@media (min-width: 1200px) {
    /* Slightly more spacing for large screens */
    main {
        margin-top: 90px; /* More spacing for large desktop */
    }

    body:not(.home-page) main {
        margin-top: 90px;
    }

    /* Hero section large desktop adjustments */
    .hero {
        padding-top: 130px; /* More padding for large desktop */
        padding-bottom: 90px;
    }

    /* When navbar is scrolled on large desktop homepage */
    body.navbar-scrolled .hero {
        padding-top: 190px;
    }
}

.home-page .navbar-brand {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.home-page header.scrolled .navbar-brand {
    color: #ffffff;
    text-shadow: none;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.navbar-nav .nav-item {
    margin-left: 15px;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.home-page .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.home-page header.scrolled .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: none;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.navbar-nav .nav-link:hover {
    color: #ffffff;
}

.home-page .navbar-nav .nav-link:hover {
    color: #fff;
}

.home-page header.scrolled .navbar-nav .nav-link:hover {
    color: #ffffff;
}

.navbar-nav .nav-link.active {
    color: #ffffff;
    font-weight: 600;
}

.home-page .navbar-nav .nav-link.active {
    color: #fff;
}

.home-page header.scrolled .navbar-nav .nav-link.active {
    color: #ffffff;
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
}

.home-page .navbar-nav .nav-link.active::after {
    background-color: #fff;
}

.home-page header.scrolled .navbar-nav .nav-link.active::after {
    background-color: #ffffff;
}

/* Navbar toggler for mobile - Dark theme for all pages */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 8px;
    background-color: rgba(55, 65, 81, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 20px;
    height: 20px;
}

.home-page .navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 6px 8px;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.home-page .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.home-page .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 20px;
    height: 20px;
}

.home-page header.scrolled .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(55, 65, 81, 0.9);
    border-radius: 6px;
}

.home-page header.scrolled .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

.home-page header.scrolled .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero section */
.hero {
    /* background-color removed - now controlled by settings */
    color: #fff;
    padding-top: 120px; /* Ensure hero content doesn't overlap with navbar */
    padding-bottom: 80px;
    text-align: center;
    margin-bottom: 0;
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Hero section for other pages */
.not-home .hero {
    padding-top: 120px; /* Consistent with homepage hero */
    padding-bottom: 40px;
    min-height: auto;
    /* background-color removed - now controlled by settings */
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hero overlay removed - now controlled by settings */

.hero .container {
    position: relative;
    z-index: 2;
    padding-top: 0;
    width: 100%;
}

.hero h1 {
    font-size: 3.2rem;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

.hero p {
    font-size: 1.3rem;
    max-width: 1000px;
    margin: 0 auto 20px;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 30px auto 10px;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    /* Remove animation that causes movement */
    /* animation: fadeIn 1.2s ease-out; */
}

/* Modern search box styles - respects hero settings */
.search-box .input-group {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.search-box .input-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.search-box .form-control {
    background: transparent;
    border: none;
    color: #333;
    font-weight: 500;
    padding: 12px 20px;
}

.search-box .form-control::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

.search-box .form-control:focus {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #333;
}

/* Enhanced search button - uses Bootstrap primary color */
.search-box .btn-primary {
    border: none;
    border-radius: 40px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-box .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.search-box .btn-primary:hover::before {
    left: 100%;
}

.search-box .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.search-box .form-control {
    padding-right: 40px;
    border-radius: 4px;
    height: 45px;
}

.search-box .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: #333;
    font-weight: 600;
    margin-bottom: 0;
}

.view-all {
    color: #007bff;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.view-all i {
    margin-left: 5px;
}

/* Item type cards - handled by modern-components.css */

.item-meta {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px; /* เพิ่ม gap เพื่อให้ badge มีระยะห่างที่เหมาะสม */
}

/* ปรับแต่งสี badge ให้สว่างขึ้น */
.badge.bg-secondary {
    background-color: #6c9bd1 !important; /* สีฟ้าอ่อน */
    color: #fff;
}

.badge.bg-secondary.item-badge {
    background-color: #6c9bd1 !important; /* สีฟ้าอ่อน */
    color: #fff;
}

.item-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.item-date {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Item viewer */
.item-viewer {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Item grid and table - handled by modern-components.css */

.viewer-toolbar {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 5px;
}

.main-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.main-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

#item-image {
    max-width: 100%;
    max-height: 400px;
    transition: transform 0.3s ease;
}

.viewer-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.thumbnails {
    display: flex;
    gap: 10px;
    padding: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f0f0f0;
    white-space: nowrap;
    cursor: grab;
    user-select: none;
}

.thumbnails.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.thumbnails::-webkit-scrollbar {
    height: 8px;
}

.thumbnails::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 4px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.thumbnail.active {
    border-color: #007bff;
}

.thumbnail:hover:not(.active) {
    border-color: #ddd;
}

/* Document tabs */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 20px;
    font-weight: 500;
    color: #495057;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #007bff;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: transparent;
}

/* Map styles */
.map-container {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    border: 1px solid #ddd;
    position: relative;
    z-index: 1;
}

.location-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

/* Filter section */
.filter-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.filter-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #333;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #555;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    justify-content: center;
}

.pagination .page-item .page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.pagination .page-item .page-link:hover {
    background-color: #e9ecef;
}

/* Modern Footer */
footer {
    /* background removed - now controlled by settings */
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.03)"/><circle cx="20" cy="80" r="0.5" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

footer .container {
    position: relative;
    z-index: 2;
}

footer h5 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
    font-weight: 600;
    color: #fff;
}

footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.3) 100%);
    border-radius: 2px;
}

footer ul {
    padding-left: 0;
    list-style: none;
}

footer ul li {
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

footer ul li:hover {
    transform: translateX(5px);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    font-weight: 400;
}

footer a:hover {
    color: #fff;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

footer a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    margin-top: 25px;
}

.footer-bottom p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}



/* Responsive adjustments for footer */
@media (max-width: 767.98px) {
    footer {
        padding: 30px 0 15px;
        margin-top: 40px;
    }

    footer h5 {
        font-size: 1.1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    footer ul li {
        margin-bottom: 6px;
    }

    .footer-bottom {
        padding-top: 15px;
        margin-top: 20px;
    }

    .footer-bottom p {
        margin-bottom: 8px;
        font-size: 0.9rem;
    }

    .footer-bottom {
        text-align: center;
    }

    .footer-bottom .col-md-8,
    .footer-bottom .col-md-4 {
        text-align: center !important;
    }

    /* Social icons responsive */
    .social-icons {
        justify-content: center !important;
        gap: 8px;
        margin-top: 20px !important;
    }

    .social-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Basic Social Icons Styles */
.social-icons {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

.social-icon i {
    font-size: 16px;
}

/* Mobile Navigation - handled by modern-navbar.css */

/* Responsive styles - consolidated with mobile navigation */

@media (max-width: 767.98px) {
    /* Hero Section Mobile */
    .hero {
        padding: 0;
        min-height: 100vh;
        margin-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 80px;
    }

    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .hero p {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 25px;
    }

    .search-box {
        max-width: 100%;
        margin: 25px auto 15px;
    }

    /* Cards and Grid Mobile - handled by modern-components.css */

    /* Filter and Layout Mobile */
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .document-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Section Headers Mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        text-align: left;
    }

    .section-header h2 {
        font-size: 1.6rem;
        margin-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    /* Extra Small Mobile */
    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.1;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 20px;
    }

    .search-box {
        margin: 20px auto 10px;
    }

}

/* Touch and Accessibility Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch device specific styles */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        min-width: 44px;
    }

    /* Card styles - handled by modern-components.css */
}

/* Remove focus outline for navigation elements */
.navbar-toggler:focus,
.nav-link:focus,
.navbar-nav .nav-link:focus,
.navbar-brand:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus outline for buttons in navigation */
.navbar .btn:focus,
.navbar button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus outline for dropdown items */
.dropdown-item:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove all focus outlines for navigation and interactive elements */
a:focus,
button:focus,
.btn:focus,
.nav-link:focus,
.navbar-toggler:focus,
.dropdown-toggle:focus,
.dropdown-item:focus,
.navbar-brand:focus,
[data-bs-toggle]:focus,
[data-bs-target]:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove active/focus states that create borders */
.nav-link:active,
.nav-link:focus,
.btn:active,
.btn:focus,
button:active,
button:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Keep focus styles only for form controls for accessibility */
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Essential Animations Only */

/* Essential Button Styles */
.btn-primary:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .home-page header {
        background-color: rgba(0, 0, 0, 0.9) !important;
    }

    .home-page header.scrolled {
        background-color: rgba(255, 255, 255, 1) !important;
    }

    .home-page .navbar-collapse {
        background-color: rgba(0, 0, 0, 1) !important;
        border: 2px solid #fff !important;
    }

    .home-page header.scrolled .navbar-collapse {
        background-color: rgba(255, 255, 255, 1) !important;
        border: 2px solid #000 !important;
    }
}
