:root {
    --primary-color: #2E7D32;
    --secondary-color: #81C784;
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

html, body, * {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

html, body {
    height: 100%;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 120px 20px;
    direction: rtl;
    background-color: #f0f2f5;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: none;
    box-shadow: none;
    position: relative;
    min-height: unset;
}

.header-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 1.2rem 1rem 0.7rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.75);
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    width: 90vw;
    min-width: 320px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 1px 1px 8px #fff;
}

nav {
    display: flex;
    gap: 1.5rem;
}

.nav-btn {
    padding: 0.5rem 1.2rem;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.nav-btn:hover, .nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Search Section */
.search-section {
    margin-top: 0;
    padding: 2.5rem 0 3.5rem 0;
    background: url('/assets/images/mosque.avif') top center/cover no-repeat;
    color: white;
    border-radius: 0 0 32px 32px;
    box-shadow: var(--box-shadow);
    position: relative;
}
.search-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(46, 125, 50, 0.82);
    border-radius: 0 0 32px 32px;
    z-index: 0;
}
.search-header-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 4.5rem 0 3.5rem 0;
    position: relative;
    background: url('/assets/images/mosque.avif') center/cover no-repeat;
    border-radius: 32px 32px 32px 32px;
    margin-top: 0px;
    overflow: hidden;
}
.search-header-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(46, 125, 50, 0.461) 60%, rgba(25, 118, 210, 0.416) 100%);
    border-radius: 0 0 32px 32px;
    z-index: 0;
    backdrop-filter: blur(2px);
}
.search-welcome-box, .search-container {
    position: relative;
    z-index: 1;
}
.search-welcome-box {
    text-align: center;
    color: #fff;
}
.welcome-text {
    font-size: 2.3rem;
    margin-bottom: 1.1rem;
    font-weight: bold;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
    letter-spacing: 1px;
}
.search-text {
    font-size: 1.18rem;
    margin-bottom: 2.2rem;
    text-shadow: 0 1px 6px rgba(255, 255, 255, 0.13);
}
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
    min-height: unset;
    background: rgba(255,255,255,0.18);
    box-shadow: 0 4px 24px rgba(25,118,210,0.10);
    padding: 0.3rem 0.7rem;
    border-radius: 18px;
    backdrop-filter: blur(6px);
    border: 1.5px solid #e3f2fd;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.search-container:focus-within {
    box-shadow: 0 8px 32px rgba(25,118,210,0.18);
    border-color: #1976d2;
}
.search-input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1.2rem;
    font-size: 1.13rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #e3f2fd;
    font-weight: 500;
    outline: none;
    box-shadow: none;
}
.search-input:focus {
    background: rgba(255,255,255,0.32);
}
.search-icon {
    position: absolute;
    right: 18px;
    width: 22px;
    height: 22px;
    color: #1976d2;
    pointer-events: none;
    opacity: 0.85;
}

/* Modernisation des résultats */
.word-type, .type-section, .verse {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(46,125,50,0.08), 0 1.5px 6px rgba(0,0,0,0.04);
    margin-bottom: 24px;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border: none;
    transition: box-shadow 0.3s, transform 0.3s;
}
.word-type:hover, .type-section:hover, .verse:hover {
    box-shadow: 0 8px 32px rgba(46,125,50,0.16), 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-4px) scale(1.01);
}
.word-type h3, .stats h3 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin-bottom: 1rem;
}
.type-section h4 {
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 0.7rem;
}
.detail-item {
    background: #f8f9fa;
    border-radius: 10px;
    margin: 10px 0;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    font-size: 1.1em;
    color: #333;
    transition: box-shadow 0.2s;
}
.detail-item:hover {
    box-shadow: 0 2px 8px rgba(46,125,50,0.08);
}
.word-content {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.15em;
}
.verse {
    background: linear-gradient(120deg, #f8f9fa 70%, #e3f2fd 100%);
    border-right: 6px solid #1976d2;
    box-shadow: 0 6px 24px rgba(25, 118, 210, 0.10), 0 2px 8px rgba(46,125,50,0.07);
    padding: 1.7rem 1.2rem 1.2rem 1.2rem;
    border-radius: 18px;
    margin-bottom: 24px;
    transition: box-shadow 0.3s, transform 0.3s;
}
.verse:hover {
    box-shadow: 0 12px 32px rgba(25, 118, 210, 0.18), 0 4px 16px rgba(46,125,50,0.10);
    transform: translateY(-4px) scale(1.015);
}
.verse-text {
    font-size: 1.3em;
    color: var(--text-color);
    background: none;
    border: none;
    padding: 0 0 1rem 0;
    line-height: 2;
}
.verse-info {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    background: none;
    padding: 0;
}
.surah-name, .verse-number, .surah-number {
    background: linear-gradient(90deg, #e3f2fd 60%, #bbdefb 100%);
    color: #1976d2;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(25,118,210,0.10);
    padding: 7px 18px;
    font-size: 1.08em;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    border: 1.5px solid #90caf9;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
}
.surah-name {
    background: linear-gradient(90deg, #bbdefb 60%, #e3f2fd 100%);
    color: #1565c0;
    border-color: #64b5f6;
}
.verse-number {
    background: linear-gradient(90deg, #e1bee7 60%, #f3e5f5 100%);
    color: #8e24aa;
    border-color: #ce93d8;
}
.surah-number {
    background: linear-gradient(90deg, #ffe082 60%, #fff8e1 100%);
    color: #f9a825;
    border-color: #ffd54f;
}
.stats {
    background: #e8f5e9;
    color: var(--primary-color);
    border-radius: 12px;
    border: 1px solid #81C784;
    box-shadow: 0 2px 8px rgba(46,125,50,0.07);
    margin: 18px 0 24px 0;
    padding: 1.2rem 0.7rem;
    font-size: 1.1em;
}
.error {
    background: linear-gradient(90deg, #ffcdd2 0%, #ffebee 30%);
    color: #d32f2f;
    border-radius: 16px;
    border-right: 5px solid #d32f2f;
    box-shadow: 0 2px 8px rgba(211,47,47,0.10);
    margin: 18px 0 24px 0;
    padding: 1.2rem 1.5rem;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.7em;
    letter-spacing: 0.2px;
    transition: box-shadow 0.2s, border-color 0.2s;
    direction: rtl;
    text-align: right;
    font-family: 'Amiri', serif;
}
.error::before {
    content: '⚠️';
    font-size: 1.3em;
    margin-left: 0.5em;
    opacity: 0.85;
}
.error::after {
    content: '⚠️';
    font-size: 1.3em;
    margin-right: 0.5em;
    opacity: 0.85;
}
.highlight {
    background: #ffe082;
    color: #c62828;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* Sections Principales */
.section {
    display: none;
    padding: 2.5rem 0 2rem 0;
    max-width: 1100px;
    margin: 0 auto;
}

.section.active {
    display: block;
    animation: fadeIn 0.7s;
}

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

.container {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--box-shadow);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
}

.about-content, .contact-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.about-text, .about-image {
    flex: 1 1 300px;
}

.about-image img {
    max-width: 320px;
    border-radius: 18px;
    box-shadow: var(--box-shadow);
}

#ts-section {
    width: 90vw;
    min-width: 320px;
    max-width: 1200px;
    margin: 0 auto 2.5rem auto;
    box-sizing: border-box;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(25,118,210,0.07);
    padding: 2.5rem 2rem 2rem 2rem;
    position: relative;
}
#ts-section h2 {
    color: #1976d2;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 1px;
}
.ts-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    padding: 2rem 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.ts-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}
.ts-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}
.ts-card h3 {
    color: #1e40af;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}
.ts-card p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}
.ts-card .arrow {
    position: absolute;
    bottom: 1.5rem;
    transition: transform 0.3s ease;
}
.ts-card:hover .arrow {
    transform: translateX(5px);
}
@media (max-width: 1200px) {
    .ts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .ts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .ts-grid {
        grid-template-columns: 1fr;
    }
}
.contact-section {
    flex-direction: column;
    text-align: center;
}

.contact-section p, .contact-section div {
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.7rem 0.5rem 0.5rem 0.5rem;
        width: 98vw;
    }
    .search-header-box {
        min-height: 180px;
        padding: 2.2rem 0 1.2rem 0;
        margin-top: 70px;
    }
    .welcome-text {
        font-size: 1.3rem;
    }
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    .about-image img {
        max-width: 220px;
    }
    .ts-grid {
        flex-direction: column;
    }
    .search-container {
        max-width: 98vw;
    }
}

@media (max-width: 600px) {
    .search-section {
        padding: 1rem 0 2rem 0;
    }
    .container {
        padding: 1rem 0.5rem;
    }
    .section {
        padding: 1.2rem 0 1rem 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    animation: pulse 2s infinite;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: var(--primary-color);
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 15px;
    animation: fadeInOut 1.5s infinite;
}

.loading-dots {
    display: inline-block;
    animation: dots 1.5s infinite;
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeInOut {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* Footer */
footer {
    background-color: white;
    padding: 2rem;
    margin-top: 4rem;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        justify-content: center;
    }
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2.5rem;
    align-items: flex-start;
    margin: 0 auto;
    max-width: 98vw;
    min-height: 70vh;
}
.quran-verses-section {
    order: 2;
    min-width: 0;
    background: linear-gradient(120deg, #e3f2fd 80%, #fff 100%);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(25,118,210,0.08);
    padding: 2rem 1.2rem 1.2rem 1.2rem;
    min-height: 300px;
    border: 2px solid #bbdefb;
    margin-bottom: 2rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.quran-verses-section:hover {
    box-shadow: 0 8px 32px rgba(25,118,210,0.13);
    border-color: #1976d2;
}
.word-types-section {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    z-index: 100;
}

/* Style de la barre de recherche dans word-types-section */
.word-types-section .search-box {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    z-index: 101;
    border-bottom: 2px solid #e8f5e9;
}

.word-types-section .search-box input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e8f5e9;
    border-radius: 12px;
    font-size: 1rem;
    color: #2e7d32;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    direction: rtl;
    text-align: right;
}

.word-types-section .search-box input:focus {
    outline: none;
    border-color: #81c784;
    box-shadow: 0 4px 12px rgba(46,125,50,0.1);
}

.word-types-section .search-box input::placeholder {
    color: #9e9e9e;
    font-style: italic;
    text-align: right;
}

/* Style de la barre de défilement */
.word-types-section::-webkit-scrollbar {
    width: 8px;
}

.word-types-section::-webkit-scrollbar-track {
    background: #e8f5e9;
    border-radius: 4px;
}

.word-types-section::-webkit-scrollbar-thumb {
    background: #81c784;
    border-radius: 4px;
}

.word-types-section::-webkit-scrollbar-thumb:hover {
    background: #66bb6a;
}

/* Ajustement pour mobile */
@media (max-width: 768px) {
    .word-types-section {
        position: relative;
        top: 0;
        max-height: none;
        overflow-y: visible;
    }
    
    .word-types-section .search-box {
        position: relative;
        padding: 0.8rem 0;
    }
    
    .word-types-section .search-box input {
        padding: 0.6rem 1rem;
    }
}

.word-types-section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.word-types-section h3 {
    color: #2e7d32;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #e8f5e9;
    font-weight: 600;
    text-align: center;
}
.word-types-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
}
.word-types-section li {
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    border: 1px solid #e8f5e9;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.word-types-section li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46,125,50,0.1);
    border-color: #81c784;
}
.word-types-section li::before {
    content: '•';
    color: #2e7d32;
    font-size: 1.5rem;
    font-weight: bold;
}
.word-types-section li strong {
    color: #1b5e20;
    font-weight: 600;
    margin-right: 0.5rem;
}
.word-types-section li span {
    color: #424242;
    font-size: 0.95rem;
}
@media (max-width: 768px) {
    .word-types-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    .word-types-section ul {
        grid-template-columns: 1fr;
    }
    .word-types-section li {
        padding: 1rem;
    }
}
/* Style pour les statistiques */
.word-types-section .stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8f5e9;
}
.word-types-section .stat-item {
    background: #e8f5e9;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
}
.word-types-section .stat-item .number {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2e7d32;
    display: block;
    margin-bottom: 0.3rem;
}
.word-types-section .stat-item .label {
    color: #424242;
    font-size: 0.9rem;
}
/* Animation pour les nouveaux éléments */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.word-types-section li {
    animation: fadeInUp 0.3s ease forwards;
}

/* Espacement entre la section recherche et la section résultats */
#searchResults {
    margin-top: 2.5rem;
}

.main-aligned-section,
.search-header-box,
#searchResults,
.section {
    width: 90vw;
    min-width: 320px;
    max-width: 1200px;
    margin: 0 auto 2.5rem auto;
    box-sizing: border-box;
}

/* Masquer la section de recherche initiale quand les résultats sont affichés */
.results-container:not(:empty) ~ .search-section {
    display: none;
}

main, .roots-container, .letters-container, .proper-nouns-container, .combinations-container, .nominal-names-container {
    flex: 1 0 auto;
}

.form-list li {
    position: relative;
    padding-right: 18px;
    display: flex;
    align-items: center;
    direction: rtl;
}
/* Afficher le point rouge uniquement si le mot est surligné */
.form-list li:has(.highlight)::before {
    color: #c62828;
    margin-left: 6px;
    margin-right: 0px;
    position: static;
    top: auto;
    right: auto;
    transform: none;
}
.form-list li b, .form-list li .highlight {
    margin-right: 0;
} 