:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary: #0ea5e9;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #0f172a;
    --text: #0f172a;
    --text-light: #64748b;
    --bg: #f8fafc;
}

.trainings-page {
    background: var(--bg);
    min-height: 100vh;
}

/* Filter Bar */
.filter-bar {
    padding: 20px 0;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.filter-container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-radius: 16px;
    font-size: 15px;
    background: white;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 18px;
}

.filter-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 20px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-radius: 50px;
    background: white;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
}

/* Trainings Grid */
.trainings-section {
    padding: 40px 0 80px;
}

.trainings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 40px;
}

.training-card {
    border-radius: 24px;
    overflow: hidden;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    transition: all 0.5s;
}

.training-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 80px rgba(79, 70, 229, 0.25);
}

/* Video Thumbnail */
.video-thumbnail-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.training-card:hover .video-thumbnail {
    transform: scale(1.15);
}

/* Play Button */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.play-button:hover {
    background: white;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button i {
    font-size: 24px;
    color: var(--primary);
    margin-left: 3px;
}

/* Badges */
.video-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.level-badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 12px;
    color: white;
}

.level-badge.beginner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.level-badge.intermediate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.level-badge.advanced {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.featured-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, #ffd700 0%, #ffc107 100%);
    border-radius: 50px;
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.duration-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    z-index: 2;
}

/* Card Content */
.card-content {
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.training-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.view-count {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    margin-left: 12px;
    white-space: nowrap;
}

.training-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.meta-item i {
    color: var(--primary);
}

.training-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.training-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.training-tag {
    padding: 6px 12px;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s;
}

.training-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

/* Watch Button */
.watch-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.4s;
}

.watch-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    grid-column: 1 / -1;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-modal.show {
    display: flex;
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

.video-modal iframe {
    width: 100%;
    height: 100%;
}

.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Stats Section */
.stats-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-card {
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-10px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1200px) {
    .trainings-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        margin-top: 15px;
        padding: 15px 0;
    }
    
    .filter-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-chips {
        justify-content: center;
    }
    
    .trainings-grid {
        grid-template-columns: 1fr;
    }
    
    .video-modal-content {
        margin: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}
