/* Sunnah Web - Estilos principales */

:root {
    --primary-color: #2c5282;
    --secondary-color: #3ba08f;
    --text-color: #2d3748;
    --bg-color: #f7fafc;
    --border-color: #e2e8f0;
    --arabic-font: 'Amiri', 'Traditional Arabic', serif;
    --spanish-font: 'Lora', 'Georgia', serif;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.header p {
    opacity: 0.9;
    font-size: 1rem;
}

.header a {
    color: white;
    text-decoration: none;
}

.header a:hover {
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
    background-color: white;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.5rem;
    color: #cbd5e0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Collections Grid */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.collection-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.collection-card h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.collection-card .stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #718096;
}

.collection-card .stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Books List */
.books-list {
    margin-top: 2rem;
}

.book-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.book-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.book-item .book-number {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

.book-item .book-name-ar {
    font-family: var(--arabic-font);
    font-size: 1.1rem;
    color: #4a5568;
    margin-top: 0.5rem;
    direction: rtl;
    text-align: right;
}

.book-item .hadith-count {
    margin-top: 0.5rem;
    color: #718096;
    font-size: 0.9rem;
}

/* Hadith Card */
.hadith-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hadith-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.hadith-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.hadith-meta {
    color: #718096;
    font-size: 0.9rem;
}

/* Two Column Layout for Arabic/Spanish */
.hadith-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hadith-content {
        grid-template-columns: 1fr;
    }
}

.hadith-arabic {
    border-right: 3px solid var(--secondary-color);
    padding-right: 2rem;
}

.hadith-spanish {
    border-left: 3px solid var(--primary-color);
    padding-left: 2rem;
}

@media (max-width: 768px) {
    .hadith-arabic {
        border-right: none;
        border-bottom: 3px solid var(--secondary-color);
        padding-right: 0;
        padding-bottom: 1rem;
    }

    .hadith-spanish {
        border-left: none;
        border-top: 3px solid var(--primary-color);
        padding-left: 0;
        padding-top: 1rem;
    }
}

.section-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arabic-text {
    font-family: var(--arabic-font);
    font-size: 1.5rem;
    line-height: 2.2;
    direction: rtl;
    text-align: right;
    color: #1a202c;
}

.spanish-text {
    font-family: var(--spanish-font);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2d3748;
}

.not-translated {
    color: #a0aec0;
    font-style: italic;
    padding: 1rem;
    background-color: #f7fafc;
    border-radius: 4px;
}

/* Chapter Info */
.chapter-info {
    background-color: #edf2f7;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.chapter-info h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.chapter-info .chapter-ar {
    font-family: var(--arabic-font);
    font-size: 1.2rem;
    direction: rtl;
    text-align: right;
    color: #4a5568;
}

/* References */
.hadith-references {
    background-color: #f7fafc;
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 2rem;
}

.hadith-references h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.reference-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid var(--secondary-color);
    padding-left: 1rem;
}

.reference-item strong {
    color: var(--primary-color);
    display: inline-block;
    min-width: 180px;
}

/* Grade Badge */
.grade-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 1rem;
}

.grade-sahih {
    background-color: #48bb78;
    color: white;
}

.grade-hasan {
    background-color: #ed8936;
    color: white;
}

.grade-daif {
    background-color: #e53e3e;
    color: white;
}

.grade-other {
    background-color: #718096;
    color: white;
}

/* Footer */
.footer {
    background-color: #2d3748;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

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

.footer a:hover {
    text-decoration: underline;
}

/* Error Pages */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1.1rem;
    color: #718096;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--primary-color);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* Search Form */
.search-form {
    margin-top: 1.5rem;
}

.search-form form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    transition: all 0.2s;
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: white;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-form input[type="text"]::placeholder {
    color: #a0aec0;
}

.search-form select {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
}

.search-form select:focus {
    outline: none;
    border-color: white;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-form button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.search-form button:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-form button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .search-form form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input[type="text"],
    .search-form select,
    .search-form button {
        width: 100%;
        min-width: 100%;
    }
}

/* Header Top - Botón de Aviso */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.btn-aviso-importante {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 193, 7, 0.9);
    color: #1a202c;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-aviso-importante:hover {
    background-color: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: white;
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-aviso-importante {
        align-self: stretch;
        text-align: center;
    }
}

/* Modal Overlay y Contenido */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    background-color: #fff3cd;
}

.modal-header h2 {
    color: #856404;
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #856404;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 4px;
    color: #856404;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    background-color: #f7fafc;
}

.modal-footer button,
.modal-footer .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background-color: #718096;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 0.5rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer button,
    .modal-footer .btn-secondary {
        width: 100%;
    }
}

/* Página de Aviso Importante */
.aviso-importante-container {
    max-width: 800px;
    margin: 0 auto;
}

.aviso-importante-container h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.3;
}

.aviso-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 6px solid #ffc107;
}

.aviso-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.05rem;
    text-align: justify;
}

.aviso-content p:last-child {
    margin-bottom: 0;
}

.aviso-actions {
    margin-top: 2rem;
    text-align: center;
}

@media (max-width: 768px) {
    .aviso-importante-container h1 {
        font-size: 1.5rem;
    }

    .aviso-content {
        padding: 1.5rem;
    }

    .aviso-content p {
        font-size: 1rem;
        text-align: left;
    }
}
