/* Activity Timeline Styles */
.activity-timeline {
    position: relative;
    padding: 0;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #5A67D8, #667eea, #5A67D8);
    border-radius: 1px;
    z-index: 1;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 8px;
    z-index: 2;
}

.timeline-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid #5A67D8;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(90, 103, 216, 0.2);
    transition: all 0.3s ease;
}

.timeline-icon i {
    font-size: 1.25rem;
}

.timeline-content {
    position: relative;
    animation: slideInFromRight 0.6s ease-out;
}

.timeline-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.timeline-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #5A67D8;
    transform: translateX(5px);
}

.timeline-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px 0;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.875rem;
    color: #6c757d;
}

.timeline-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-meta i {
    font-size: 1rem;
    opacity: 0.7;
}

.timeline-body {
    padding: 0 20px 20px 20px;
}

.timeline-details {
    margin: 0;
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Timeline Responsive Adjustments */
@media (max-width: 768px) {
    .activity-timeline::before {
        left: 16px;
    }
    
    .timeline-item {
        padding-left: 48px;
    }
    
    .timeline-icon {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    .timeline-icon i {
        font-size: 1rem;
    }
    
    .timeline-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-header {
        padding: 16px;
    }
}

/* Timeline Animation */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Different Color Variants for Timeline Icons */
.timeline-icon .text-success {
    color: #28a745 !important;
}

.timeline-icon .text-primary {
    color: #007bff !important;
}

.timeline-icon .text-info {
    color: #17a2b8 !important;
}

.timeline-icon .text-warning {
    color: #ffc107 !important;
}

.timeline-icon .text-secondary {
    color: #6c757d !important;
}

/* Timeline Icon Border Colors */
.timeline-item:nth-child(1) .timeline-icon {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.timeline-item:nth-child(2) .timeline-icon {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.timeline-item:nth-child(3) .timeline-icon {
    border-color: #17a2b8;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.2);
}

.timeline-item:nth-child(4) .timeline-icon {
    border-color: #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.timeline-item:nth-child(n+5) .timeline-icon {
    border-color: #6c757d;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

/* UNA Training Management System - Dashboard Enhancements */

/* Quick Actions Grid */
.una-content__quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.una-content__quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.una-content__quick-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.una-content__quick-action:hover::before {
    left: 100%;
}

.una-content__quick-action:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: #333;
    text-decoration: none;
    border-color: #5A67D8;
}

.una-content__quick-action i {
    font-size: 28px;
    margin-bottom: 12px;
    color: #5A67D8;
    transition: transform 0.3s ease;
}

.una-content__quick-action:hover i {
    transform: scale(1.1);
    color: #4C51BF;
}

.una-content__quick-action span {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* Statistics Cards Enhancements */
.una-content__feature__card {
    position: relative;
    overflow: hidden;
}

.una-content__feature__card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(90,103,216,0.1) 0%, transparent 50%);
    transition: transform 0.3s ease;
    transform: scale(0);
}

.una-content__feature__card:hover::before {
    transform: scale(1);
}

.una-content__feature__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* System Statistics */
.una-content__system-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.una-content__stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.una-content__stat-item:hover {
    background-color: rgba(90,103,216,0.05);
    border-radius: 4px;
    padding-left: 8px;
    padding-right: 8px;
}

.una-content__stat-item:last-child {
    border-bottom: none;
}

.una-content__stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.una-content__stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    background: linear-gradient(45deg, #5A67D8, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Profile Widget Enhancement */
.una-content__widget__profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.una-content__widget__profile__img {
    flex-shrink: 0;
    position: relative;
}

.una-content__widget__profile__img::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid #fff;
    border-radius: 50%;
}

.una-content__widget__profile__img img {
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.una-content__widget__profile:hover .una-content__widget__profile__img img {
    border-color: #5A67D8;
}

.una-content__widget__profile__info h5 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.una-content__widget__profile__info p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #5A67D8;
    font-weight: 500;
}

.una-content__widget__profile__info small {
    font-size: 12px;
    color: #999;
}

/* Widget Stats Enhancement */
.una-content__widget__stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.una-content__widget__stats__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.una-content__widget__stats__item:hover {
    background: #e9ecef;
    border-left-color: #5A67D8;
    transform: translateX(3px);
}

.una-content__widget__stats__item__label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.una-content__widget__stats__item__value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

/* Timeline Enhancement */
.una-content__widget__single__timeline {
    position: relative;
    padding-left: 20px;
    margin-bottom: 15px;
}

.una-content__widget__single__timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #5A67D8, #10B981);
}

.una-content__widget__single__timeline::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 10px;
    height: 10px;
    background: #5A67D8;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.una-content__widget__single__timeline:last-child::before {
    background: linear-gradient(to bottom, #5A67D8 0%, #5A67D8 30%, transparent 100%);
}

/* Charts Grid Layout */
.una-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.una-chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.una-chart-container:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.una-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
    text-align: center;
}

.advanced-chart {
    min-height: 280px;
}

/* Responsive design for charts */
@media (max-width: 768px) {
    .una-charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .una-chart-container {
        padding: 15px;
    }
    
    .una-chart-title {
        font-size: 14px;
    }
    
    .advanced-chart {
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .una-charts-grid {
        gap: 10px;
    }
    
    .una-chart-container {
        padding: 12px;
    }
    
    .advanced-chart {
        min-height: 220px;
    }
}

/* Enhanced chart containers for better RTL support */
.una-chart-container[dir="rtl"] .una-chart-title {
    text-align: right;
}

/* Loading state for charts */
.una-chart-container.loading {
    position: relative;
}

.una-chart-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5A67D8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Chart error state */
.una-chart-error {
    text-align: center;
    padding: 40px 20px;
    color: #e53e3e;
    font-size: 14px;
}

.una-chart-error i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* Chart tooltips enhancement */
.apexcharts-tooltip {
    font-family: 'Arial', sans-serif !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Chart legends enhancement */
.apexcharts-legend {
    font-family: 'Arial', sans-serif !important;
}

/* Recent Trainees Enhanced Styles */
.una-recent-trainees-list {
    margin-top: 20px;
}

.una-recent-trainee-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.una-recent-trainee-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #5A67D8;
}

.una-recent-trainee-item.featured {
    background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
    border-color: #5A67D8;
}

.una-recent-trainee-item.featured::before {
    content: 'جديد';
    position: absolute;
    top: -8px;
    right: 12px;
    background: #5A67D8;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.una-recent-trainee-avatar {
    position: relative;
    margin-left: 16px;
    flex-shrink: 0;
}

.trainee-avatar {
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.una-recent-trainee-item:hover .trainee-avatar {
    border-color: #5A67D8;
}

.trainee-status-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.trainee-status-badge.نشط {
    background: #10B981;
}

.trainee-status-badge.معلق {
    background: #F59E0B;
}

.trainee-status-badge.غير_نشط {
    background: #EF4444;
}

.trainee-status-badge i {
    font-size: 10px;
    color: white;
}

.una-recent-trainee-info {
    flex: 1;
    margin-left: 16px;
}

.trainee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.trainee-name {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.trainee-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f0fff4;
    color: #22543d;
    font-weight: 500;
}

.trainee-details {
    margin-bottom: 8px;
}

.trainee-details > div {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 13px;
    color: #4a5568;
}

.trainee-details i {
    margin-left: 8px;
    font-size: 14px;
    color: #718096;
    width: 16px;
}

.trainee-meta {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #718096;
}

.registration-date {
    display: flex;
    align-items: center;
}

.registration-date i {
    margin-left: 6px;
    font-size: 12px;
}

.registration-date small {
    margin-right: 8px;
    color: #a0aec0;
}

.una-recent-trainee-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.trainee-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.trainee-action-btn.primary {
    background: #5A67D8;
    color: white;
}

.trainee-action-btn.primary:hover {
    background: #4c51bf;
    transform: scale(1.05);
    color: white;
    text-decoration: none;
}

.trainee-action-btn.secondary {
    background: #f7fafc;
    color: #4a5568;
    border-color: #e2e8f0;
}

.trainee-action-btn.secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: scale(1.05);
    color: #2d3748;
    text-decoration: none;
}

.trainee-action-btn i {
    font-size: 16px;
}

/* Empty State */
.una-recent-trainee-empty {
    padding: 40px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 8px;
}

.empty-state p {
    color: #718096;
    margin-bottom: 20px;
}

.add-trainee-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: #5A67D8;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-trainee-btn:hover {
    background: #4c51bf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 103, 216, 0.3);
    color: white;
    text-decoration: none;
}

.add-trainee-btn i {
    margin-left: 8px;
    font-size: 16px;
}

/* File Manager Styles */
.file-manager-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.file-upload-item {
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload-item:hover {
    background: #e9ecef;
}

.file-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.file-icon {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.view-btn {
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #6c757d;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.view-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.file-details {
    font-size: 14px;
}

.file-details .file-info p {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f3f4;
}

.file-details .file-info p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.file-preview img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#files-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#no-files-message {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.search-area {
    position: relative;
    max-width: 300px;
}

.search-area i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.search-area input {
    padding-right: 35px;
}

/* Arabic/RTL specific styles */
[dir="rtl"] .search-area i {
    right: auto;
    left: 10px;
}

[dir="rtl"] .search-area input {
    padding-right: 12px;
    padding-left: 35px;
}

/* File type badges */
.file-type-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,123,255,0.8);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Upload progress */
.upload-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.3s ease;
}

/* File category tabs */
#category-filter-tabs .nav-link {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 8px 16px;
    margin-bottom: 5px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#category-filter-tabs .nav-link:hover {
    background: #f8f9fa;
    color: #495057;
}

#category-filter-tabs .nav-link.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* File type filter tabs */
#file-filter-tabs .nav-link {
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 8px;
    margin-right: 5px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

#file-filter-tabs .nav-link:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

#file-filter-tabs .nav-link.active {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    box-shadow: 0 3px 10px rgba(40,167,69,0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-card {
        margin-bottom: 15px;
    }
    
    .top_area_file__manager {
        flex-direction: column;
        gap: 15px;
    }
    
    .top_area_file__manager .right {
        justify-content: space-between;
        width: 100%;
    }
    
    .search-area {
        max-width: none;
        flex: 1;
    }
}

/* Animation for file loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-card,
#files-table-body tr {
    animation: fadeInUp 0.3s ease forwards;
}

/* File access indicators */
.file-access-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.file-access-public {
    background: #28a745;
}

.file-access-private {
    background: #ffc107;
}

.file-access-restricted {
    background: #dc3545;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .una-content__quick-action {
        background: linear-gradient(135deg, #374151 0%, #4B5563 100%);
        color: #F9FAFB;
        border-color: #4B5563;
    }
    
    .una-content__quick-action:hover {
        background: linear-gradient(135deg, #4B5563 0%, #6B7280 100%);
        color: #F9FAFB;
    }
    
    .una-content__system-stats {
        background: #374151;
    }
    
    .una-content__stat-item {
        border-bottom-color: #4B5563;
    }
    
    .una-content__widget__profile {
        background: linear-gradient(135deg, #374151 0%, #4B5563 100%);
        border-color: #4B5563;
    }
}

