/**
 * EM Course Orchestrator Styles
 * Styled to match Powder theme with Estude Matemática red palette
 *
 * @package EM_Course_Orchestrator
 * @since 1.0.0
 */

/* ============================================
   Course Catalog - Grid View
   ============================================ */

.emco-course-catalog--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    max-width: 100%;
}

/* Ensure 3-column maximum on wide screens */
@media (min-width: 1200px) {
    .emco-course-catalog--grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.emco-course-card--grid {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.emco-course-card--grid:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.emco-course-card__image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.emco-course-card__content {
    padding: 1.5rem;
}

.emco-course-card__category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #7f1d1d;
    color: #fff;
    border-radius: 3px;
}

.emco-course-card__title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: #333;
}

.emco-course-card__cohort-info {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.emco-course-card__status {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: #999;
}

.emco-course-card__description {
    margin: 0 0 1.5rem;
    color: #666;
    line-height: 1.6;
}

.emco-course-card__button {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #b91c1c;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.3s ease;
    box-sizing: border-box;
}

.emco-course-card__button:hover {
    background: #991b1b;
}

/* ============================================
   Course Catalog - List View
   ============================================ */

.emco-course-catalog--list {
    padding: 2rem 0;
}

.emco-course-card--list {
    display: flex;
    gap: 2rem;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.emco-course-card--list .emco-course-card__image {
    flex-shrink: 0;
    width: 200px;
}

.emco-course-card--list .emco-course-card__image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.emco-course-card--list .emco-course-card__content {
    flex: 1;
    padding: 0;
}

/* ============================================
   Cohort List Page
   ============================================ */

.emco-cohort-list-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.emco-cohort-list-header {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e5e5e5;
}

.emco-cohort-list-header__image {
    flex-shrink: 0;
    width: 300px;
}

.emco-cohort-list-header__image img {
    width: 100%;
    border-radius: 8px;
}

.emco-cohort-list-header__content {
    flex: 1;
}

.emco-cohort-list-header__title {
    margin: 0 0 1rem;
    font-size: 2.5rem;
    color: #333;
}

.emco-cohort-list-header__description {
    color: #666;
    line-height: 1.8;
    font-size: 1.1rem;
}

.emco-cohort-list__title {
    margin: 0 0 2rem;
    font-size: 2rem;
    color: #333;
}

.emco-cohort-list__items {
    display: grid;
    gap: 1.5rem;
}

.emco-cohort-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #b91c1c;
}

.emco-cohort-card--upcoming {
    border-left-color: #ef4444;
}

.emco-cohort-card--active {
    border-left-color: #46b450;
}

.emco-cohort-card--completed {
    border-left-color: #999;
}

.emco-cohort-card__content {
    flex: 1;
}

.emco-cohort-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: #333;
}

.emco-cohort-card__meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.emco-cohort-card__date {
    color: #666;
}

.emco-cohort-card__status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.emco-cohort-card__status--upcoming {
    background: #fee2e2;
    color: #7f1d1d;
}

.emco-cohort-card__status--active {
    background: #ecf7ed;
    color: #29853b;
}

.emco-cohort-card__status--completed {
    background: #f5f5f5;
    color: #666;
}

.emco-cohort-card__button {
    padding: 0.75rem 1.5rem;
    background: #b91c1c;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.emco-cohort-card__button:hover {
    background: #991b1b;
}

/* ============================================
   Single Course Page
   ============================================ */

.emco-single-course-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.emco-single-course {
    background: #fff;
}

/* ============================================
   SINGLE COURSE PAGE - HERO SECTION
   ============================================ */

.emco-single-course-main {
    background: #fff;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: static;
    overflow-x: hidden;
}

.emco-course-hero {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: #fff;
    padding: 4rem 2rem;
    /* Ensure full width */
    width: 100%;
    margin: 0;
}

.emco-course-hero__container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.emco-course-hero__content {
    order: 1;
}

.emco-course-category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.emco-course-hero__title {
    margin: 0 0 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.emco-course-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.emco-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
}

.emco-hero-meta-item svg {
    opacity: 0.9;
    flex-shrink: 0;
}

.emco-hero-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.emco-hero-status--upcoming {
    background: #fef3c7;
    color: #92400e;
}

.emco-hero-status--active {
    background: #d1fae5;
    color: #065f46;
}

.emco-course-hero__cta {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: #fff;
    color: #7f1d1d;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.emco-course-hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #7f1d1d;
}

.emco-course-hero__image {
    order: 2;
}

.emco-course-hero__image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Desktop layout - image on right */
@media (min-width: 768px) {
    .emco-course-hero {
        padding: 5rem 2rem;
    }
    
    .emco-course-hero__container {
        grid-template-columns: 1.2fr 1fr;
        gap: 4rem;
    }
    
    .emco-course-hero__content {
        order: 1;
    }
    
    .emco-course-hero__image {
        order: 2;
    }
    
    .emco-course-hero__title {
        font-size: 3.5rem;
    }
}

/* ============================================
   SINGLE COURSE PAGE - DESCRIPTION SECTION
   ============================================ */

.emco-course-description {
    padding: 4rem 2rem;
    background: #f9fafb;
    /* Ensure full width */
    width: 100%;
    margin: 0;
}

.emco-course-description__container {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.125rem;
    color: #374151;
}

.emco-course-description__container p {
    margin-bottom: 1.5rem;
}

.emco-course-description__container h2,
.emco-course-description__container h3 {
    margin: 2.5rem 0 1rem;
    color: #1f2937;
    line-height: 1.3;
}

.emco-course-description__container h2 {
    font-size: 2rem;
    font-weight: 700;
}

.emco-course-description__container h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.emco-course-description__container ul,
.emco-course-description__container ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.emco-course-description__container li {
    margin-bottom: 0.75rem;
}

/* ============================================
   SINGLE COURSE PAGE - COHORT HISTORY
   ============================================ */

.emco-cohort-history {
    padding: 4rem 2rem;
    background: #fff;
    /* Ensure full width */
    width: 100%;
    margin: 0;
}

.emco-cohort-history__container {
    max-width: 1200px;
    margin: 0 auto;
}

.emco-cohort-history__header {
    margin-bottom: 3rem;
    text-align: center;
}

.emco-cohort-history__header h2 {
    margin: 0 0 0.75rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
}

.emco-cohort-history__header p {
    margin: 0;
    font-size: 1.125rem;
    color: #6b7280;
}

.emco-cohort-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

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

@media (min-width: 1024px) {
    .emco-cohort-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   COHORT CARDS
   ============================================ */

.emco-cohort-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.emco-cohort-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #b91c1c;
}

.emco-cohort-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.emco-cohort-card__title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1f2937;
}

.emco-cohort-card__status {
    flex-shrink: 0;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emco-cohort-card__status--upcoming {
    background: #fef3c7;
    color: #92400e;
}

.emco-cohort-card__status--active {
    background: #d1fae5;
    color: #065f46;
}

.emco-cohort-card__status--completed {
    background: #f3f4f6;
    color: #6b7280;
}

.emco-cohort-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.emco-cohort-card__date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9375rem;
}

.emco-cohort-card__date svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.emco-cohort-card__version {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.emco-cohort-card__version--live {
    background: #fee2e2;
    color: #7f1d1d;
}

.emco-cohort-card__version--recorded {
    background: #f3f4f6;
    color: #374151;
}

.emco-cohort-card__button {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #b91c1c;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.emco-cohort-card__button:hover {
    background: #991b1b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
    color: #fff;
}

.emco-cohort-card__button--disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.emco-cohort-card__button--disabled:hover {
    background: #e5e7eb;
    transform: none;
    box-shadow: none;
}

/* Shortcode version styles */
.emco-course-page-shortcode .emco-cohort-history h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.emco-course-page-shortcode .emco-no-cohorts {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* ============================================
   Empty States
   ============================================ */

.emco-no-courses,
.emco-no-cohorts {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.emco-not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.emco-not-found h1 {
    margin: 0 0 1rem;
    color: #333;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .emco-course-catalog--grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .emco-course-card--list {
        flex-direction: column;
    }
    
    .emco-course-card--list .emco-course-card__image {
        width: 100%;
    }
    
    .emco-cohort-list-header {
        flex-direction: column;
    }
    
    .emco-cohort-list-header__image {
        width: 100%;
    }
    
    .emco-cohort-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .emco-cohort-card__button {
        width: 100%;
        text-align: center;
    }
}
