/*
Trainer Styles - Default
Clean redesigned trainer cards with proper structure
Matching time-table section background
*/

/* Trainers List Section - Match Time Table Background */
.trainers-list {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    background-image: none !important; /* Override Sanja's background image */
    padding: 60px 0 !important;
    position: relative;
    overflow: hidden;
}

/* Last Section Styling - Additional margin when it's the last section */
.trainers-section.last-section {
    margin-bottom: 0px !important;
    padding-bottom: 80px !important;
}

.trainers-section.last-section .container {
    position: relative;
}

.trainers-section.last-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* Background Pattern - Same as Time Table */
.trainers-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(74, 85, 104, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(160, 174, 192, 0.03) 0%, transparent 50%);
    z-index: 1;
}

/* Trainers Header Card - Clean Structure */
.trainers-header-card {
    background: #fff !important;
    border-radius: 15px !important;
    padding: 40px !important;
    text-align: center !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 40px !important;
    position: relative;
    z-index: 2;
}

.trainers-title {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: #1a202c !important; /* Darker black */
    margin: 0 0 20px 0 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important; /* Big letters */
    letter-spacing: 1px !important;
}

.trainers-title b {
    color: #2d3748 !important; /* Dark blue-gray instead of red */
}

.trainers-description {
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    color: #4a5568 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* Trainer Card - Same structure as School Card */
.trainer-card {
    background: #fff !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 0 !important;
    width: calc(33.333% - 14px) !important; /* 3 columns with gap */
    min-width: 280px !important;
}

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

/* Trainer Card Image */
.trainer-card-img {
    position: relative;
    overflow: hidden;
    height: 320px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trainer-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top !important;
    transition: transform 0.3s ease !important;
}

/* Additional override for trainer cards in trainers list */
.trainers-list-wrapper .trainer-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top !important;
    max-width: none !important;
}

.trainer-card:hover .trainer-card-img img {
    transform: scale(1.05) !important;
}

/* Trainer Card Logo Fallback */
.trainer-card-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

/* Ensure logo is perfectly centered */
.trainer-card-logo-fallback .trainer-logo {
    max-width: 120px !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
}

.trainer-logo {
    max-width: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    z-index: 2;
    position: relative;
}

.trainer-logo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px 15px 15px;
    text-align: center;
}

.trainer-logo-text {
    color: #fff !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Trainer Card Content */
.trainer-card-content {
    padding: 20px !important;
    position: relative;
}

.volleyball-icon {
    width: 30px;
    height: 30px;
    background: #e53e3e;
    border-radius: 50%;
    margin-bottom: 15px;
    position: relative;
}

.volleyball-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
}

.trainer-card-title {
    margin: 0 0 10px 0 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
}

.trainer-card-title a {
    color: #2d3748 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.trainer-card-title a:hover {
    color: #e53e3e !important;
}

.trainer-card-description {
    color: #718096 !important;
    font-size: 0.95rem !important;
    margin-bottom: 15px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
}

.trainer-card-btn {
    display: inline-block !important;
    background: #e53e3e !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.trainer-card-btn:hover {
    background: #c53030 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3) !important;
}

.trainer-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(229, 62, 62, 0.2);
}

/* Trainer Fallback Logo - Clean Design */
.trainer-fallback-logo {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); /* Light background */
    position: relative;
    overflow: visible; /* Show logo properly */
    margin-bottom: 0;
    border-radius: 20px 20px 0 0; /* Match card radius */
}

/* Remove complex animations that hide the logo */

.trainer-logo {
    max-width: 120px; /* Even larger logo */
    max-height: 120px; /* Even larger logo */
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    position: relative;
    z-index: 10; /* Higher z-index */
    opacity: 1; /* Full opacity */
    transition: transform 0.3s ease; /* Simple transition */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.trainer-item:hover .trainer-logo {
    transform: scale(1.05); /* Simple scale */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Trainer Info Section - Override Sanja's styles */
.trainer-item-info {
    padding: 25px 20px !important;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%) !important;
    position: relative;
    border-top: none !important; /* Override Sanja's border-top: 8px solid */
    max-width: none !important; /* Override Sanja's max-width: 100% */
    width: auto !important; /* Override Sanja's width: 461px */
    margin-top: 0 !important; /* Ensure no margin between logo and info */
}

.trainer-item-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e53e3e, #c53030, #d69e2e);
}

.trainer-item-info h5 {
    margin: 0 0 8px 0 !important;
    font-family: 'Playfair Display', serif !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    line-height: 1.3 !important;
    text-transform: none !important; /* Override Sanja's uppercase */
}

.trainer-item-info h5 span {
    position: relative;
    display: inline-block;
    color: #2d3748 !important; /* Override Sanja's color: #111 !important */
    text-transform: none !important; /* Override Sanja's capitalize */
}

.trainer-item-info p {
    margin: 0 !important;
    color: #718096 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Hover Effects */
.trainer-item:hover .trainer-fallback-logo {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.trainer-item:hover .trainer-item-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.trainer-item:hover .trainer-item-info h5 {
    color: #e53e3e;
}

/* Floating Elements */
.trainer-item::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 4;
    opacity: 0;
    transition: all 0.3s ease;
}

.trainer-item:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

/* Mobile Responsive - Clean Structure */
@media (max-width: 768px) {
    .trainers-list {
        padding: 40px 0 !important;
    }
    
    .trainers-header-card {
        padding: 25px !important;
        margin-bottom: 30px !important;
    }
    
    .trainers-title {
        font-size: 2rem !important;
        margin-bottom: 15px !important;
        letter-spacing: 0.5px !important;
    }
    
    .trainers-description {
        font-size: 1.1rem !important;
    }
    
    .trainer-item {
        border-radius: 15px !important;
        width: 100% !important; /* Override Sanja's width: 48% */
    }
    
    .trainer-fallback-logo {
        height: 180px;
    }
    
    .trainer-logo {
        max-width: 80px; /* Slightly smaller on mobile */
        max-height: 80px;
    }
    
    .trainer-card {
        width: calc(50% - 10px) !important; /* 2 columns on tablet */
        min-width: 250px !important;
    }
    
    .trainers-list-wrapper {
        gap: 15px !important;
    }
    
    .trainer-item-info {
        padding: 20px 15px;
    }
    
    .trainer-item-info h5 {
        font-size: 1.2rem;
    }
    
    .trainer-item-info p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .trainers-list {
        padding: 30px 0 !important;
    }
    
    .trainers-header-card {
        padding: 20px !important;
        margin-bottom: 25px !important;
    }
    
    .trainers-title {
        font-size: 1.8rem !important;
        margin-bottom: 12px !important;
        letter-spacing: 0.3px !important;
    }
    
    .trainers-description {
        font-size: 1rem !important;
    }
    
    .trainer-item {
        border-radius: 12px !important;
        width: 100% !important; /* Override Sanja's width: 30% */
    }
    
    .trainer-fallback-logo {
        height: 250px;
    }
    
    .trainer-logo {
        max-width: 90px;
        max-height: 90px;
    }
    
    .trainer-card {
        width: 100% !important; /* Single column on mobile */
        min-width: 280px !important;
    }
    
    .trainers-list-wrapper {
        gap: 15px !important;
    }
    
    .trainer-item-info {
        padding: 18px 12px;
    }
    
    .trainer-item-info h5 {
        font-size: 1.1rem;
    }
    
    .trainer-item-info p {
        font-size: 0.85rem;
    }
    
    .trainer-item:hover {
        transform: translateY(-5px);
    }
}

/* Trainers List Wrapper - Same as School Group */
.trainers-list-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Trainer Images Styling - Override Sanja's fixed dimensions */
.trainer-item img {
    width: 100% !important;
    height: 320px !important; /* Match fallback logo height */
    object-fit: cover !important;
    object-position: top !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    filter: brightness(0.9) contrast(1.1) !important;
    max-width: none !important; /* Override Sanja's width: 461px */
    margin-bottom: 0 !important; /* Ensure no margin */
}

/* Override Sanja's styles with higher specificity */
.trainers-list-wrapper .trainer-item img {
    width: 100% !important;
    height: 320px !important;
    object-fit: cover !important;
    object-position: top !important;
    max-width: none !important;
}

/* Even more specific override for all trainer images */
.trainers-section .trainer-item img,
.trainers-section .trainer-card img,
.trainers-list-wrapper .trainer-item img,
.trainers-list-wrapper .trainer-card img {
    width: 100% !important;
    height: 320px !important;
    object-fit: cover !important;
    object-position: top !important;
    max-width: none !important;
}

/* Ultimate override - highest specificity to beat all other CSS */
.trainers-section .trainers-list-wrapper .trainer-item img,
.trainers-section .trainers-list-wrapper .trainer-card img,
.trainers-section .trainers-list-wrapper .trainer-card .trainer-card-img img {
    width: 100% !important;
    height: 320px !important;
    object-fit: cover !important;
    object-position: top !important;
    max-width: none !important;
    max-height: none !important;
}

.trainer-item:hover img {
    transform: scale(1.05);
    filter: brightness(1) contrast(1.2);
}

/* Animation for fallback logo */
.trainer-fallback-logo {
    animation: trainerFallbackFadeIn 0.6s ease-out;
}

@keyframes trainerFallbackFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .trainer-fallback-logo {
        background: linear-gradient(135deg, #2d3748, #4a5568);
    }
    
    .trainer-item:hover .trainer-fallback-logo {
        background: linear-gradient(135deg, #4a5568, #718096);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .trainer-fallback-logo {
        background: #fff;
        border: 2px solid #000;
    }
    
    .trainer-logo {
        opacity: 1;
    }
}
