/* Cursos Enhanced Styles - Modern Layout */

/* Header Section - Consistent with Espacios */
#contacto {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#contacto .block-heading h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

#contacto .block-heading p {
    font-size: 1.3rem;
    color: #ffffff;
    opacity: 0.9;
    margin: 0;
}

/* Cursos Section */
.cursos-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Breadcrumb Styles - Consistent with Espacios */
.breadcrumb {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.breadcrumb-item a {
    color: #163f90;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: #077ce7;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 600;
}

/* Filtro de Categorías */
.categorias-filter {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(22, 63, 144, 0.1);
    margin-bottom: 3rem;
}

.filter-header {
    margin-bottom: 1rem;
}

.filter-header h4 {
    color: #163f90;
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.filter-header i {
    margin-right: 0.5rem;
    color: #1cc765;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #163f90 0%, #1cc765 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22, 63, 144, 0.3);
}

.filter-btn.active {
    background: linear-gradient(135deg, #163f90 0%, #1cc765 100%);
    color: #ffffff;
    border-color: #163f90;
    box-shadow: 0 4px 15px rgba(22, 63, 144, 0.3);
}

.filter-btn i {
    font-size: 0.9rem;
    color: #163f90;
    font-weight: 600;
}

.filter-btn:hover i {
    color: #ffffff;
}

.filter-btn.active i {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 576px) {
    .filter-buttons {
        flex-direction: column;
    }

    .filter-btn {
        justify-content: center;
    }
}

/* Section Groups */
.cursos-section-group {
    margin-bottom: 4rem;
}

/* New curso layout styles */
.curso-dates {
    margin: 1.5rem 0;
}

.curso-date-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(22, 63, 144, 0.05);
    border-radius: 8px;
}

.date-info {
    color: #495057;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-info i {
    color: #1cc765;
    font-size: 0.95rem;
}

.date-info strong {
    color: #163f90;
    font-weight: 600;
}

.curso-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.curso-location i {
    color: #1cc765;
}

.curso-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.curso-btn-secondary {
    background: #6c757d;
    border: 2px solid #6c757d;
}

.curso-btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

@media (max-width: 576px) {
    .curso-date-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .curso-actions {
        flex-direction: column;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.section-title {
    color: #163f90;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-title i {
    font-size: 2rem;
    color: #1cc765;
}

.section-subtitle {
    color: #666;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 400;
}

/* Cursos Grid */
.cursos-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Curso Card */
.curso-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(22, 63, 144, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.curso-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(22, 63, 144, 0.15);
}

/* Curso Card States */
.curso-card.curso-proximo {
    border-color: #1cc765;
    box-shadow: 0 4px 20px rgba(28, 199, 101, 0.1);
}

.curso-card.curso-proximo:hover {
    box-shadow: 0 12px 40px rgba(28, 199, 101, 0.2);
}

.curso-card.curso-en-ejecucion {
    border-color: #ffc107;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.1);
}

.curso-card.curso-en-ejecucion:hover {
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.2);
}

.curso-card.curso-ejecutado {
    border-color: #6c757d;
    box-shadow: 0 4px 20px rgba(108, 117, 125, 0.1);
    opacity: 0.8;
}

.curso-card.curso-ejecutado:hover {
    box-shadow: 0 12px 40px rgba(108, 117, 125, 0.15);
    opacity: 1;
}

/* Curso Image Container */
.curso-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.curso-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.curso-card:hover .curso-image {
    transform: scale(1.05);
}

/* Course Tags */
.curso-tags {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    align-items: flex-end;
    z-index: 10;
}

.curso-tag {
    background: rgba(22, 63, 144, 0.9);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.curso-tag.modalidad {
    background: rgba(28, 199, 101, 0.9);
}

.curso-tag.fecha {
    background: rgba(22, 63, 144, 0.9);
}

/* Status Tags */
.curso-tag.status {
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.curso-tag.status-proximo {
    background: rgba(28, 199, 101, 0.95);
    animation: pulse-green 2s infinite;
}

.curso-tag.status-en-ejecucion {
    background: rgba(255, 193, 7, 0.95);
    color: #000;
    animation: pulse-yellow 2s infinite;
}

.curso-tag.status-ejecutado {
    background: rgba(108, 117, 125, 0.9);
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 5px rgba(28, 199, 101, 0.5); }
    50% { box-shadow: 0 0 15px rgba(28, 199, 101, 0.8); }
}

@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 193, 7, 0.8); }
}

/* Curso Content */
.curso-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.curso-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #163f90;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.curso-title a {
    color: #163f90;
    text-decoration: none;
    transition: all 0.3s ease;
}

.curso-title a:hover {
    color: #1cc765;
    text-decoration: none;
}

.curso-introduction {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Curso Details */
.curso-details {
    margin-bottom: 1.5rem;
}

.curso-detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #333;
}

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

.curso-detail-item i {
    color: #163f90;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.curso-detail-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Curso Action */
.curso-action {
    margin-top: auto;
    text-align: right;
}

.curso-btn {
    background: linear-gradient(135deg, #163f90 0%, #1cc765 100%);
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(22, 63, 144, 0.3);
}

.curso-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 63, 144, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.curso-btn i {
    font-size: 1rem;
}

/* Button Variants */
.curso-btn-primary {
    background: linear-gradient(135deg, #1cc765 0%, #163f90 100%);
    box-shadow: 0 4px 15px rgba(28, 199, 101, 0.3);
}

.curso-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(28, 199, 101, 0.4);
}

.curso-btn-secondary {
    background: linear-gradient(135deg, #163f90 0%, #1cc765 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(22, 63, 144, 0.3);
}

.curso-btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(22, 63, 144, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
}

.curso-btn-muted {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.curso-btn-muted:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Empty State */
.empty-cursos {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border-radius: 16px;
    margin: 2rem 0;
}

.empty-cursos h3 {
    color: #163f90;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.empty-cursos p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (min-width: 576px) {
    .cursos-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .cursos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cursos-header h1 {
        font-size: 3.5rem;
    }
}

@media (min-width: 992px) {
    .cursos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (min-width: 1200px) {
    .cursos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

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

.curso-card {
    animation: fadeInUp 0.6s ease forwards;
}

.curso-card:nth-child(1) { animation-delay: 0.1s; }
.curso-card:nth-child(2) { animation-delay: 0.2s; }
.curso-card:nth-child(3) { animation-delay: 0.3s; }
.curso-card:nth-child(4) { animation-delay: 0.4s; }
.curso-card:nth-child(5) { animation-delay: 0.5s; }
.curso-card:nth-child(6) { animation-delay: 0.6s; }

/* Hover effects for interactive elements */
.curso-detail-item:hover i {
    color: #1cc765;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Loading state for images */
.curso-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.curso-image[src] {
    animation: none;
    background: none;
}

/* Additional Mobile Responsive Styles for Header */
@media (max-width: 576px) {
    /* Header responsive */
    #contacto {
        min-height: 300px;
        padding: 2rem 0;
    }

    #contacto .block-heading h1 {
        font-size: 2rem !important;
    }

    #contacto .block-heading p {
        font-size: 1rem !important;
        padding: 0 1rem;
    }

    .cursos-section {
        margin-top: 2rem;
    }

    .breadcrumb {
        padding: 0.5rem 0;
        margin-bottom: 1.5rem;
    }

    /* Section headers mobile */
    .section-header {
        margin-bottom: 2rem;
        padding: 1rem 0;
    }

    .section-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .section-title i {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Curso tags mobile */
    .curso-tags {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.3rem;
    }

    .curso-tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .curso-tag.status {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 768px) {
    #contacto {
        min-height: 350px;
    }

    #contacto .block-heading h1 {
        font-size: 2.5rem !important;
    }

    #contacto .block-heading p {
        font-size: 1.1rem !important;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-title i {
        font-size: 1.7rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
    }
}
