﻿/* ========================================
   INDEX COURSES SECTION (REFINED & BRUTAL)
   ======================================== */

/* Container Layout (Flex for better centering of few itemás) */
.courses-index-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
}

/* Card Base */
.course-card {
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0px;
    /* Fully Brutal (Square) */
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    /* Prevent over-stretching */
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    border-color: var(--secondary-gold);
}

/* Image Area */
.course-image {
    width: 100%;
    height: 240px;
    /* Taller image */
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    filter: grayscale(20%) contrast(1.1);
    /* Cinematic look */
}

.course-card:hover .course-image img {
    transform: scale(1.1);
    filter: grayscale(0%) contrast(1.2);
}

.course-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(2px);
}

.course-card:hover .course-overlay {
    opacity: 1;
}

/* Play/View Button */
.play-button {
    width: 70px;
    height: 70px;
    background: rgba(198, 168, 124, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    /* Keep circular for play button convention */
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.5) rotate(-180deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: black;
}

.course-card:hover .play-button {
    transform: scale(1) rotate(0deg);
}

/* Content */
.course-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);
}

.course-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--secondary-gold);
    margin-bottom: 15px;
    opacity: 0.8;
}

.course-content h3 {
    font-family: var(--font-heading);
    color: white;
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.course-card:hover .course-content h3 {
    color: var(--secondary-gold);
}

.course-desc {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 300;
}

/* Divider Line */
.card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    width: 100%;
}

/* Footer & Price */
.course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price-container {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.price {
    color: white;
    font-weight: 600;
    font-size: 1.3rem;
    font-family: var(--font-body);
}

/* Action Link */
.action-link {
    color: var(--secondary-gold);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    position: relative;
    padding-bottom: 3px;
    transition: all 0.3s ease;
}

.action-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--secondary-gold);
    transition: width 0.3s ease;
}

.course-card:hover .action-link::after {
    width: 100%;
}

.course-card:hover .action-link {
    color: white;
}

/* Badges */
.badge-virtual {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    background: #000;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Loaders */
.loader-container {
    padding: 80px;
    text-align: center;
    width: 100%;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--secondary-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .courses-index-grid {
        gap: 30px;
    }

    .course-card {
        max-width: 100%;
        /* Full width on mobile */
    }

    .course-image {
        height: 200px;
    }
}
