/* =============================================
   SECTION CARDS (Homepage Navigation)
   ============================================= */

.sections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    aspect-ratio: 4/5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.6s ease;
}

/* =============================================
   WORKSHOP CARDS (Inmersive & Filterable)
   ============================================= */
.workshop-card {
    position: relative;
    text-decoration: none;
    color: var(--text-primary);
    aspect-ratio: 4/5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Removed overflow: hidden so shadows and halos can pop out! */
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    opacity: 0;
}

/* Hide aula list on desktop */
.aula-workshop-list {
    display: none;
}

/* Beautiful external colored glow */
.workshop-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--card-color, #3b82f6);
    box-shadow: 0 10px 30px var(--card-color, #3b82f6);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s ease;
}

/* Base shadow */
.workshop-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 0;
    transition: opacity 0.4s ease;
}

.workshop-card:hover {
    transform: perspective(800px) translateY(-8px) rotateX(2deg);
}

.workshop-card:hover::before {
    opacity: 0.2; /* Beautiful colored halo */
}

.workshop-card:hover::after {
    opacity: 1; /* Dark shadow thickens underneath */
}

/* Keyframes for the elegant entrance animation */
@keyframes filterEntrance {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(15px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.workshop-card.anim-show {
    animation: filterEntrance 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.workshop-card.hidden {
    display: none !important;
}

/* The true clipping boundary */
.workshop-card-inner-box {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-deep, #071022);
    z-index: 1; /* Keep above external shadows */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Bottom color strip that can be thicker on hover without being clipped! */
.workshop-card-glow-line {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-color, #3b82f6);
    z-index: 10;
    transition: height 0.3s ease, margin 0.3s ease, background-color 0.3s ease;
}

.workshop-card:hover .workshop-card-glow-line {
    height: 6px;
}

.workshop-card .section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.7s ease, opacity 0.4s ease;
    opacity: 0.85; 
}

.workshop-card:hover .section-bg {
    transform: scale(1.08);
    opacity: 1;
}

.card-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top, 
        rgba(4, 13, 31, 0.98) 0%, 
        rgba(4, 13, 31, 0.8) 40%, 
        rgba(4, 13, 31, 0.2) 75%, 
        transparent 100%
    );
    z-index: 2;
    transition: background 0.4s ease;
}

.workshop-card:hover .card-gradient-overlay {
    background: linear-gradient(
        to top, 
        rgba(4, 13, 31, 0.95) 0%, 
        rgba(4, 13, 31, 0.7) 40%, 
        rgba(4, 13, 31, 0.1) 75%, 
        transparent 100%
    );
}

/* Old overlay removed to use card-gradient-overlay */
.workshop-card .section-overlay {
    display: none;
}

.workshop-card-content {
    position: relative;
    z-index: 3;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-end;
}

.workshop-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: auto; /* Pushes content to the bottom */
    width: 100%;
    justify-content: space-between;
}

.workshop-badge {
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.time-badge {
    background: rgba(4, 13, 31, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.category-badge {
    background: rgba(59, 130, 246, 0.15); /* fallback */
    background: color-mix(in srgb, var(--badge-color, #3b82f6) 20%, rgba(4, 13, 31, 0.85));
    color: var(--badge-color, #3b82f6);
    border: 1px solid rgba(59, 130, 246, 0.3); /* fallback */
    border: 1px solid color-mix(in srgb, var(--badge-color, #3b82f6) 40%, transparent);
}

.workshop-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1.2;
    margin-bottom: 0.6rem;
    color: white;
    text-wrap: balance;
    transition: color 0.3s ease;
}

.workshop-card:hover .workshop-card-title {
    color: var(--card-color, white);
}

.workshop-card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Features for Aulas large cards */
.card-icon-glass {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(4, 13, 31, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15); /* fallback */
    border: 1px solid color-mix(in srgb, var(--icon-color, white) 30%, transparent);
    color: var(--icon-color, white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.1);
    transition: transform 0.4s ease;
}

.card-icon-glass i {
    width: 22px;
    height: 22px;
}

.workshop-card:hover .card-icon-glass {
    transform: scale(1.1) rotate(5deg);
}

.card-cta-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: gap 0.3s ease;
}

.workshop-card:hover .card-cta-link {
    gap: 0.75rem;
}

.card-cta-link i {
    width: 18px;
    height: 18px;
}

/* =============================================
   PILLS FILTERS
   ============================================= */
.pills-filter-container {
    display: flex;
    flex-wrap: wrap; /* Wrap so users can see all options easily on mobile */
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.pills-filter-container::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-pill.active {
    background: var(--accent-blue);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* =============================================
   SMART GRID (Fully Responsive)
   ============================================= */
.smart-workshops-grid {
    display: grid;
    /* On mobile, this will fall back gracefully to 2 columns if < 300px, but 160px minmax ensures 2 columns on 375px screens */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .smart-workshops-grid {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
        gap: 1.25rem;
    }
    
    .smart-workshops-grid .workshop-card {
        aspect-ratio: auto; 
        min-height: 180px; /* Base compact size */
        display: flex;
    }

    .smart-workshops-grid .workshop-card .workshop-card-inner-box {
        position: relative;
        inset: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Use backdrop-filter on the overlay */
    .workshop-card .card-gradient-overlay {
        height: 100%;
        background: linear-gradient(135deg, rgba(4, 13, 31, 0.75) 0%, rgba(4, 13, 31, 0.4) 100%);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
    
    /* Keep the image sharp in the DOM, let the overlay blur it */
    .workshop-card .section-bg {
        filter: none;
        opacity: 0.9;
        transform: scale(1.02); /* slight scale to avoid edge bleeding */
    }
}

/* Base overlay for contrast */
.section-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(4, 13, 31, 0.95) 0%, rgba(4, 13, 31, 0.4) 60%, transparent 100%);
    z-index: 2;
}

/* Glass panel at the bottom */
.section-content {
    position: relative;
    z-index: 3;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.section-icon {
    width: 44px;
    height: 44px;
    background: rgba(4, 13, 31, 0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue, #3b82f6);
    margin-bottom: 0.5rem;
    position: absolute;
    top: -22px;
    right: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Icon specific colors for section cards */
.section-icon.icon-blue {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}
.section-icon.icon-amber {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}
.section-icon.icon-cyan {
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.3);
}
.section-icon.icon-green {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.section-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-blue, #3b82f6);
    font-weight: 600;
}

.section-meta i {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.section-card:hover .section-meta i {
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 1024px) {
    .sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-card {
        aspect-ratio: 16/9;
    }
}

@media (max-width: 768px) {
    .sections-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    /* Table View / List style for mobile */
    .section-card {
        aspect-ratio: auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        min-height: 80px;
        background: rgba(15, 23, 42, 0.6);
        border-radius: 16px;
    }

    .section-card .section-bg, 
    .section-card .section-overlay {
        display: none; /* Hide large images for table-view cards on mobile */
    }

    .section-content {
        padding: 0;
        background: transparent;
        border: none;
        backdrop-filter: none;
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }
    
    .section-icon {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 0;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: none;
    }

    /* Override mobile background based on color class */
    .section-icon.icon-blue { background: rgba(59, 130, 246, 0.15); }
    .section-icon.icon-amber { background: rgba(251, 191, 36, 0.15); }
    .section-icon.icon-cyan { background: rgba(6, 182, 212, 0.15); }
    .section-icon.icon-green { background: rgba(16, 185, 129, 0.15); }

    .section-text-group {
        display: flex;
        flex-direction: column;
        flex: 1;
        justify-content: center;
    }

    .section-title {
        font-size: 1.05rem;
        margin: 0;
    }

    .section-desc {
        display: none; /* Hide description to keep it compact */
    }

    .section-meta {
        margin-top: 0;
        font-size: 0; /* Hide text, keep icon */
    }
    
    .section-meta i {
        width: 18px;
        height: 18px;
        color: rgba(255,255,255,0.3);
    }
}

/* =============================================
   AULA HUB CARDS (Dynamic mobile list)
   ============================================= */
.aula-hub-card {
    aspect-ratio: 4/5;
    min-height: 320px;
}

.aula-card-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: auto;
    width: 100%;
}

.aula-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.aula-hub-title {
    font-size: 1.6rem;
    margin: 0;
}

@media (max-width: 768px) {
    .aula-hub-card {
        aspect-ratio: auto !important;
        min-height: auto !important;
        margin-bottom: 1rem;
    }
    .aula-hub-card .workshop-card-inner-box {
        position: relative;
        inset: auto;
        display: flex;
        flex-direction: column;
        border-radius: 20px;
        overflow: hidden;
        background: rgba(10, 15, 30, 0.4);
    }
    .aula-hub-card .section-bg {
        display: block !important;
        opacity: 0.4 !important;
        filter: blur(4px);
    }
    .aula-hub-card .card-gradient-overlay {
        display: block !important;
        background: linear-gradient(to bottom, rgba(4, 13, 31, 0.3) 0%, rgba(4, 13, 31, 0.8) 100%) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .aula-hub-card .workshop-card-content {
        padding: 1.5rem;
        position: relative;
        z-index: 5;
        width: 100%;
        display: block;
    }
    .aula-hub-card .aula-card-header-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .aula-hub-card .aula-card-title-group {
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
        flex: 1;
    }

    .aula-hub-card .aula-hub-title {
        font-size: 1.25rem !important;
        margin: 0 !important;
        color: white !important;
        line-height: 1.1;
    }

    .aula-hub-card .card-icon-glass {
        width: 38px !important;
        height: 38px !important;
        flex-shrink: 0;
        border-radius: 10px;
    }

    .aula-hub-card .card-icon-glass i {
        width: 18px !important;
        height: 18px !important;
    }

    .aula-hub-card .card-location-badge {
        display: flex !important;
        background: rgba(4, 13, 31, 0.85) !important;
        padding: 0.35rem 0.6rem !important;
        border-radius: 10px !important;
        font-size: 0.65rem !important;
        align-items: center;
        gap: 0.3rem;
        color: white;
        border: 1px solid rgba(255,255,255,0.15);
        backdrop-filter: blur(8px);
        margin-top: 0;
        flex-shrink: 0;
    }
    .aula-hub-card .aula-workshop-list {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 1.5rem;
        padding-left: 0.2rem;
    }
    .aula-workshop-item {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.9);
        line-height: 1.4;
    }
    .aula-workshop-item i {
        width: 14px;
        height: 14px;
        color: var(--card-color, #3b82f6);
        opacity: 0.8;
    }
    .aula-hub-card .desk-only-count {
        display: none;
    }
    .aula-hub-card .card-cta-link {
        display: flex !important;
        margin-top: 1rem;
        font-size: 0.85rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .aula-hub-card .workshop-card-glow-line {
        display: block !important;
    }
}
