/* history-app.css - Styles spécifiques لتطبيق التاريخ */

/* شريط التحكم العلوي */
.control-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* رأس التطبيق */
.history-header {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.history-header h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.history-header h1 i {
    color: #667eea;
}

/* منتقي اللغة */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 12px 25px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}

.lang-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* منتقي التاريخ */
.date-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.date-nav-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-nav-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.current-date {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

#date-picker {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    min-width: 200px;
}

#today-btn {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#today-btn:hover {
    background: #218838;
}

/* قائمة الفئات */
.category-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f1f3f5;
}

.cat-btn {
    padding: 20px;
    border: none;
    background: white;
    color: #495057;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.cat-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: #667eea;
    color: white;
}

.cat-btn:hover i {
    color: white;
}

.cat-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.cat-btn i {
    color: #667eea;
    font-size: 1.5em;
}

.cat-btn.active i {
    color: white;
}

/* لوحة الفلاتر */
.filters-panel {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group select,
.filter-group input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#search-box {
    min-width: 200px;
}

/* مؤشر التحميل */
.loading-indicator {
    padding: 60px;
    text-align: center;
    display: none;
}

.loading-indicator.active {
    display: block;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loading-text {
    color: #666;
    font-size: 1.1em;
}

/* حاوية الأحداث */
.events-container {
    padding: 30px;
    min-height: 500px;
    background: #f8f9fa;
}

.event-card {
    background: white;
    margin-bottom: 20px;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border-right: 5px solid #667eea;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.event-card:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.event-card.rtl {
    border-right: none;
    border-left: 5px solid #667eea;
}

.event-card.rtl:hover {
    transform: translateX(-10px);
}

.event-year {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.event-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.event-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-card:hover .event-actions {
    opacity: 1;
}

.action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.favorite-btn {
    background: #ffd700;
    color: #333;
}

.share-btn {
    background: #1da1f2;
    color: white;
}

.details-btn {
    background: #28a745;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* لوحة الإحصائيات */
.stats-panel {
    background: white;
    padding: 20px 30px;
    border-top: 2px solid #e9ecef;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-item:hover .stat-label,
.stat-item:hover .stat-value {
    color: white;
}

.stat-item i {
    font-size: 2em;
    margin-bottom: 10px;
    color: #667eea;
}

.stat-item:hover i {
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

/* الشريط الجانبي */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

/* المودال */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #666;
}

.help-content {
    padding: 20px 0;
}

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

.help-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.help-section p, .help-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* التجاوب */
@media (max-width: 1024px) {
    .category-menu {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .history-header h1 {
        flex-direction: column;
        gap: 10px;
        font-size: 2em;
    }
    
    .language-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .lang-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .date-selector {
        flex-direction: column;
    }
    
    .current-date {
        flex-direction: column;
        width: 100%;
    }
    
    #date-picker {
        width: 100%;
    }
    
    .category-menu {
        grid-template-columns: 1fr;
    }
    
    .filters-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .events-container {
        padding: 15px;
    }
    
    .sidebar {
        width: 100%;
    }
}

/* تعديلات وضع الليل */
.dark-mode .history-container {
    background: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .history-header {
    background: #2d2d2d;
    border-bottom-color: #3d3d3d;
}

.dark-mode .history-header h1 {
    color: #e0e0e0;
}

.dark-mode .cat-btn {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .filters-panel {
    background: #2d2d2d;
    border-bottom-color: #3d3d3d;
}

.dark-mode .filter-group label {
    color: #e0e0e0;
}

.dark-mode .filter-group select,
.dark-mode .filter-group input {
    background: #3d3d3d;
    border-color: #4d4d4d;
    color: #e0e0e0;
}

.dark-mode .events-container {
    background: #1e1e1e;
}

.dark-mode .event-card {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .event-text {
    color: #e0e0e0;
}

.dark-mode .stats-panel {
    background: #2d2d2d;
    border-top-color: #3d3d3d;
}

.dark-mode .stat-item {
    background: #3d3d3d;
}

.dark-mode .stat-value {
    color: #e0e0e0;
}

.dark-mode .sidebar {
    background: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}