@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Tajawal", sans-serif;
}

body {
    background-color: #f8fafc;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

header {
    background: linear-gradient(135deg, #1a3a5f, #2c5282);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.logo h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.main-nav a:hover {
    color: #a0c4ff;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.class-details-section {
    padding: 1.5rem 0;
    background: white;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb a {
    color: #2c5282;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #1a3a5f;
    text-decoration: underline;
}

.breadcrumb span {
    color: #1a3a5f;
    font-weight: 500;
}

.class-header {
    text-align: center;
}

.class-title {
    color: #1a3a5f;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.class-description {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.class-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.class-stat {
    text-align: center;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c5282;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.filters-section {
    background: white;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-box input:focus {
    outline: none;
    border-color: #2c5282;
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.filter-options {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.3s ease;
    background: #f8fafc;
    flex: 1;
}

.filter-select:focus {
    outline: none;
    border-color: #2c5282;
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.texts-section {
    padding: 1rem 0 2rem;
    flex: 1;
}

.texts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.text-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.text-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
}

.text-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.text-category {
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
    color: white;
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.text-duration {
    color: #666;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-icon {
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    font-size: 2rem;
    min-height: 120px;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.text-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #1a3a5f;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-stats {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    gap: 0.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #666;
    font-size: 0.8rem;
    flex: 1;
    justify-content: center;
}

.stat i {
    color: #2c5282;
    font-size: 0.9rem;
}

.card-audio-player {
    padding: 1.2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(44, 82, 130, 0.3);
}

.play-btn:hover {
    background: linear-gradient(135deg, #1a3a5f, #2c5282);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(44, 82, 130, 0.4);
}

.play-btn.playing {
    background: linear-gradient(135deg, #e53e3e, #c53030);
}

.play-btn.playing:hover {
    background: linear-gradient(135deg, #c53030, #e53e3e);
}

.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.progress-bar {
    width: 100%;
    height: 5px;
    appearance: none;
    -webkit-appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #2c5282;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.progress-bar::-webkit-slider-thumb:hover {
    background: #1a3a5f;
    transform: scale(1.1);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
}

.player-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 0.8rem;
}

.speed-control {
    display: flex;
    gap: 0.2rem;
    background: white;
    border-radius: 18px;
    padding: 0.2rem;
    border: 1px solid #e2e8f0;
    flex: 1;
}

.speed-btn {
    flex: 1;
    padding: 5px 8px;
    border: none;
    background: transparent;
    border-radius: 14px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.speed-btn.active {
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
    color: white;
}

.speed-btn:hover:not(.active) {
    background: #f7fafc;
    color: #2c5282;
}

.download-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: #2c5282;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    background: #2c5282;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(44, 82, 130, 0.3);
}

.player-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.edit-btn,
.delete-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 90px;
    height: 42px;
    flex-shrink: 0;
}

.edit-btn {
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #1a3a5f, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(44, 82, 130, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c53030, #e53e3e);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(229, 62, 62, 0.4);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.page-btn:hover {
    background: #f7fafc;
    color: #2c5282;
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
    color: white;
    border-color: #2c5282;
}

.next-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

footer {
    background: #1a3a5f;
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* تحسينات للاستجابة */
@media (max-width: 1200px) {
    .texts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

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

    .main-nav ul {
        gap: 0.8rem;
        justify-content: center;
    }

    .main-nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-options {
        width: 100%;
        justify-content: stretch;
    }

    .filter-select {
        min-width: auto;
        flex: 1;
    }

    .texts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .player-controls {
        flex-direction: column;
        gap: 0.8rem;
    }

    .progress-container {
        width: 100%;
    }

    .class-title {
        font-size: 1.8rem;
    }

    .class-description {
        font-size: 0.95rem;
    }

    .player-options {
        flex-direction: column;
        gap: 0.8rem;
    }

    .speed-control {
        width: 100%;
        justify-content: center;
    }

    .player-actions {
        flex-direction: column;
    }

    .edit-btn,
    .delete-btn {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .logo {
        gap: 8px;
    }

    .logo-img {
        width: 50px;
        height: 50px;
    }

    .logo h2 {
        font-size: 1.1rem;
    }

    .main-nav ul {
        gap: 0.5rem;
    }

    .main-nav a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .class-title {
        font-size: 1.6rem;
    }

    .class-stats {
        gap: 1rem;
    }

    .class-stat {
        min-width: 100px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .card-content {
        padding: 1.2rem;
    }

    .card-audio-player {
        padding: 1rem;
    }

    .page-btn {
        padding: 8px 12px;
        min-width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .speed-control {
        flex-direction: column;
        gap: 0.3rem;
        padding: 0.5rem;
    }

    .speed-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .texts-grid {
        grid-template-columns: 1fr;
    }

    .text-card {
        margin: 0 auto;
        max-width: 300px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .text-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat {
        justify-content: flex-start;
    }
}

.ad-banner-section {
    width: 100%;
    padding: 20px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 20px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ad-center-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    min-height: 90px;
}

.ad-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #2c5282, #1a3a5f);
}

.ad-label {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(44, 82, 130, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
}

.mobile-ad {
    display: block;
}

.desktop-ad {
    display: none;
}

@media (min-width: 768px) {
    .mobile-ad {
        display: none;
    }

    .desktop-ad {
        display: block;
    }
}

.adsbygoogle {
    display: block !important;
    width: 100%;
}

.mobile-ad .adsbygoogle {
    height: 100px;
}

.desktop-ad .adsbygoogle {
    height: 90px;
}

.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 30px 0;
}