@font-face {
    font-family: 'Nasim';
    src: url('../fonts/Nasim.woff') format('woff');
}

@font-face {
    font-family: 'Al-Quran';
    src: url('../fonts/Al-QuranAlKareem.woff') format('woff');
}

@font-face {
    font-family: 'Kahroba';
    src: url('../fonts/kahroba.ttf') format('truetype');
}

:root {
    /* Light theme */
    --primary-light: #1C4E4C;
    --secondary-light: #D4B872;
    --background-light: #F8F6F1;
    --text-light: #2C3E50;
    --card-bg-light: #ffffff;
    --border-light: #E2D5B2;
    --header-gradient-light: linear-gradient(135deg, #1C4E4C 0%, #26797C 100%);
    --header-text-light: #ffffff;
    
    /* Dark theme */
    --primary-dark: #26797C;
    --secondary-dark: #D4B872;
    --background-dark: #1A1F2C;
    --text-dark: #E0E0E0;
    --card-bg-dark: #2C3440;
    --border-dark: #3D4654;
    --header-gradient-dark: linear-gradient(135deg, #1A1F2C 0%, #26797C 100%);
    --header-text-dark: #ffffff;
    
    /* 3D Effect Colors */
    --particle-color-light: #D4B872;
    --particle-color-dark: #D4B872;
    --glow-color-light: rgba(212, 184, 114, 0.6);
    --glow-color-dark: rgba(212, 184, 114, 0.6);
}

/* WebGL Container */
#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

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

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-light);
    border-radius: 10px;
}

.dark-theme::-webkit-scrollbar-track {
    background: var(--background-dark);
}

.dark-theme::-webkit-scrollbar-thumb {
    background: var(--secondary-dark);
}

/* Glow Text Effect */
.glow-text {
    text-shadow: 0 0 10px var(--glow-color-light), 
                 0 0 20px var(--glow-color-light),
                 0 0 30px var(--glow-color-light);
    animation: glow 3s ease-in-out infinite alternate;
}

.dark-theme .glow-text {
    text-shadow: 0 0 10px var(--glow-color-dark), 
                 0 0 20px var(--glow-color-dark),
                 0 0 30px var(--glow-color-dark);
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px var(--glow-color-light), 
                     0 0 20px var(--glow-color-light);
    }
    to {
        text-shadow: 0 0 15px var(--glow-color-light), 
                     0 0 25px var(--glow-color-light),
                     0 0 35px var(--glow-color-light);
    }
}

.dark-theme .glow-text {
    animation: glow-dark 3s ease-in-out infinite alternate;
}

@keyframes glow-dark {
    from {
        text-shadow: 0 0 10px var(--glow-color-dark), 
                     0 0 20px var(--glow-color-dark);
    }
    to {
        text-shadow: 0 0 15px var(--glow-color-dark), 
                     0 0 25px var(--glow-color-dark),
                     0 0 35px var(--glow-color-dark);
    }
}

/* Ziarat Quote Styles */
.ziarat-quote {
    font-family: 'Al-Quran', 'Nasim', serif;
    font-size: 1.3rem;
    line-height: 2;
    text-align: center;
    margin: 1.5rem auto;
    padding: 1rem;
    max-width: 80%;
    color: var(--header-text-light);
    opacity: 0.9;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
    direction: rtl;
    position: relative;
    overflow: hidden;
}

.ziarat-quote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(196, 169, 98, 0.05), rgba(196, 169, 98, 0.2));
    z-index: -1;
    transform: translateX(-100%);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.dark-theme .ziarat-quote::before {
    background: linear-gradient(45deg, rgba(212, 184, 114, 0.05), rgba(212, 184, 114, 0.2));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nasim', 'Kahroba', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-light);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    perspective: 1000px;
}

body.dark-theme {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

header {
    margin-bottom: 40px;
    position: relative;
    background: var(--header-gradient-light);
    padding: 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    color: var(--header-text-light);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.dark-theme header {
    background: var(--header-gradient-dark);
    color: var(--header-text-dark);
}

header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    height: 180px;
    background: var(--header-gradient-light);
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
}

header .container {
    text-align: center;
    position: relative;
    padding-top: 20px;
}

h1 {
    font-family: 'Kahroba', 'Al-Quran', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--header-text-light);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

h1:hover {
    transform: translateZ(20px);
}

.dark-theme h1 {
    color: var(--header-text-dark);
}

.subtitle {
    font-family: 'Nasim', 'Kahroba', system-ui;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    transform: translateZ(5px);
}

.container {
    max-width: 850px;
    margin: 20px auto 60px;
    background: var(--card-bg-light);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transform: translateZ(0);
    transition: transform 0.3s ease;
    background-color: rgba(255, 255, 255, 0.98);
}

.container:hover {
    transform: translateZ(5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.dark-theme .container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.search-box {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

#query-input {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background-color: var(--card-bg-light);
    color: var(--text-light);
    font-family: 'Nasim', 'Kahroba', system-ui;
    transition: all 0.3s ease;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.dark-theme #query-input {
    border-color: var(--border-dark);
    background-color: var(--card-bg-dark);
    color: var(--text-dark);
}

#query-input:focus {
    outline: none;
    border-color: var(--secondary-light);
    box-shadow: 0 0 15px rgba(196, 169, 98, 0.4);
    transform: translateZ(5px);
}

.dark-theme #query-input:focus {
    border-color: var(--secondary-dark);
    box-shadow: 0 0 15px rgba(212, 184, 114, 0.4);
}

.search-button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background-color: var(--primary-light);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nasim', 'Kahroba', system-ui;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.dark-theme .search-button {
    background-color: var(--primary-dark);
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-light);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.dark-theme .search-button::before {
    background: var(--secondary-dark);
}

.search-button:hover {
    transform: translateY(-2px);
}

.search-button:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.verse, .hadith {
    background-color: var(--card-bg-light);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    text-align: center;
    transform-style: preserve-3d;
    transform: translateZ(0);
    position: relative;
    overflow: hidden;
}

.dark-theme .verse,
.dark-theme .hadith {
    background-color: var(--card-bg-dark);
    border-color: var(--border-dark);
}

.verse:hover,
.hadith:hover {
    transform: translateZ(15px) translateY(-5px);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.2),
        0 0 20px var(--secondary-light);
}

.dark-theme .verse:hover,
.dark-theme .hadith:hover {
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 0 20px var(--secondary-dark);
}

.verse .arabic {
    font-family: 'Al-Quran', serif;
    font-size: 1.8rem;
    line-height: 2.2;
    margin: 1.2rem 0;
    text-align: center;
    color: var(--text-light);
    direction: rtl;
    transform: translateZ(10px);
    position: relative;
    letter-spacing: -0.5px;
}

.verse .arabic::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--secondary-light), transparent);
}

.dark-theme .verse .arabic {
    color: var(--text-dark);
}

.dark-theme .verse .arabic::after {
    background: linear-gradient(to right, transparent, var(--secondary-dark), transparent);
}

.verse .translation {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    direction: rtl;
    transform: translateZ(5px);
}

.verse .reference {
    color: var(--secondary-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
    transform: translateZ(8px);
    font-weight: bold;
}

.dark-theme .verse .reference {
    color: var(--secondary-dark);
}

.hadith {
    background-color: var(--card-bg-light);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    text-align: center;
    transform-style: preserve-3d;
    transform: translateZ(0);
    background-color: rgba(255, 255, 255, 0.85);
}

.dark-theme .hadith {
    background-color: rgba(44, 52, 64, 0.85);
    border-color: var(--border-dark);
}

.hadith:hover {
    transform: translateZ(10px) translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.hadith .imam-name {
    color: var(--secondary-light);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-align: center;
    transform: translateZ(5px);
}

.dark-theme .hadith .imam-name {
    color: var(--secondary-dark);
}

.hadith .text {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    margin-bottom: 1rem;
    direction: rtl;
    transform: translateZ(3px);
}

.hadith .source {
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.8;
    transform: translateZ(2px);
}

.dark-theme .hadith .source {
    color: var(--text-dark);
}

.results {
    margin-top: 40px;
    line-height: 1.8;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.results.visible {
    opacity: 1;
}

.verse, .hadith, .explanation {
    padding: 22px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Section titles */
.verse-section-title,
.hadith-section-title,
.explanation-title {
    font-family: 'Kahroba', 'Nasim', system-ui;
    font-size: 1.8rem;
    color: var(--primary-light);
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-light);
    position: relative;
    text-align: center;
    transform-style: preserve-3d;
    transform: translateZ(5px);
}

.dark-theme .verse-section-title,
.dark-theme .hadith-section-title,
.dark-theme .explanation-title {
    color: var(--primary-dark);
    border-bottom-color: var(--secondary-dark);
}

.verse-section-title::after,
.hadith-section-title::after,
.explanation-title::after {
    content: '✧';
    position: absolute;
    left: 0;
    bottom: -0.5rem;
    color: var(--secondary-light);
    font-size: 1.2rem;
    transform: translateZ(10px);
    text-shadow: 0 0 5px var(--glow-color-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translateZ(10px) scale(1); }
    50% { transform: translateZ(15px) scale(1.2); }
    100% { transform: translateZ(10px) scale(1); }
}

.dark-theme .verse-section-title::after,
.dark-theme .hadith-section-title::after,
.dark-theme .explanation-title::after {
    color: var(--secondary-dark);
    text-shadow: 0 0 5px var(--glow-color-dark);
}

.explanation {
    background-color: var(--card-bg-light);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
    text-align: justify;
    direction: rtl;
    border: 1px solid var(--border-light);
    transform-style: preserve-3d;
    transform: translateZ(0);
    background-color: rgba(255, 255, 255, 0.85);
}

.dark-theme .explanation {
    background-color: rgba(44, 52, 64, 0.85);
    border-color: var(--border-dark);
}

.explanation:hover {
    transform: translateZ(5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.explanation h3 {
    color: var(--primary-light);
    margin-bottom: 1rem;
    transform: translateZ(8px);
}

.dark-theme .explanation h3 {
    color: var(--primary-dark);
}

.explanation blockquote {
    border-right: 4px solid var(--secondary-light);
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background-color: rgba(196, 169, 98, 0.1);
    transform: translateZ(3px);
}

.dark-theme .explanation blockquote {
    border-right-color: var(--secondary-dark);
    background-color: rgba(212, 184, 114, 0.1);
}

.explanation strong, 
.explanation b {
    color: var(--primary-light);
    font-weight: 700;
    transform: translateZ(2px);
}

.explanation em, 
.explanation i {
    color: var(--secondary-light);
    font-style: italic;
    transform: translateZ(1px);
}

.explanation h4, 
.explanation h5 {
    margin-top: 20px;
    margin-bottom: 12px;
    font-family: 'Scheherazade New', serif;
    color: var(--primary-light);
    transform: translateZ(4px);
}

.dark-theme .explanation h4, 
.dark-theme .explanation h5 {
    color: var(--primary-dark);
}

.loader {
    display: none;
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-light);
    border-top: 5px solid var(--primary-light);
    border-radius: 50%;
    margin: 2rem auto;
    animation: spin 1s linear infinite;
}

.dark-theme .loader {
    border-color: var(--border-dark);
    border-top-color: var(--primary-dark);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
    transform-style: preserve-3d;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
    position: relative;
}

footer::before {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    background: var(--secondary-light);
    margin: 0 auto 15px;
}

.ornament {
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpath fill='%23c4a962' d='M50,0A50,50,0,1,0,100,50,50,50,0,0,0,50,0Zm0,75A25,25,0,1,1,75,50,25,25,0,0,1,50,75Z'/%3E%3Cpath fill='%23c4a962' d='M50,35A15,15,0,1,0,65,50,15,15,0,0,0,50,35Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    margin: 0 auto;
    transform-style: preserve-3d;
    animation: rotate3D 10s infinite linear;
}

.dark-theme .ornament {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpath fill='%23d4b872' d='M50,0A50,50,0,1,0,100,50,50,50,0,0,0,50,0Zm0,75A25,25,0,1,1,75,50,25,25,0,0,1,50,75Z'/%3E%3Cpath fill='%23d4b872' d='M50,35A15,15,0,1,0,65,50,15,15,0,0,0,50,35Z'/%3E%3C/svg%3E");
}

@keyframes rotate3D {
    0% { transform: rotateY(0) rotateX(0); }
    50% { transform: rotateY(180deg) rotateX(180deg); }
    100% { transform: rotateY(360deg) rotateX(360deg); }
}

/* Animation delay classes */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
        width: calc(100% - 20px);
    }
    h1 {
        font-size: 1.8rem;
    }
    .search-box {
        flex-direction: column;
        gap: 0.8rem;
    }
    input[type="text"] {
        width: 100%;
    }
    .verse,
    .hadith {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    .verse .arabic {
        font-size: 1.4rem;
        line-height: 2;
        letter-spacing: -0.3px;
    }
    .verse .translation,
    .hadith .text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    .verse-section-title,
    .hadith-section-title,
    .explanation-title {
        font-size: 1.5rem;
    }
    .show-more-button {
        width: 90%;
        font-size: 0.9rem;
    }
    
    .hadiths-container {
        padding-bottom: 20px;
    }
    
    .hadith .imam-name {
        font-size: 1rem;
    }
    
    .ziarat-quote {
        font-size: 1rem;
        padding: 0.8rem;
        margin: 1rem auto;
        max-width: 95%;
    }
}

/* Theme toggle (light/dark) */
.theme-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--text-light);
    transition: fill 0.3s ease, transform 0.5s ease;
}

.theme-toggle:hover svg {
    transform: rotate(45deg);
}

.dark-theme .theme-toggle svg {
    fill: var(--text-dark);
}

/* Show more button styles */
.show-more-button {
    display: block;
    width: auto;
    margin: 1.5rem auto;
    padding: 0.8rem 2rem;
    background-color: transparent;
    border: 2px solid var(--primary-light);
    color: var(--primary-light);
    font-family: 'Nasim', 'Kahroba', system-ui;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.dark-theme .show-more-button {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

.show-more-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-light);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.dark-theme .show-more-button::before {
    background: var(--primary-dark);
}

.show-more-button:hover {
    color: white;
    transform: translateY(-2px);
}

.show-more-button:hover::before {
    transform: scaleX(1);
}

.dark-theme .show-more-button:hover {
    color: white;
}

.show-more-button:active {
    transform: translateY(0);
}

/* Hidden hadiths */
.hidden-hadith {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden-hadith.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hadiths container */
.hadiths-container {
    margin-bottom: 30px;
    position: relative;
    transition: height 0.3s ease;
}

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

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-light);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transform-style: preserve-3d;
}

.dark-theme .scroll-top {
    background-color: var(--primary-dark);
}

.scroll-top.visible {
    opacity: 1;
}

.scroll-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Remove cache clear button styles */
.clear-cache-button {
    display: none;
}

/* 3D flipping card for hadiths when hovered */
.hadith, .verse {
    perspective: 1000px;
}

/* 3D Layered appearance for the container */
.container {
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(212, 184, 114, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    border-radius: 15px;
    pointer-events: none;
    z-index: 1;
    transform: translateZ(10px);
}

.dark-theme .container::before {
    background: linear-gradient(135deg, 
        rgba(212, 184, 114, 0.1) 0%, 
        rgba(0, 0, 0, 0) 100%);
}

/* Islamic geometric pattern overlay */
.verse::before,
.hadith::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='%23d4b872' fill-opacity='0.05' d='M40 0L0 40h40L0 80h80V0H40zm40 40V0L40 40h40zm0 40L40 40v40h40z'/%3E%3C/svg%3E");
    background-size: 80px 80px;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
    border-radius: inherit;
    transform: translateZ(-5px);
}

/* Islamic ornamental borders */
.verse::after,
.hadith::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    background: linear-gradient(45deg, 
        var(--secondary-light) 0%, 
        transparent 25%,
        transparent 75%,
        var(--secondary-light) 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, 
                 linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, 
          linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0.3;
    transform: translateZ(5px);
}

.dark-theme .verse::after,
.dark-theme .hadith::after {
    background: linear-gradient(45deg, 
        var(--secondary-dark) 0%, 
        transparent 25%,
        transparent 75%,
        var(--secondary-dark) 100%) border-box;
}

/* Enhanced text depth */
.verse .arabic,
.hadith .text {
    transform: translateZ(10px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-theme .verse .arabic,
.dark-theme .hadith .text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Smooth hover transitions */
.verse,
.hadith {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.verse:hover .arabic,
.hadith:hover .text {
    transform: translateZ(20px);
}

/* Enhanced 3D layered appearance */
.container {
    position: relative;
    transform-style: preserve-3d;
    perspective: 2000px;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(212, 184, 114, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    border-radius: 15px;
    pointer-events: none;
    z-index: 1;
    transform: translateZ(10px);
}

.dark-theme .container::before {
    background: linear-gradient(135deg, 
        rgba(212, 184, 114, 0.1) 0%, 
        rgba(0, 0, 0, 0) 100%);
}

/* Islamic ornamental borders */
.verse::after,
.hadith::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    background: linear-gradient(45deg, 
        var(--secondary-light) 0%, 
        transparent 25%,
        transparent 75%,
        var(--secondary-light) 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, 
                 linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, 
          linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0.3;
    transform: translateZ(5px);
}

.dark-theme .verse::after,
.dark-theme .hadith::after {
    background: linear-gradient(45deg, 
        var(--secondary-dark) 0%, 
        transparent 25%,
        transparent 75%,
        var(--secondary-dark) 100%) border-box;
}

/* Enhanced text depth */
.verse .arabic,
.hadith .text {
    transform: translateZ(10px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-theme .verse .arabic,
.dark-theme .hadith .text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Smooth hover transitions */
.verse,
.hadith {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.verse:hover .arabic,
.hadith:hover .text {
    transform: translateZ(20px);
}

/* Remove any remaining backdrop filters */
.container,
.verse,
.hadith,
.search-box,
#query-input {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
} 