/**
 * Coaches Section - Dynamic Loading Styles
 */

/* Loading state */
.coaches-grid.loading {
    min-height: 400px;
    position: relative;
}

.coaches-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.coaches-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF9933;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.coaches-loading p {
    color: #666;
    font-size: 16px;
}

/* Coach card animations */
.coach-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.coach-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Coach contact info */
.coach-contact {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.coach-contact a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #004E89;
    text-decoration: none;
    transition: color 0.3s ease;
}

.coach-contact a:hover {
    color: #FF9933;
}

/* Sport-specific styling */
.coach-card[data-sport="cricket"] {
    border-top: 3px solid #4CAF50;
}

.coach-card[data-sport="tennis"] {
    border-top: 3px solid #2196F3;
}

.coach-card[data-sport="taekwondo"] {
    border-top: 3px solid #FF6B35;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .coach-contact {
        flex-direction: column;
        gap: 10px;
    }
    
    .coaches-loading .spinner {
        width: 40px;
        height: 40px;
    }
}

/* Fade-in animation for coach cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coach-card.animate {
    animation: fadeInUp 0.5s ease forwards;
}

/* Error state */
.coaches-error {
    text-align: center;
    padding: 40px;
    color: #666;
}

.coaches-error button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #FF9933;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.coaches-error button:hover {
    background: #e68a2e;
}

/* Coach image area with consistent aspect ratio */
.coach-card .coach-image {
    aspect-ratio: 4 / 3; /* uniform card image area */
    width: 100%;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.coach-card .coach-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;           /* fill neatly, crop edges if needed */
    object-position: center 35%; /* nudge up to keep faces in view */
    display: block;
}

@media (max-width: 420px) {
    .coach-card .coach-image {
        aspect-ratio: 16 / 9; /* wider on tiny screens */
    }
}
