/* Enhanced Typography and Styling for ShalomTemple */

/* Improved Font System */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    line-height: 1.6;
}

.font-heading {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif !important;
}

/* Enhanced Typography Sizes */
.text-responsive-xl {
    font-size: 3.5rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em !important;
    font-weight: 800 !important;
}

.text-responsive-lg {
    font-size: 2.75rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
    font-weight: 700 !important;
}

.text-responsive-md {
    font-size: 2.25rem !important;
    line-height: 1.3 !important;
    letter-spacing: -0.015em !important;
    font-weight: 600 !important;
}

.text-responsive-sm {
    font-size: 1.875rem !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
    font-weight: 600 !important;
}

/* Enhanced Dropdown Styles */
.dropdown-menu {
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    padding: 8px 0 !important;
    min-width: 220px !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1000 !important;
    position: absolute !important;
}

.group:hover .dropdown-menu {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure dropdown works with Tailwind classes */
.group:hover .opacity-0 {
    opacity: 1 !important;
}

.group:hover .invisible {
    visibility: visible !important;
}

.group:hover .group-hover\:opacity-100 {
    opacity: 1 !important;
}

.group:hover .group-hover\:visible {
    visibility: visible !important;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px !important;
    color: #374151 !important;
    text-decoration: none;
    font-size: 15px !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0 8px;
}

.dropdown-menu a:hover {
    background-color: #f3f4f6 !important;
    color: #1e40af !important;
    transform: translateX(4px);
}

/* Enhanced Mobile Menu Styles */
.mobile-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 8px;
}

.mobile-dropdown.active {
    max-height: 300px;
    padding: 12px 0;
}

.mobile-dropdown a {
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 500;
    color: #6b7280 !important;
    transition: all 0.2s ease;
}

.mobile-dropdown a:hover {
    color: #1e40af !important;
    background-color: #e5e7eb;
    border-radius: 6px;
    margin: 0 8px;
}

/* Documentation Page Text Visibility Fix */
.doc-content {
    color: #374151 !important;
}

.doc-content h2 {
    color: #1e40af !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    margin-top: 2rem !important;
    letter-spacing: -0.015em !important;
}

.doc-content h3 {
    color: #1e40af !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    margin-top: 1.5rem !important;
    letter-spacing: -0.01em !important;
}

.doc-content h4 {
    color: #1e40af !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    margin-top: 1rem !important;
}

.doc-content p {
    color: #4b5563 !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    margin-bottom: 1rem !important;
}

.doc-content ul, .doc-content ol {
    color: #4b5563 !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    margin-bottom: 1rem !important;
    padding-left: 1.5rem !important;
}

.doc-content li {
    margin-bottom: 0.5rem !important;
}

.doc-content code {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: 'Courier New', monospace !important;
}

.doc-content pre {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    overflow-x: auto !important;
    margin: 1rem 0 !important;
}

.doc-content pre code {
    background: none !important;
    padding: 0 !important;
    color: #1f2937 !important;
    font-size: 14px !important;
}

/* Enhanced Navigation Links */
.doc-nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    color: #6b7280 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    font-size: 15px !important;
    font-weight: 500 !important;
}

.doc-nav-link:hover {
    background-color: #f3f4f6 !important;
    color: #1e40af !important;
}

.doc-nav-link.active {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    font-weight: 600 !important;
}

.doc-nav-link i {
    width: 20px !important;
    text-align: center !important;
}

/* Enhanced Button Styles */
.btn-primary {
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    letter-spacing: 0.01em !important;
}

.btn-secondary {
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    letter-spacing: 0.01em !important;
}

.btn-outline {
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    border-width: 2px !important;
    transition: all 0.2s ease !important;
    letter-spacing: 0.01em !important;
}

/* Enhanced Card Styles */
.card {
    border-radius: 16px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
}

.card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

/* Enhanced Section Spacing */
.section-padding {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}

@media (max-width: 768px) {
    .section-padding {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

/* Enhanced Container */
.container-custom {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

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

/* Enhanced Animation Classes */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-up.animate {
    opacity: 1;
    transform: translateY(0);
}

.fade-right {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.fade-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.fade-left {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
}

.fade-left.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Documentation Sidebar Sticky Fix */
.docs-sidebar {
    position: sticky;
    top: 4rem;
    height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* Documentation Navigation Fix */
.doc-nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    color: #6b7280 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    font-size: 15px !important;
    font-weight: 500 !important;
}

.doc-nav-link:hover {
    background-color: #f3f4f6 !important;
    color: #1e40af !important;
}

.doc-nav-link.active {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    font-weight: 600 !important;
}

.doc-nav-link i {
    width: 20px !important;
    text-align: center !important;
}

/* Hero Section Enhancements */
.hero-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #6366f1 100%) !important;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Enhanced Focus States */
*:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Improved Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Sticky Header */
.header-sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background-color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.header-sticky.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.header-sticky.-translate-y-full {
    transform: translateY(-100%) !important;
}

/* Enhanced Header Responsiveness */
@media (max-width: 1024px) {
    .header-sticky nav .container-custom {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .header-sticky .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .header-sticky .text-xl {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .header-sticky .space-x-8 {
        gap: 1rem !important;
    }
    
    .header-sticky .text-lg {
        font-size: 1.125rem !important;
    }
    
    .header-sticky .hidden.sm\:block {
        display: none !important;
    }
    
    .header-sticky .w-10 {
        width: 2.5rem !important;
    }
    
    .header-sticky .h-10 {
        height: 2.5rem !important;
    }
}

/* Dynamic Image Preview */
.dynamic-preview {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.dynamic-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dynamic-preview img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dynamic-preview:hover img {
    transform: scale(1.05);
}

.dynamic-preview .preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 64, 175, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dynamic-preview:hover .preview-overlay {
    opacity: 1;
}

.dynamic-preview .preview-btn {
    background: white;
    color: #1e40af;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.dynamic-preview:hover .preview-btn {
    transform: translateY(0);
}

/* Enhanced Inner Page Card Styles */
.inner-page-card {
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}

.inner-page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.inner-page-card .relative {
    height: 12rem;
    overflow: hidden;
}

.inner-page-card img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inner-page-card:hover img {
    transform: scale(1.05);
}

.inner-page-card .absolute {
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inner-page-card:hover .absolute {
    opacity: 1;
}

.inner-page-card h3 {
    transition: color 0.2s ease;
}

.inner-page-card:hover h3 {
    color: #f59e0b;
}

/* Demo Card Enhancements */
.demo-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.demo-card .relative {
    height: 16rem;
    overflow: hidden;
}

.demo-card img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-card:hover img {
    transform: scale(1.05);
}

/* Improved RTL Support */
.rtl .space-x-3 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 0.75rem !important;
    margin-left: 0 !important;
}

.rtl .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

.rtl .space-x-8 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 2rem !important;
    margin-left: 0 !important;
}

.rtl .ml-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

.rtl .mr-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

.rtl .mr-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

.rtl .ml-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

.rtl .text-right {
    text-align: left !important;
}

.rtl .text-left {
    text-align: right !important;
}


/* Fix Horizontal Scrollbar Issues */
html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* Prevent container overflow */
.container-custom {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Fix grid overflow on mobile */
.grid {
    width: 100%;
}

/* Fix flex overflow - but allow normal flex behavior */
.flex {
    display: flex;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .section-padding {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .container-custom {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Fix text overflow */
    .text-responsive-xl {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    .text-responsive-lg {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }
    
    /* Fix button overflow and spacing */
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        max-width: 100%;
        margin-bottom: 0.75rem;
        width: 100%;
    }
    
    /* Fix flex containers on mobile */
    .flex.flex-col.sm\:flex-row,
    .flex.space-x-4 {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .flex.space-x-4 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0;
    }
    
    /* Ensure buttons don't overlap */
    .space-x-4 {
        gap: 0.75rem;
    }
    
    /* Fix image overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix card overflow */
    .card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
}

/* iPad responsive fixes */
@media (max-width: 1024px) and (min-width: 769px) {
    .container-custom {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    .section-padding {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Fix mobile menu overflow */
#mobile-menu .fixed {
    max-height: 100vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Fix newsletter modal overflow */
#newsletter-modal .modal-content {
    max-width: calc(100vw - 2rem) !important;
    max-height: calc(100vh - 2rem) !important;
    overflow-y: auto !important;
}

/* Fix form overflow */
form {
    width: 100% !important;
    overflow-x: hidden !important;
}

form input,
form textarea,
form select {
    width: 100% !important;
    max-width: 100% !important;
}

/* Fix table overflow */
table {
    width: 100% !important;
    table-layout: fixed !important;
    overflow-x: auto !important;
}

/* Fix video overflow */
video {
    max-width: 100% !important;
    height: auto !important;
}

/* Fix iframe overflow */
iframe {
    max-width: 100% !important;
    height: auto !important;
}

/* Fix pre/code overflow */
pre {
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

code {
    word-wrap: break-word !important;
    white-space: pre-wrap !important;
}

/* Header Specific Fixes */
.header-sticky {
    width: 100%;
    max-width: 100%;
}

.header-sticky nav {
    width: 100%;
    max-width: 100%;
}

.header-sticky .container-custom {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Navigation Fixes */
.header-sticky .flex {
    flex-wrap: nowrap;
    align-items: center;
}

.header-sticky .justify-between {
    justify-content: space-between;
}

/* Logo Section */
.header-sticky .flex.items-center.space-x-3 {
    flex-shrink: 0;
    min-width: 0;
}

/* Navigation Menu */
.header-sticky .hidden.lg\\:flex {
    flex-shrink: 1;
    min-width: 0;
}

/* Action Buttons */
.header-sticky .hidden.md\\:flex.items-center {
    flex-shrink: 0;
    min-width: 0;
}

/* Mobile Menu Button */
.header-sticky .lg\\:hidden {
    flex-shrink: 0;
}

/* Responsive Header Fixes */
@media (max-width: 1024px) {
    .header-sticky .container-custom {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .header-sticky .container-custom {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .header-sticky .space-x-3 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0.5rem;
    }
    
    .header-sticky .space-x-4 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0.5rem;
    }
}

/* Dropdown Menu Positioning Fix */
.relative.group {
    position: relative;
}

.relative.group .absolute {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

/* RTL Dropdown Positioning */
[dir="rtl"] .relative.group .absolute,
.rtl-mode .relative.group .absolute {
    left: auto;
    right: 0;
}

/* Ensure dropdowns don't cause overflow */
.relative.group .absolute {
    max-width: calc(100vw - 2rem);
    left: auto;
    right: auto;
    transform: translateX(-50%);
}

[dir="rtl"] .relative.group .absolute,
.rtl-mode .relative.group .absolute {
    transform: translateX(50%);
}

/* Fix for dropdown menu width class */
.dropdown-menu-width {
    min-width: 220px;
    max-width: 300px;
}

@media (max-width: 768px) {
    .dropdown-menu-width {
        min-width: 180px;
        max-width: 250px;
    }
}/* RTL
 Demo Button Enhancements */
.btn-outline.border-temple-gold-300 {
    border-color: #fbbf24 !important;
    color: #fbbf24 !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

.btn-outline.border-temple-gold-300:hover {
    background-color: #fbbf24 !important;
    color: #1e40af !important;
    border-color: #fbbf24 !important;
    font-weight: 600 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3) !important;
}

/* Header RTL Demo Button */
.bg-gray-100.hover\:bg-temple-blue-900:hover {
    background-color: #1e40af !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3) !important;
}

/* Mobile RTL Demo Button */
.bg-gray-50:hover {
    background-color: #f3f4f6 !important;
    color: #1e40af !important;
}