/* Cursos Page Styles - Matching Design */

.main-content.cursos-main {
    padding-top: 140px;
    align-items: flex-start;
    min-height: 100vh;
}

.cursos-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Header */
.cursos-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.cursos-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.cursos-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 20px 0;
}

/* Search Header Button */
.search-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.search-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.search-header-btn .material-symbols-outlined {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.9);
}

/* Category Tabs */
.category-tabs-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    gap: 12px;
    width: 100%;
    position: relative;
}

/* Container for sticky tab + scrollable tabs */
.category-tabs-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px;
    overflow: hidden;
    flex: 1;
    max-width: 100%;
    position: relative;
}

/* Sticky "Todos" tab */
.category-tab-sticky {
    position: sticky;
    left: 0;
    z-index: 10;
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    margin-right: 8px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.category-tab-sticky.active {
    background: rgba(30, 30, 30, 0.95) !important;
}

.category-nav-arrow {
    display: none; /* Hidden by default, shown on desktop */
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.category-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.1);
}

.category-nav-arrow:active {
    transform: scale(0.95);
}

.category-nav-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

.category-nav-arrow .material-symbols-outlined {
    font-size: 24px;
}

/* Show arrows on desktop */
@media (min-width: 769px) {
    .category-nav-arrow {
        display: flex;
    }
}

/* Category Search Modal - Improved Design */
.category-search-modal {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 32px 28px;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.search-modal-header .material-symbols-outlined {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.8);
}

.search-modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-input-wrapper .material-symbols-outlined {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.search-input-wrapper:focus-within .material-symbols-outlined {
    color: rgba(255, 255, 255, 0.9);
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    padding-right: 4px;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.search-result-icon {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.search-result-icon .material-symbols-outlined {
    font-size: 24px;
}

.search-result-icon i {
    font-size: 24px;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.search-result-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.search-empty .material-symbols-outlined {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.search-empty p {
    font-size: 15px;
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    flex: 1;
    /* Smooth scroll */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-right: 8px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent tabs from shrinking */
}

.category-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.category-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.category-tab .material-symbols-outlined {
    font-size: 18px;
}

.category-tab i {
    font-size: 16px;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.category-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Cursos Grid */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Curso Card - Matching Image Design */
.curso-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.curso-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Card Image */
.curso-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(30, 30, 30, 1), rgba(20, 20, 20, 1));
    overflow: hidden;
}

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

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

.curso-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}

.curso-image-placeholder .material-symbols-outlined {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.2);
}

/* Badges */
.curso-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-free {
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-free .material-symbols-outlined {
    font-size: 12px;
}

.badge-new {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-new .material-symbols-outlined {
    font-size: 12px;
}

.badge-price {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 600;
}

/* Card Content */
.curso-content {
    padding: 16px;
}

.curso-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.curso-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.curso-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.curso-duration .material-symbols-outlined {
    font-size: 16px;
}

.btn-iniciar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-iniciar:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-iniciar .material-symbols-outlined {
    font-size: 16px;
}

/* Botón Comprar (WhatsApp) */
.btn-comprar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-comprar:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-comprar .material-symbols-outlined {
    font-size: 16px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state .material-symbols-outlined {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

.empty-state.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content.cursos-main {
        padding-top: 80px;
    }

    .cursos-container {
        padding: 0 16px 40px;
    }

    .cursos-header {
        margin-bottom: 24px;
    }

    .cursos-title {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .cursos-subtitle {
        font-size: 0.9rem;
    }

    .category-tabs-wrapper {
        margin-bottom: 24px;
        gap: 8px;
    }

    .category-tabs-container {
        padding: 6px;
        border-radius: 16px;
    }

    .category-tab-sticky {
        margin-right: 4px;
    }

    .category-nav-arrow {
        display: none !important;
    }

    .category-tabs {
        gap: 6px;
        padding-right: 6px;
    }

    .category-tab {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 12px;
    }
    
    /* Hide search text on mobile */
    .search-header-btn .search-text {
        display: none;
    }
    
    .search-header-btn {
        padding: 10px 14px;
    }

    .cursos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .curso-card {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .cursos-header {
        margin-bottom: 20px;
    }

    .cursos-title {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .category-tabs-wrapper {
        margin-bottom: 20px;
        gap: 6px;
    }

    .category-tabs-container {
        padding: 6px;
    }

    .category-tab-sticky {
        margin-right: 2px;
    }

    .category-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .category-tab .material-symbols-outlined,
    .category-tab i {
        font-size: 14px;
    }

    .tab-count {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }
}


/* Save Button */
.btn-save {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.btn-save:hover {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    transform: scale(1.1);
}

.btn-save.saved {
    background: #000;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-save .material-symbols-outlined {
    font-size: 20px;
}


/* Alert Modal - Glass Effect with Black & White */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.alert-modal {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.modal-close-btn .material-symbols-outlined {
    font-size: 20px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 28px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.alert-icon .material-symbols-outlined {
    font-size: 36px;
    color: #fff;
}

.alert-icon.warning .material-symbols-outlined {
    color: #fff;
}

.alert-icon.error .material-symbols-outlined {
    color: #fff;
}

.alert-icon.success .material-symbols-outlined {
    color: #fff;
}

.alert-modal h3 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.alert-modal p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.alert-modal .btn-primary {
    flex: 1;
    padding: 16px 20px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.alert-modal .btn-primary:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

.alert-modal .btn-primary:active {
    transform: translateY(0);
}

.alert-modal .btn-secondary {
    flex: 1;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.alert-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.alert-modal .btn-secondary:active {
    transform: scale(0.98);
}

/* Responsive buttons */
@media (max-width: 480px) {
    .modal-buttons {
        flex-direction: column;
    }
    
    .alert-modal .btn-primary,
    .alert-modal .btn-secondary {
        width: 100%;
    }
}
