/* أنماط خاصة بصفحة قواعد البيانات */
.databases-hero {
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.databases-hero .container {
    position: relative;
    z-index: 1;
}

.databases-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.databases-hero h1 i {
    margin-left: 15px;
    color: #ffd700;
}

.databases-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-stats .stat {
    text-align: center;
}

.hero-stats .number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffd700;
}

.hero-stats .label {
    font-size: 1rem;
    opacity: 0.9;
}

/* قواعد البيانات المميزة */
.featured-databases {
    padding: 60px 0;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-header h2 i {
    margin-left: 10px;
    color: #ffd700;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.featured-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border-top: 4px solid #ffd700;
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: 'مميز';
    position: absolute;
    top: 15px;
    left: -30px;
    background: #ffd700;
    color: #333;
    padding: 5px 40px;
    transform: rotate(-45deg);
    font-size: 0.8rem;
    font-weight: bold;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.featured-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.featured-logo {
    width: 60px;
    height: 60px;
    background: var(--secondary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

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

.featured-title {
    flex: 1;
}

.featured-title h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.featured-provider {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.featured-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.featured-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.featured-category {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.featured-access {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.featured-access.paid {
    color: #dc3545;
}

.featured-access.free {
    color: var(--success-color);
}

.featured-actions {
    display: flex;
    gap: 10px;
}

/* بحث وقوائم قواعد البيانات */
.databases-search {
    padding: 40px 0;
    background: white;
}

.search-filters {
    background: var(--light-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.search-box button:hover {
    background: #1a3d6c;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* نتائج قواعد البيانات */
.databases-results {
    padding: 40px 0 80px;
    background: var(--light-color);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.results-info {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
}

.search-query {
    color: #666;
    font-weight: normal;
    margin-right: 10px;
}

.results-view {
    display: flex;
    gap: 5px;
    background: var(--secondary-color);
    padding: 5px;
    border-radius: var(--border-radius);
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
}

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

.databases-grid {
    display: grid;
    gap: 25px;
}

.databases-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.databases-grid.list-view {
    grid-template-columns: 1fr;
}

.database-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.database-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-color);
}

.database-card.featured {
    border-left-color: #ffd700;
}

.database-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.database-logo {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

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

.database-info {
    flex: 1;
}

.database-title {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
    line-height: 1.3;
}

.database-provider {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.database-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.database-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.database-category {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.database-access {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}

.database-access.paid {
    color: #dc3545;
}

.database-access.free {
    color: var(--success-color);
}

.database-popularity {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
}

.database-actions {
    display: flex;
    gap: 10px;
}

/* التصفح بين الصفحات */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0 20px;
}

.page-btn {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background: white;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.page-btn.prev i {
    order: 1;
}

.page-btn.next i {
    order: -1;
}

/* حالة التحميل */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--primary-color);
}

.loading-spinner {
    font-size: 2rem;
    margin-bottom: 15px;
}

.loading p {
    font-size: 1.1rem;
}

/* لا توجد نتائج */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ddd;
}

.no-results h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.no-results p {
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* النافذة المنبثقة */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
    background: var(--light-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 30px;
}

/* تفاصيل قاعدة البيانات */
.database-details {
    line-height: 1.6;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detail-logo {
    width: 80px;
    height: 80px;
    background: var(--secondary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

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

.detail-title {
    flex: 1;
    margin: 0 20px;
}

.detail-title h2 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.detail-provider {
    color: #666;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.detail-access {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
}

.detail-access.paid {
    background: #ffe6e6;
    color: #dc3545;
}

.detail-access.free {
    background: #e6f4ea;
    color: var(--success-color);
}

.detail-popularity {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

.detail-section {
    margin-bottom: 30px;
}

.detail-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-section p {
    color: #555;
    line-height: 1.7;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item strong {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.subjects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-tag {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

/* معالجة الصور المفقودة */
.logo-placeholder {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* إزالة خلفية الصورة من الهيرو */
.databases-hero::before {
    background: none;
}

/* تحسين عرض الأيقونات عند عدم وجود صور */
.featured-logo,
.database-logo,
.detail-logo {
    background: linear-gradient(135deg, var(--primary-color), #2c5aa0);
    color: white;
}

/* التجاوب للجوال */
@media (max-width: 768px) {
    .databases-hero h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .databases-grid.grid-view {
        grid-template-columns: 1fr;
    }
    
    .detail-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .detail-title {
        margin: 0;
    }
    
    .detail-meta {
        align-items: center;
        width: 100%;
    }
    
    .detail-actions {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .databases-hero {
        padding: 60px 0;
    }
    
    .databases-hero h1 {
        font-size: 1.7rem;
    }
    
    .hero-stats .number {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .featured-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-logo {
        align-self: center;
    }
    
    .database-header {
        flex-direction: column;
        text-align: center;
    }
    
    .database-logo {
        align-self: center;
    }
}