/* Ancient Manuscript Background Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    background:
        linear-gradient(135deg,
            rgba(0, 29, 41, 0.8) 0%,
            rgba(25, 25, 112, 0.6) 30%,
            rgba(218, 165, 32, 0.4) 50%,
            rgba(25, 25, 112, 0.6) 70%,
            rgba(0, 29, 41, 0.8) 100%),
        url('/static/pics/background_book.png') center center/cover no-repeat fixed !important;
    min-height: 100vh !important;
    position: relative !important;
    overflow-x: hidden !important;
    color: #F5F5DC !important;
    background-attachment: fixed !important;
}

/* Subtle parchment texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 20px 30px, rgba(139, 69, 19, 0.1), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(218, 165, 32, 0.08), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(139, 69, 19, 0.05), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(218, 165, 32, 0.06), transparent);
    background-repeat: repeat;
    background-size: 150px 120px;
    pointer-events: none;
    z-index: 1;
}

/* Hebrew Letters Floating Animation - Manuscript Style */
.hebrew-letters {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.hebrew-letter {
    position: absolute;
    font-weight: 600;
    color: rgba(218, 165, 32, 0.4);
    text-shadow:
        0 0 4px rgba(218, 165, 32, 0.6),
        0 0 8px rgba(218, 165, 32, 0.3);
    animation: float-letter 15s linear infinite;
    font-family: 'David', 'Times New Roman', serif;
}

.hebrew-letter:nth-child(odd) {
    color: rgba(139, 69, 19, 0.3);
    text-shadow:
        0 0 4px rgba(139, 69, 19, 0.5),
        0 0 8px rgba(139, 69, 19, 0.2);
}

.hebrew-letter:nth-child(3n) {
    color: rgba(25, 25, 112, 0.3);
    text-shadow:
        0 0 4px rgba(25, 25, 112, 0.5),
        0 0 8px rgba(25, 25, 112, 0.2);
}

.hebrew-letter:nth-child(4n) {
    color: rgba(184, 134, 11, 0.4);
    text-shadow:
        0 0 4px rgba(184, 134, 11, 0.6),
        0 0 8px rgba(184, 134, 11, 0.3);
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .mystical-book {
        width: 95%;
        max-width: 450px;
        height: 150px;
        bottom: -25px;
    }

    .hebrew-letter {
        font-size: 18px !important;
    }

    .content-overlay {
        margin: 10px;
        padding: 1rem !important;
    }
}

@keyframes book-glow {
    0% {
        box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.4), inset 0 8px 20px rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 215, 0, 0.2);
    }

    100% {
        box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.4), inset 0 8px 20px rgba(255, 255, 255, 0.3), 0 0 60px rgba(255, 215, 0, 0.4);
    }
}

.mystical-book::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 180px;
    background: linear-gradient(to bottom, #5d4037, #3e2723);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.book-pages {
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: linear-gradient(to bottom, #fefcf3, #f8f6e8);
    border-radius: 12px;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 -1px 5px rgba(139, 69, 19, 0.05);
    overflow: hidden;
}

.book-text {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    font-size: 12px;
    line-height: 1.5;
    color: #4a4a4a;
    font-family: 'David', 'Times New Roman', serif;
    text-align: center;
    opacity: 0.7;
}

/* Animations */
@keyframes sparkle {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
    }
}

@keyframes float-letter {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    5% {
        opacity: 0.8;
    }

    95% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-50px) rotate(15deg);
        opacity: 0;
    }
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

/* Content Overlay - Ancient Parchment Style */
.content-overlay {
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 25%,
            rgba(255, 248, 235, 0.4) 50%,
            rgba(245, 235, 215, 0.4) 75%,
            rgba(237, 230, 217, 0.4) 100%);
    border-radius: 15px;
    margin: 20px;
    padding: 1.25rem;
    box-shadow:
        0 8px 25px rgba(139, 69, 19, 0.3),
        inset 0 2px 8px rgba(218, 165, 32, 0.1),
        0 0 20px rgba(218, 165, 32, 0.15);
    border: 2px solid rgba(218, 165, 32, 0.4);
}

/* Ensure text content in content-overlay has full opacity */
.content-overlay * {
    opacity: 1 !important;
}

/* Headings - Elegant Gold and Deep Blue */
h1 {
    color: #DAA520;
    text-shadow: 0 2px 6px rgba(25, 25, 112, 0.4);
    font-weight: bold;
}

h2,
h3,
h4 {
    color: #191970;
    text-shadow: 0 1px 3px rgba(218, 165, 32, 0.3);
}

form {
    margin-bottom: 20px;
}

label {
    margin-right: 10px;
    color: #2D2D2D;
    font-weight: 600;
}

input,
select,
textarea {
    margin: 5px 0 15px;
    padding: 6px 8px;
    font-size: 0.95em;
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #2D2D2D;
    transition: all 0.3s ease;
    height: auto;
    min-height: 36px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #DAA520;
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.4);
    outline: none;
    background: rgba(255, 255, 255, 1);
}

button {
    padding: 12px 20px;
    color: #2D2D2D;
    border: 2px solid rgba(25, 25, 112, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
    transition: all 0.3s ease;
}

button:hover {
    background: linear-gradient(45deg, #FFD700, #DAA520);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.5), 0 0 15px rgba(218, 165, 32, 0.3);
    border-color: rgba(25, 25, 112, 0.4);
}

/* Search Form Sections with Manuscript-Inspired Backgrounds */
.search-section-blue {
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 50%,
            rgba(255, 248, 235, 0.4) 100%) !important;
    border: 2px solid rgba(218, 165, 32, 0.5) !important;
    color: #1F2937 !important;
    box-shadow: 0 4px 15px rgba(25, 25, 112, 0.3) !important;
}

/* Ensure text content in search-section-blue has full opacity */
.search-section-blue * {
    opacity: 1 !important;
}

.search-section-dark {
    background: linear-gradient(135deg,
            rgba(45, 45, 45, 0.4) 0%,
            rgba(60, 60, 60, 0.4) 50%,
            rgba(45, 45, 45, 0.4) 100%) !important;
    border: 2px solid rgba(218, 165, 32, 0.4) !important;
    color: #f5f5dc !important;
    box-shadow: 0 4px 15px rgba(45, 45, 45, 0.4) !important;
}

/* Ensure text content in search-section-dark has full opacity */
.search-section-dark * {
    opacity: 1 !important;
}

.search-section-parchment {
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 25%,
            rgba(255, 248, 235, 0.4) 50%,
            rgba(245, 235, 215, 0.4) 75%,
            rgba(237, 230, 217, 0.4) 100%) !important;
    border: 2px solid rgba(218, 165, 32, 0.4) !important;
    color: #2D2D2D !important;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2) !important;
}

/* Ensure text content in search-section-parchment has full opacity */
.search-section-parchment * {
    opacity: 1 !important;
}

/* Results Cards with Ancient Style */
.result-card {
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 30%,
            rgba(255, 248, 235, 0.4) 70%,
            rgba(245, 235, 215, 0.4) 100%) !important;
    border: 2px solid rgba(218, 165, 32, 0.4) !important;
    box-shadow:
        0 8px 20px rgba(139, 69, 19, 0.2),
        inset 0 2px 6px rgba(218, 165, 32, 0.1),
        0 0 15px rgba(218, 165, 32, 0.15) !important;
    color: #2D2D2D !important;
}

/* Ensure text content in result-card has full opacity */
.result-card * {
    opacity: 1 !important;
}

/* Header with Elegant Manuscript Style */
.header-mystical {
    /* background: transparent !important; */
    /* border-bottom: 3px solid rgba(218, 165, 32, 0.6) !important; */
    color: #F5F5DC !important;
    /* box-shadow: 0 4px 15px rgba(25, 25, 112, 0.3) !important; */
}

/* Footer with Ancient Style */
.footer-ancient {
    background: transparent !important;
    color: #F5F5DC !important;
    border-top: 3px solid rgba(218, 165, 32, 0.6) !important;
    box-shadow: 0 -4px 15px rgba(25, 25, 112, 0.3) !important;
}

/* Additional styling for labels and text in different sections */
.search-section-blue label,
.search-section-blue .text-gray-700 {
    color: #1F2937 !important;
    font-weight: 600 !important;
}

.search-section-dark label,
.search-section-dark .text-gray-700,
.search-section-dark .text-gray-600 {
    color: #F5F5DC !important;
    font-weight: 600 !important;
}

.search-section-parchment label,
.search-section-parchment .text-gray-700,
.search-section-parchment .text-gray-600 {
    color: #2D2D2D !important;
    font-weight: 600 !important;
}

/* Input fields styling for different sections */
.search-section-blue input,
.search-section-blue select {
    background: rgba(245, 245, 220, 0.95) !important;
    border: 2px solid rgba(218, 165, 32, 0.5) !important;
    color: #2D2D2D !important;
}

.search-section-blue input:focus,
.search-section-blue select:focus {
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.6) !important;
    border-color: #DAA520 !important;
}

.search-section-dark input,
.search-section-dark select {
    background: rgba(245, 245, 220, 0.9) !important;
    border: 2px solid rgba(218, 165, 32, 0.4) !important;
    color: #2D2D2D !important;
}

.search-section-dark input:focus,
.search-section-dark select:focus {
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.6) !important;
    border-color: #DAA520 !important;
}

.search-section-parchment input,
.search-section-parchment select {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(218, 165, 32, 0.4) !important;
    color: #2D2D2D !important;
}

.search-section-parchment input:focus,
.search-section-parchment select:focus {
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.5) !important;
    border-color: #DAA520 !important;
}


/* Ensure content stays above the background */
.container {
    position: relative;
    z-index: 5;
}

/* Improve text readability */
.content-overlay,
.result-card,
.header-mystical,
.footer-ancient,
.search-section-blue,
.search-section-dark,
.search-section-parchment {
    position: relative;
    z-index: 10;
}

/* Responsive adjustments for background book section */
@media (max-width: 768px) {
    .background-book-section {
        height: 250px;
        margin-top: 40px;
    }

    .hebrew-letter {
        font-size: 16px !important;
    }

    .content-overlay {
        margin: 10px;
        padding: 15px !important;
    }
}

/* Enhanc
ed Button Glowing Effects */
button:hover {
    box-shadow:
        0 6px 20px rgba(218, 165, 32, 0.5),
        0 0 15px rgba(218, 165, 32, 0.3),
        inset 0 1px 3px rgba(255, 255, 255, 0.2) !important;
}

/* Search Type Buttons Enhanced Styling - Hebrew Buttons */
.search-type-btn,
button[x-bind\:class] {
    background: #1e3a5f !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
    text-shadow: none !important;
}

.search-type-btn:hover,
.search-type-btn.active,
button[x-bind\:class]:hover {
    background: #152b47 !important;
    border-color: #1e3a5f !important;
    color: #f4e8d0 !important;
    box-shadow: 0 6px 20px rgba(21, 43, 71, 0.4) !important;
    transform: scale(1.05) !important;
}

/* Override Alpine.js dynamic classes for search type buttons */
button[x-bind\:class][class*="px-6 py-3 rounded-xl"] {
    background: #1e3a5f !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
}

button[x-bind\:class][class*="px-6 py-3 rounded-xl"]:hover {
    background: #152b47 !important;
    color: #f4e8d0 !important;
    border-color: #1e3a5f !important;
}

/* Active state overrides for Alpine.js buttons */
button[x-bind\:class][class*="px-6 py-3 rounded-xl"][class*="bg-gradient-to-r"] {
    background: #152b47 !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
    box-shadow: 0 6px 20px rgba(21, 43, 71, 0.4) !important;
    transform: scale(1.05) !important;
}

/* Main Search Button Enhanced */
.main-search-btn {
    background: linear-gradient(45deg, #DAA520, #B8860B) !important;
    color: #2D2D2D !important;
    border: 2px solid rgba(25, 25, 112, 0.3) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) !important;
}

.main-search-btn:hover {
    background: linear-gradient(45deg, #FFD700, #DAA520) !important;
    border-color: rgba(25, 25, 112, 0.6) !important;
    box-shadow:
        0 6px 20px rgba(218, 165, 32, 0.5),
        0 0 15px rgba(218, 165, 32, 0.3) !important;
}

/* Result Card Chapter/Mishna Header */
.chapter-mishna-header {
    background: linear-gradient(45deg, #DAA520, #B8860B) !important;
    color: #2D2D2D !important;
    border: 2px solid rgba(218, 165, 32, 0.4) !important;
}

/* Decorative Lines and Dividers */
.gold-divider {
    background: linear-gradient(45deg, #DAA520, #FFD700, #B8860B) !important;
}

/* Enhanced Text Shadows for Better Readability */
.manuscript-text {
    text-shadow: 0 1px 3px rgba(139, 69, 19, 0.3);
}

.gold-text {
    color: #DAA520 !important;
    text-shadow: 0 2px 6px rgba(25, 25, 112, 0.4) !important;
}

.parchment-text {
    color: #2D2D2D !important;
}

.deep-blue-text {
    color: #191970 !important;
    text-shadow: 0 1px 3px rgba(218, 165, 32, 0.3) !important;
}

/* Subtle Animation for Hebrew Letters */
@keyframes float-letter {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    5% {
        opacity: 0.6;
    }

    95% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-50px) rotate(15deg);
        opacity: 0;
    }
}

/* Enhanced Twinkle Animation */
@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.6;
    }
}



/* Additional parchment texture for body */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(218, 165, 32, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 69, 19, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 2;
}

/* Ensure all content is above the texture */
.container,
.content-overlay,
.result-card,
.header-mystical,
.footer-ancient,
.search-section-blue,
.search-section-dark,
.search-section-parchment {
    position: relative;
    z-index: 10;
}

/* Over
ride text colors for better readability on book background */
body {
    color: #F5F5DC !important;
}

/* Ensure content sections have proper backgrounds for readability */
.content-overlay,
.result-card,
.search-section-blue,
.search-section-dark,
.search-section-parchment {
    backdrop-filter: blur(10px);
}

/* Make sure all text in content areas is readable */
.content-overlay *,
.result-card *,
.search-section-parchment * {
    color: #2D2D2D !important;
}

.search-section-blue * {
    color: #1F2937 !important;
}

.search-section-dark * {
    color: #F5F5DC !important;
}

/* Header text styling */
.header-mystical * {
    color: #F5F5DC !important;
}

/* Footer text styling */
.footer-ancient * {
    color: #F5F5DC !important;
}

/* Re
sponsive background adjustments */
@media (max-width: 768px) {
    body {
        background: #001D29 !important;
    }
}

/* Ensure Hebrew letters are visible on the new background */
.hebrew-letter {
    z-index: 3;
}



/*
 Enhanced styling for dark background #001D29 */
body {
    background-color: #001D29 !important;
}

/* Improve contrast for better readability */
.content-overlay {
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 30%,
            rgba(255, 248, 235, 0.4) 70%,
            rgba(245, 235, 215, 0.4) 100%) !important;
    box-shadow:
        0 8px 32px rgba(0, 29, 41, 0.6),
        inset 0 2px 8px rgba(218, 165, 32, 0.1),
        0 0 20px rgba(218, 165, 32, 0.2) !important;
}

/* Enhanced footer styling */
.footer-ancient {
    background: transparent !important;
    box-shadow: 0 -4px 20px rgba(0, 29, 41, 0.6) !important;
}

/* Make Hebrew letters more visible on dark background */
.hebrew-letter {
    opacity: 0.8;
}

.hebrew-letter:nth-child(odd) {
    color: rgba(218, 165, 32, 0.6);
    text-shadow:
        0 0 6px rgba(218, 165, 32, 0.8),
        0 0 12px rgba(218, 165, 32, 0.4);
}

/* Enhanced Typography */
body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif !important;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* Modern Card Design */
.content-overlay {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 20px 40px rgba(0, 29, 41, 0.15),
        0 8px 16px rgba(0, 29, 41, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    border-radius: 24px !important;
    padding: 1.25rem !important;
}

/* Enhanced Header */
.header-mystical {
    background: transparent !important;
    /* backdrop-filter: blur(20px) saturate(180%) !important; */
    border: none !important;
    /* border-bottom: 1px solid rgba(218, 165, 32, 0.3) !important; */
    /* box-shadow: 0 8px 32px rgba(0, 29, 41, 0.3) !important; */
}

/* Modern Search Type Buttons - Updated with Navy Style */
.search-type-btn,
button[x-bind\:style] {
    background: #1e3a5f !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
    border-radius: 16px !important;
    padding: 1rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
        0 4px 12px rgba(21, 43, 71, 0.3),
        inset 0 1px 0 rgba(244, 232, 208, 0.2) !important;
}

button[x-bind\:style]:hover {
    background: #152b47 !important;
    color: #f4e8d0 !important;
    transform: translateY(-2px) !important;
    box-shadow:
        0 8px 24px rgba(21, 43, 71, 0.4),
        0 4px 12px rgba(21, 43, 71, 0.3),
        inset 0 1px 0 rgba(244, 232, 208, 0.3) !important;
}

.search-section-blue {
    background: linear-gradient(135deg,
            rgba(25, 25, 112, 0.06) 0%,
            rgba(72, 61, 139, 0.06) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(218, 165, 32, 0.2) !important;
    border-radius: 20px !important;
    padding: 1rem !important;
    max-width: 450px !important;
    margin: 0 auto 1.5rem auto !important;
    box-shadow:
        0 8px 24px rgba(25, 25, 112, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.search-section-parchment {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(218, 165, 32, 0.2) !important;
    border-radius: 20px !important;
    padding: 1rem !important;
    max-width: 450px !important;
    margin: 0 auto 1.5rem auto !important;
    box-shadow:
        0 8px 24px rgba(139, 69, 19, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.search-section-dark {
    background: linear-gradient(135deg,
            rgba(45, 45, 45, 0.4) 0%,
            rgba(60, 60, 60, 0.4) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(218, 165, 32, 0.3) !important;
    border-radius: 20px !important;
    padding: 1rem !important;
    box-shadow:
        0 8px 24px rgba(45, 45, 45, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Modern Form Inputs */
input,
select {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(218, 165, 32, 0.3) !important;
    border-radius: 8px !important;
    padding: 6px 8px !important;
    font-size: 0.95em !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    height: auto !important;
    min-height: 36px !important;
}

input:focus,
select:focus {
    border-color: #DAA520 !important;
    box-shadow:
        0 0 0 3px rgba(218, 165, 32, 0.1),
        0 4px 12px rgba(218, 165, 32, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    outline: none !important;
    transform: translateY(-1px) !important;
}

/* Enhanced Result Cards */
.result-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(218, 165, 32, 0.2) !important;
    border-radius: 20px !important;
    box-shadow:
        0 12px 32px rgba(139, 69, 19, 0.1),
        0 4px 12px rgba(139, 69, 19, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.result-card:hover {
    transform: translateY(-4px) !important;
    box-shadow:
        0 20px 40px rgba(139, 69, 19, 0.15),
        0 8px 16px rgba(139, 69, 19, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

/* Modern Chapter/Mishna Header */
.chapter-mishna-header {
    background: linear-gradient(135deg, #DAA520 0%, #B8860B 100%) !important;
    border: 1px solid rgba(218, 165, 32, 0.3) !important;
    border-radius: 16px !important;
    box-shadow:
        0 4px 12px rgba(218, 165, 32, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Enhanced Footer */
.footer-ancient {
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border-top: 1px solid rgba(218, 165, 32, 0.3) !important;
    box-shadow: 0 -8px 32px rgba(25, 25, 112, 0.2) !important;
}

/* Modern Tag Buttons */
.tag-button {
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.tag-button:hover {
    transform: translateY(-1px) !important;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}



/* Improved Spacing and Layout */
.container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

@media (min-width: 768px) {
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .content-overlay {
        padding: 1.5rem !important;
    }
}

/* Enhanced Logo Animation */
.logo-animate {
    filter: drop-shadow(0 8px 16px rgba(218, 165, 32, 0.3));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-animate:hover {
    filter: drop-shadow(0 12px 24px rgba(218, 165, 32, 0.4));
    transform: scale(1.05) translateY(-4px);
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 29, 41, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #DAA520, #B8860B);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #FFD700, #DAA520);
}

/* Smooth Transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Enhanced Focus States */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #DAA520 !important;
    outline-offset: 2px !important;
}

/* Compact Chapter and Mishna Dropdowns */
.dropdown-compact {
    padding: 6px 8px !important;
    font-size: 1em !important;
    height: 36px !important;
    min-height: 36px !important;
    width: 100% !important;
    max-width: 150px !important;
    min-width: 120px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(218, 165, 32, 0.3) !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    cursor: pointer !important;
}

.dropdown-compact:focus {
    border-color: #DAA520 !important;
    box-shadow: 0 0 8px rgba(218, 165, 32, 0.4) !important;
    outline: none !important;
    transform: translateY(-1px) !important;
}

.dropdown-compact:hover {
    border-color: rgba(218, 165, 32, 0.5) !important;
    box-shadow: 0 2px 4px rgba(218, 165, 32, 0.2) !important;
}

/* Labels for compact dropdowns */
.dropdown-compact+label,
label+.dropdown-compact {
    font-weight: 600 !important;
    color: #1F2937 !important;
    font-size: 0.9em !important;
    margin-bottom: 0.5rem !important;
}

/* Container for centered dropdowns */
.search-section-blue .flex {
    align-items: center !important;
    justify-content: center !important;
}

/* Individual dropdown containers */
.search-section-blue .flex>div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    flex: 1 !important;
    max-width: 140px !important;
    width: 100% !important;
}

/* Ensure proper spacing and alignment */
.search-section-blue label {
    white-space: nowrap !important;
    margin-bottom: 0.5rem !important;
}

/* Dropdowns inside search-section-blue with max width */
.search-section-blue #chapter,
.search-section-blue #mishna {
    padding: 6px 8px !important;
    font-size: 1em !important;
    height: 36px !important;
    min-height: 36px !important;
    width: 100% !important;
    max-width: 140px !important;
    min-width: 120px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(218, 165, 32, 0.3) !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    cursor: pointer !important;
}

/* Responsive adjustments for dropdowns */
@media (max-width: 640px) {

    .search-section-blue #chapter,
    .search-section-blue #mishna {
        width: 100% !important;
        max-width: 130px !important;
        min-width: 110px !important;
        font-size: 0.95em !important;
    }

    .search-section-blue .flex>div {
        max-width: 130px !important;
    }

    /* Stack vertically on mobile */
    .search-section-blue .flex.sm\\:flex-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Adjust width for mobile */
    .search-section-blue {
        max-width: 320px !important;
        margin: 0 auto 1rem auto !important;
    }
}

/* ====
= MODERN ANIMATIONS & MICRO-INTERACTIONS ===== */

/* Smooth page entrance animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-overlay {
    animation: fadeInUp 0.8s ease-out;
}

.header-mystical {
    animation: fadeInUp 0.6s ease-out;
}

/* Enhanced button hover effects */
.main-search-btn:hover {
    background: linear-gradient(135deg, #FFD700, #DAA520) !important;
    box-shadow:
        0 12px 32px rgba(218, 165, 32, 0.4),
        0 4px 16px rgba(218, 165, 32, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-3px) scale(1.02) !important;
}

/* Improved tag category cards */
.tag-category-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.tag-category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Enhanced form field focus animations */
input:focus,
select:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1.01);
        box-shadow:
            0 0 0 3px rgba(218, 165, 32, 0.1),
            0 4px 12px rgba(218, 165, 32, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
}

/* Loading state for search button */
.main-search-btn:active {
    transform: translateY(-1px) scale(0.98) !important;
    transition: all 0.1s ease-out !important;
}

/* Enhanced Hebrew letters animation */
.hebrew-letter {
    animation: float-letter 20s linear infinite;
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.6;
}

/* Improved responsive design */
@media (max-width: 640px) {
    .content-overlay {
        padding: 1rem !important;
        margin: 0.75rem !important;
        border-radius: 20px !important;
    }

    .main-search-btn {
        padding: 1rem 2rem !important;
        font-size: 1.1rem !important;
    }

    .search-section-blue,
    .search-section-parchment,
    .search-section-dark {
        padding: 0.75rem !important;
        border-radius: 16px !important;
    }

    #chapter,
    #mishna {
        max-width: 100% !important;
        font-size: 0.9em !important;
    }
}

/* כפתור חיפוש בעיצוב כחול עז-בהיר מודרני */
.search-button-sand-gold {
    background: linear-gradient(135deg, #2876DF 0%, #1E5FBF 100%) !important;
    /* כחול עז-בהיר עם גרדיאנט עדין */
    color: #f4e8d0 !important;
    /* טקסט בגוון קרם חם */
    border: none !important;
    /* ללא גבול */
    border-radius: 12px !important;
    /* פינות מעט מעוגלות */
    padding: 16px 32px !important;
    /* Padding נדיב */
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif !important;
    /* גופן קריא מודרני */
    font-weight: 700 !important;
    /* Bold */
    font-size: 1.125rem !important;
    /* 18px */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    /* אנימציה קלה */
    box-shadow:
        0 4px 12px rgba(40, 118, 223, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    /* הצללה פנימית קלה */
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    outline: none !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 140px !important;
    /* בולטות גבוהה אך מינימליסטית */
}

.search-button-sand-gold:hover {
    background: linear-gradient(135deg, #49BFFC 0%, #2876DF 100%) !important;
    /* תכלת אינטראקטיבי */
    color: #f4e8d0 !important;
    /* border-color removed */
    transform: translateY(-3px) scale(1.02) !important;
    /* אנימציה קלה בעת hover */
    box-shadow:
        0 8px 24px rgba(73, 191, 252, 0.4),
        0 4px 12px rgba(40, 118, 223, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    /* הצללה מוגברת */
}

.search-button-sand-gold:focus {
    outline: 3px solid rgba(73, 191, 252, 0.5) !important;
    outline-offset: 2px !important;
    box-shadow:
        0 0 0 4px rgba(73, 191, 252, 0.2),
        0 4px 12px rgba(40, 118, 223, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.search-button-sand-gold:active {
    transform: translateY(-1px) scale(0.98) !important;
    /* אנימציה קלה בעת click */
    transition: all 0.1s ease-out !important;
    background: linear-gradient(135deg, #1E5FBF 0%, #193A71 100%) !important;
    box-shadow:
        0 2px 8px rgba(40, 118, 223, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* נגישות גבוהה - קונטרסט */
@media (prefers-contrast: high) {
    .search-button-sand-gold {
        background: #1E5FBF !important;
        border: none !important;
        /* ללא גבול לקונטרסט גבוה */
        color: #f4e8d0 !important;
        box-shadow: none !important;
    }

    .search-button-sand-gold:hover {
        background: #193A71 !important;
        /* border-color removed */
    }
}

/* סגנון מיוחד לאייקון החיפוש בתוך הכפתור */
.search-button-sand-gold svg {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)) !important;
}

.search-button-sand-gold:hover svg {
    transform: scale(1.1) rotate(5deg) !important;
    /* אנימציה קלה לאייקון */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

.search-button-sand-gold:active svg {
    transform: scale(0.95) !important;
}

/* אפקט ריפל עדין לכפתור החיפוש */
.search-button-sand-gold::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-button-sand-gold:active::before {
    width: 300px;
    height: 300px;
}

/* הבטחה שהטקסט והאייקון יישארו מעל האפקט */
.search-button-sand-gold svg,
.search-button-sand-gold span {
    position: relative;
    z-index: 1;
}

/* Enhanced accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Keep current design as it's already dark-themed */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .content-overlay {
        border: 2px solid #DAA520 !important;
    }

    input,
    select {
        border: 2px solid #DAA520 !important;
    }

    button {
        border: 2px solid #2D2D2D !important;
    }
}

/* Print styles */
@media print {

    .hebrew-letters,
    .footer-ancient {
        display: none !important;
    }

    .content-overlay {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* En
hanced background overlay for better readability */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 29, 41, 0.2) 70%, rgba(0, 29, 41, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Ensure header and footer have proper backgrounds */

.footer-ancient {
    position: relative;
    z-index: 20;
    backdrop-filter: blur(10px);
}

/* Enhanced content readability on book background */
.content-overlay {
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 30%,
            rgba(255, 248, 235, 0.4) 70%,
            rgba(245, 235, 215, 0.4) 100%) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    box-shadow:
        0 8px 32px rgba(0, 29, 41, 0.3),
        inset 0 2px 8px rgba(218, 165, 32, 0.1),
        0 0 20px rgba(218, 165, 32, 0.2) !important;
}

/* Enhanced result cards on book background */
.result-card {
    background: linear-gradient(135deg,
            rgba(237, 230, 217, 0.4) 0%,
            rgba(250, 240, 220, 0.4) 30%,
            rgba(255, 248, 235, 0.4) 70%,
            rgba(245, 235, 215, 0.4) 100%) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    box-shadow:
        0 12px 32px rgba(0, 29, 41, 0.3),
        inset 0 2px 6px rgba(218, 165, 32, 0.15),
        0 0 15px rgba(218, 165, 32, 0.2) !important;
}

/* Custom gold gradient border for result cards */
.gold-gradient-border {
    border-right: none !important;
    position: relative;
}

.gold-gradient-border::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(45deg, #DAA520, #B8860B) !important;
    border-radius: 0 12px 12px 0;
    z-index: 1;
}

/* Responsive background adjustments */
@media (max-width: 768px) {
    body {
        background:
            linear-gradient(135deg,
                rgba(0, 29, 41, 0.85) 0%,
                rgba(25, 25, 112, 0.7) 30%,
                rgba(218, 165, 32, 0.5) 50%,
                rgba(25, 25, 112, 0.7) 70%,
                rgba(0, 29, 41, 0.85) 100%),
            url('/static/pics/background_book.png') center center/cover no-repeat !important;
        background-attachment: scroll !important;
    }
}

/* En
hanced result card text readability */
.result-card * {
    opacity: 1 !important;
}

.result-card .text-lg,
.result-card .text-sm,
.result-card .font-bold,
.result-card p,
.result-card span {
    color: #2D2D2D !important;
    opacity: 1 !important;
}

/* Compact footer styling */
.footer-ancient {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

.footer-ancient h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.25rem !important;
}

.footer-ancient p {
    font-size: 0.875rem !important;
    margin-bottom: 1rem !important;
}

.footer-ancient .bg-gray-700 {
    padding: 1rem !important;
    border-radius: 0.75rem !important;
}

.footer-ancient .w-20 {
    width: 5rem !important;
    height: 0.25rem !important;
}

/* Ensure all text in Main Search Container is dark and readable */
.content-overlay {
    color: #2D2D2D !important;
}

.content-overlay h1,
.content-overlay h2,
.content-overlay h3,
.content-overlay h4,
.content-overlay h5,
.content-overlay h6 {
    color: #1F2937 !important;
}

.content-overlay p,
.content-overlay span,
.content-overlay div,
.content-overlay label {
    color: #2D2D2D !important;
}

/* Override any white text in buttons when not active */
.content-overlay button:not(.bg-gradient-to-r) {
    color: #374151 !important;
}

/* Ensure form labels are dark */
.content-overlay .text-gray-700,
.content-overlay .text-gray-600,
.content-overlay .text-gray-800 {
    color: #1F2937 !important;
}

/* Make sure search type buttons have proper contrast */
.content-overlay button.bg-gray-100 {
    color: #374151 !important;
}

.content-overlay button.text-gray-600 {
    color: #374151 !important;
}

/* Ensure input placeholders are readable */
.content-overlay input::placeholder,
.content-overlay textarea::placeholder {
    color: #6B7280 !important;
}

/* Override any potential white text from Tailwind classes */
.content-overlay .text-white:not(.bg-gradient-to-r) {
    color: #1F2937 !important;
}

/* Specific styling for the main heading */
.content-overlay h3 span {
    /* Keep the gradient text as is - it's already styled with gradient */
    display: inline-block;
}

/* Ensure SVG icons in content are visible */
.content-overlay svg {
    color: #374151 !important;
}

/* Override any light colored text */
.content-overlay .text-gray-100,
.content-overlay .text-gray-200,
.content-overlay .text-gray-300 {
    color: #374151 !important;
}

/* 
Fix tag category display in search section */
.search-section-dark .bg-white {
    background-color: white !important;
    color: #1F2937 !important;
}

.search-section-dark .text-gray-800 {
    color: #1F2937 !important;
}

.search-section-dark .text-lg {
    color: #1F2937 !important;
}

.search-section-dark .font-bold {
    color: #1F2937 !important;
}

/* Ensure tag category cards are visible */
.search-section-dark .bg-white.p-6 {
    background: white !important;
    border: 1px solid rgba(218, 165, 32, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.search-section-dark .bg-white.p-6 * {
    color: #1F2937 !important;
}

/* Tag buttons styling */
.search-section-dark button[x-text] {
    color: #374151 !important;
}

.search-section-dark .text-purple-600 {
    color: #7C3AED !important;
}

.search-section-dark .hover\:text-purple-800:hover {
    color: #5B21B6 !important;
}

/* Override the broad content-overlay rules for tag categories */
.content-overlay .search-section-dark .bg-white * {
    color: #1F2937 !important;
}

.content-overlay .search-section-dark .bg-white h4 {
    color: #1F2937 !important;
}

.content-overlay .search-section-dark .bg-white button {
    color: #374151 !important;
}

/* Deb
ug and ensure tag categories are always visible */
.search-section-dark .grid {
    display: grid !important;
}

.search-section-dark .grid>div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Make sure the category cards have proper styling */
.search-section-dark .bg-white.p-6.rounded-xl {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(218, 165, 32, 0.3) !important;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px) !important;
}

.search-section-dark .bg-white.p-6.rounded-xl:hover {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Ensure category headers are visible */
.search-section-dark .bg-white h4 {
    color: #1F2937 !important;
    font-weight: bold !important;
}

/* Ensure tag buttons are visible and clickable */
.search-section-dark .bg-white button {
    color: #374151 !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.search-section-dark .bg-white button:hover {
    background-color: rgba(255, 255, 255, 1) !important;
    transform: scale(1.05) !important;
}

/* Make sure the "show more" buttons are visible */
.search-section-dark .text-purple-600 {
    color: #8B5CF6 !important;
    font-weight: 500 !important;
}

.search-section-dark .text-purple-600:hover {
    color: #7C3AED !important;
    text-decoration: underline !important;
}

/* Fa
llback to ensure tag categories are always visible */
.search-section-dark [x-for] {
    display: block !important;
}

.search-section-dark template {
    display: contents !important;
}

/* Force visibility of Alpine.js generated content */
.search-section-dark [x-show] {
    display: block !important;
}

/* Ensure the grid container is visible */
.search-section-dark .grid.grid-cols-1 {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

@media (min-width: 768px) {
    .search-section-dark .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    .search-section-dark .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Make sure Alpine.js cloak doesn't hide content permanently */
[x-cloak] {
    display: none !important;
}

.search-section-dark:not([x-cloak]) {
    display: block !important;
}

/* Additional debugging styles */
.search-section-dark .bg-white {
    min-height: 100px !important;
    border: 2px solid #DAA520 !important;
}

/* Tag selection buttons in index page */
.search-section-dark .tag-button {
    transition: all 0.3s ease !important;
}

/* Fix for tag buttons in manage_mishnas.html - ensure black text is visible */
.bg-gray-50 button.text-black,
button.text-black {
    color: #000000 !important;
}

.search-section-dark .tag-button:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.search-section-dark .tag-button.ring-2 {
    box-shadow: 0 0 0 2px #A855F7 !important;
}

/* Ensure tag category cards are properly styled */
.search-section-dark .bg-white.p-6 {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1F2937 !important;
}

.search-section-dark .bg-white h4 {
    color: #1F2937 !important;
}

.search-section-dark .text-gray-800 {
    color: #1F2937 !important;
}

/* ==
=== SPECIFIC OVERRIDES FOR HEBREW SEARCH TYPE BUTTONS ===== */

/* Target the specific Hebrew buttons by their content and structure */
button[class*="px-6 py-3 rounded-xl"]:contains("פרק ומשנה"),
button[class*="px-6 py-3 rounded-xl"]:contains("טקסט חופשי"),
button[class*="px-6 py-3 rounded-xl"]:contains("נושא") {
    background: #f4e8d0 !important;
    color: #1e3a5f !important;
    border: 2px solid #1e3a5f !important;
}

/* Search type buttons - use specific class */

/* Override all possible Alpine.js generated classes */
button[class*="bg-gradient-to-r from-blue-500"],
button[class*="bg-gradient-to-r from-green-500"],
button[class*="bg-gradient-to-r from-purple-500"],
button[class*="bg-gray-100"] {
    background: #1e3a5f !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
}

/* Active/selected state for Hebrew buttons */
button[class*="shadow-lg transform scale-105"] {
    background: #152b47 !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
    box-shadow: 0 6px 20px rgba(21, 43, 71, 0.4) !important;
}

/* Removed broad button selectors - use specific classes instead */

/* Ultimate override for any button in the search type section */
div:has(button:contains("פרק ומשנה")) button,
div:has(button:contains("טקסט חופשי")) button,
div:has(button:contains("נושא")) button {
    background: #f4e8d0 !important;
    color: #1e3a5f !important;
    border: 2px solid #1e3a5f !important;
}

div:has(button:contains("פרק ומשנה")) button:hover,
div:has(button:contains("טקסט חופשי")) button:hover,
div:has(button:contains("נושא")) button:hover {
    background: #e8d9bd !important;
    color: #1e3a5f !important;
    border-color: #1e3a5f !important;
}

/* 
===== RELIABLE OVERRIDES FOR SEARCH TYPE BUTTONS ===== */

/* Target buttons in the search type selection area with maximum specificity */
/* Removed broad button selectors - use specific classes instead */

/* Removed broad button selectors - use specific classes instead */

/* Removed broad button selectors - use specific classes instead */

button[class*="bg-"]:hover {
    background: #152b47 !important;
}

/* Text color override for all buttons */
button[class*="text-"] {
    color: #f4e8d0 !important;
}

/* ===== S
PECIFIC STYLING FOR ONLY THE 3 SEARCH OPTION BUTTONS ===== */

/* Category Tag Buttons - High specificity to override other button styles */
.content-overlay .category-tag-btn,
button.category-tag-btn {
    padding: 0.75rem 1rem !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: white !important;
    border: 2px solid transparent !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    text-shadow: none !important;
}

.content-overlay .category-tag-btn:hover,
button.category-tag-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    color: white !important;
}

.content-overlay .category-tag-btn.selected,
button.category-tag-btn.selected {
    outline: 2px solid #191970 !important;
    font-weight: 600 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 0 2px white, 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* FORCE OVERRIDE for category tag buttons - highest specificity */
.content-overlay div[class*="grid"] button.category-tag-btn,
.content-overlay div[x-data] div[class*="grid"] button.category-tag-btn,
button[type="button"].category-tag-btn {
    background: inherit !important;
    color: white !important;
    border: 2px solid transparent !important;
    text-shadow: none !important;
    font-weight: 500 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
}

.content-overlay div[class*="grid"] button.category-tag-btn:hover,
.content-overlay div[x-data] div[class*="grid"] button.category-tag-btn:hover,
button[type="button"].category-tag-btn:hover {
    background: inherit !important;
    color: white !important;
    border: 2px solid transparent !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.content-overlay div[class*="grid"] button.category-tag-btn.selected,
.content-overlay div[x-data] div[class*="grid"] button.category-tag-btn.selected,
button[type="button"].category-tag-btn.selected {
    background: inherit !important;
    color: white !important;
    border: 2px solid white !important;
    font-weight: 600 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 0 2px white, 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* 
Search Type Button - specific class for search option buttons */
.search-type-button,
button.search-type-button,
.content-overlay .search-type-button {
    background: #1e3a5f !important;
    color: #f4e8d0 !important;
    border: 2px solid #1e3a5f !important;
    border-radius: 16px !important;
    padding: 1rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: none !important;
    box-shadow: 0 4px 12px rgba(21, 43, 71, 0.3), inset 0 1px 0 rgba(244, 232, 208, 0.2) !important;
}

.search-type-button:hover,
button.search-type-button:hover,
.content-overlay .search-type-button:hover {
    background: #152b47 !important;
    color: #f4e8d0 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(21, 43, 71, 0.4), 0 4px 12px rgba(21, 43, 71, 0.3), inset 0 1px 0 rgba(244, 232, 208, 0.3) !important;
}

.search-type-button.active,
button.search-type-button.active,
.content-overlay .search-type-button.active {
    background: #152b47 !important;
    color: #f4e8d0 !important;
    border-color: #1e3a5f !important;
    box-shadow: 0 6px 20px rgba(21, 43, 71, 0.4) !important;
    transform: scale(1.05) !important;
}

/* Icon 
styling for search-type-button */
.search-type-button svg,
button.search-type-button svg,
.content-overlay .search-type-button svg {
    color: #f4e8d0 !important;
    stroke: #f4e8d0 !important;
}

.search-type-button:hover svg,
button.search-type-button:hover svg,
.content-overlay .search-type-button:hover svg {
    color: #f4e8d0 !important;
    stroke: #f4e8d0 !important;
}

.search-type-button.active svg,
button.search-type-button.active svg,
.content-overlay .search-type-button.active svg {
    color: #f4e8d0 !important;
    stroke: #f4e8d0 !important;
}

/* For
ce text color for search-type-button - highest specificity */
.content-overlay button[type="button"].search-type-button,
.content-overlay .search-type-button,
button.search-type-button {
    color: #f4e8d0 !important;
}

.content-overlay button[type="button"].search-type-button:hover,
.content-overlay .search-type-button:hover,
button.search-type-button:hover {
    color: #f4e8d0 !important;
}

.content-overlay button[type="button"].search-type-button.active,
.content-overlay .search-type-button.active,
button.search-type-button.active {
    color: #f4e8d0 !important;
}
/* =
==== FLOATING BACK TO SEARCH BUTTON ===== */
#backToSearchBtn {
    background: linear-gradient(135deg, #2876DF 0%, #1E5FBF 100%) !important;
    color: #f4e8d0 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 56px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 
        0 8px 24px rgba(40, 118, 223, 0.3),
        0 4px 12px rgba(40, 118, 223, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    backdrop-filter: blur(10px) !important;
}

#backToSearchBtn:hover {
    background: linear-gradient(135deg, #49BFFC 0%, #2876DF 100%) !important;
    transform: scale(1.1) translateY(-2px) !important;
    box-shadow: 
        0 12px 32px rgba(73, 191, 252, 0.4),
        0 6px 16px rgba(40, 118, 223, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

#backToSearchBtn:active {
    transform: scale(1.05) translateY(-1px) !important;
    transition: all 0.1s ease-out !important;
}

#backToSearchBtn svg {
    color: #f4e8d0 !important;
    stroke: #f4e8d0 !important;
    transition: all 0.3s ease !important;
}

#backToSearchBtn:hover svg {
    transform: translateY(-1px) !important;
}

/* Responsive adjustments for floating button */
@media (max-width: 768px) {
    #backToSearchBtn {
        bottom: 1rem !important;
        left: 1rem !important;
        width: 48px !important;
        height: 48px !important;
    }
    
    #backToSearchBtn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Ensure button is visible above all content */
#backToSearchBtn {
    position: fixed !important;
    z-index: 9999 !important;
}

/* Animation for button appearance */
#backToSearchBtn.opacity-100 {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth transition for button disappearance */
#backToSearchBtn.opacity-0 {
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out !important;
}/* =====
 FLOATING BACK TO SEARCH BUTTON ===== */
#backToSearchBtn {
    background: linear-gradient(135deg, #2876DF 0%, #1E5FBF 100%) !important;
    color: #f4e8d0 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 56px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 
        0 8px 24px rgba(40, 118, 223, 0.3),
        0 4px 12px rgba(40, 118, 223, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    position: fixed !important;
    bottom: 1.5rem !important;
    left: 1.5rem !important;
    backdrop-filter: blur(10px) !important;
}

#backToSearchBtn:hover {
    background: linear-gradient(135deg, #49BFFC 0%, #2876DF 100%) !important;
    transform: scale(1.1) translateY(-2px) !important;
    box-shadow: 
        0 12px 32px rgba(73, 191, 252, 0.4),
        0 6px 16px rgba(40, 118, 223, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

#backToSearchBtn:active {
    transform: scale(1.05) translateY(-1px) !important;
    transition: all 0.1s ease-out !important;
}

#backToSearchBtn svg {
    color: #f4e8d0 !important;
    stroke: #f4e8d0 !important;
    transition: all 0.3s ease !important;
}

#backToSearchBtn:hover svg {
    transform: translateY(-1px) !important;
}

/* Responsive adjustments for floating button */
@media (max-width: 768px) {
    #backToSearchBtn {
        bottom: 1rem !important;
        left: 1rem !important;
        width: 48px !important;
        height: 48px !important;
    }
    
    #backToSearchBtn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Animation for button appearance */
#backToSearchBtn.opacity-100 {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth transition for button disappearance */
#backToSearchBtn.opacity-0 {
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out !important;
}

/* Override Tailwind classes for the button */
#backToSearchBtn.fixed {
    position: fixed !important;
}

#backToSearchBtn.z-50 {
    z-index: 9999 !important;
}

/* Make sure button is always visible when it should be */
#backToSearchBtn.visible {
    visibility: visible !important;
    opacity: 1 !important;
}

#backToSearchBtn.invisible {
    visibility: hidden !important;
    opacity: 0 !important;
}