/* ==========================================================================
   Meu Curso Online - Frontend Styles
   Mobile-first responsive design
   ========================================================================== */

/* Reset & Base */
.mco-curso-wrapper,
.mco-aula-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
    font-family: inherit;
    line-height: 1.6;
    color: #333;
}

@media (min-width: 768px) {
    .mco-curso-wrapper,
    .mco-aula-wrapper {
        padding: 30px;
        max-width: 1000px;
    }
}

/* Buttons */
.mco-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}

.mco-btn-primary {
    background: #3498db !important;
    color: #fff !important;
}

.mco-btn-primary:hover {
    background: #2980b9 !important;
    color: #fff !important;
}

.mco-btn-continue {
    background: #27ae60 !important;
    color: #fff !important;
    width: 100%;
    margin-top: 15px;
}

.mco-btn-continue:hover {
    background: #219a52 !important;
    color: #fff !important;
}

.mco-btn-complete {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 2px solid #ddd !important;
    width: 100%;
}

.mco-btn-complete:hover {
    background: #e8e8e8 !important;
    border-color: #ccc !important;
    color: #333 !important;
}

.mco-btn-complete.mco-completed {
    background: #27ae60 !important;
    color: #fff !important;
    border-color: #27ae60 !important;
}

.mco-btn-complete.mco-completed:hover {
    background: #219a52 !important;
    border-color: #219a52 !important;
    color: #fff !important;
}

.mco-btn-certificate {
    background: linear-gradient(135deg, #f1c40f, #f39c12) !important;
    color: #333 !important;
    font-weight: 700 !important;
}

.mco-btn-certificate:hover {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    color: #333 !important;
}

@media (min-width: 768px) {
    .mco-btn-continue,
    .mco-btn-complete {
        width: auto;
    }
}

/* Access Denied */
.mco-access-denied {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    margin: 20px 0;
}

.mco-access-denied h2 {
    margin: 0 0 15px;
    color: #e74c3c !important;
}

.mco-access-denied p {
    margin: 0 0 20px;
    color: #666;
}

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

.mco-curso-header {
    margin-bottom: 30px;
}

.mco-curso-title {
    font-size: 28px;
    font-weight: 700 !important;
    margin: 0 0 15px;
    color: #2c3e50;
}

@media (min-width: 768px) {
    .mco-curso-title {
        font-size: 36px;
    }
}

.mco-curso-description {
    color: #555;
    font-size: 16px;
}

/* Progress Section */
.mco-progress-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.mco-progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mco-progress-fill {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.mco-progress-text {
    font-size: 14px;
    color: #666;
}

.mco-certificate-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.mco-certificate-message {
    font-size: 18px;
    font-weight: 600;
    color: #27ae60 !important;
    margin-bottom: 15px;
}

.mco-success-icon {
    display: inline-block;
    margin-right: 8px;
}

/* Curriculum */
.mco-curriculum {
    margin-top: 30px;
}

.mco-curriculum-title {
    font-size: 22px;
    margin: 0 0 20px;
    color: #2c3e50;
}

.mco-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mco-chapter {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.mco-chapter-completed {
    border-color: #27ae60 !important;
}

/* Accordion - Collapsible Chapters */
.mco-chapter-collapsible .mco-chapter-header {
    cursor: pointer !important;
    user-select: none;
}

.mco-chapter-collapsible .mco-chapter-content {
    display: none;
}

.mco-chapter-collapsible:not(.mco-chapter-open) .mco-chapter-header {
    border-bottom: none !important;
}

.mco-chapter-collapsible.mco-chapter-open .mco-chapter-content {
    display: block;
}

.mco-chapter-chevron {
    margin-left: auto;
    color: #999;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mco-chapter-open .mco-chapter-chevron {
    transform: rotate(180deg);
}

.mco-chapter-meta {
    font-size: 13px;
    color: #999;
    flex-shrink: 0;
}

.mco-chapter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e0e0e0;
}

.mco-chapter-header:hover {
    background: #eef1f3 !important;
}

.mco-chapter-completed .mco-chapter-header {
    background: #e8f8f0 !important;
    border-color: #27ae60;
}

.mco-chapter-completed .mco-chapter-header:hover {
    background: #d8f0e4 !important;
}

.mco-chapter-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #3498db !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.mco-chapter-completed .mco-chapter-number {
    background: #27ae60 !important;
}

.mco-chapter-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50 !important;
    flex: 1;
}

.mco-chapter-status {
    color: #27ae60 !important;
    font-size: 18px;
}

/* Lessons List */
.mco-lessons-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mco-lesson {
    border-bottom: 1px solid #f0f0f0;
}

.mco-lesson:last-child {
    border-bottom: none;
}

.mco-lesson-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 15px !important;
    text-decoration: none !important;
    color: #333 !important;
    transition: background 0.2s ease !important;
}

.mco-lesson-link:hover {
    background: #f8f9fa !important;
    color: #333 !important;
    text-decoration: none !important;
}

.mco-lesson-completed .mco-lesson-link {
    color: #666 !important;
}

.mco-lesson-completed .mco-lesson-link:hover {
    color: #666 !important;
}

.mco-lesson-icon {
    flex-shrink: 0;
    line-height: 1;
}

.mco-lesson-icon svg {
    display: block;
}

.mco-lesson-title {
    flex: 1;
    font-size: 15px;
}

.mco-lesson-duration {
    font-size: 13px;
    color: #999 !important;
    flex-shrink: 0;
}

.mco-lesson-badge {
    background: #27ae60 !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.mco-lesson-next .mco-lesson-link {
    background: #fff9e6 !important;
}

.mco-lesson-next .mco-lesson-link:hover {
    background: #fff3cc !important;
}

/* ==========================================================================
   Lesson Page
   ========================================================================== */

.mco-aula-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    flex-wrap: wrap;
}

.mco-aula-breadcrumb a {
    color: #3498db !important;
    text-decoration: none !important;
}

.mco-aula-breadcrumb a:hover {
    text-decoration: underline !important;
    color: #2980b9 !important;
}

.mco-breadcrumb-sep {
    color: #999;
}

.mco-aula-header {
    margin-bottom: 20px;
}

.mco-aula-title {
    font-size: 24px;
    margin: 0;
    color: #2c3e50;
}

@media (min-width: 768px) {
    .mco-aula-title {
        font-size: 32px;
    }
}

/* Video */
.mco-video-wrapper {
    margin-bottom: 25px;
}

.mco-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.mco-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mco-no-video {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

/* Lesson Content */
.mco-aula-content {
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.8;
}

.mco-aula-content p {
    margin-bottom: 1em;
}

.mco-aula-content h2,
.mco-aula-content h3,
.mco-aula-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* Actions */
.mco-aula-actions {
    margin-bottom: 30px;
}

/* Navigation */
.mco-aula-navigation {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .mco-aula-navigation {
        grid-template-columns: 1fr 1fr;
    }
}

.mco-btn-nav {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 15px 20px !important;
    background: #f8f9fa !important;
    border: 1px solid #e0e0e0 !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.mco-btn-nav:hover {
    background: #f0f0f0 !important;
    border-color: #ccc !important;
    color: #333 !important;
    text-decoration: none !important;
}

.mco-btn-prev {
    justify-content: flex-start;
}

.mco-btn-next {
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .mco-btn-next {
        grid-column: 2;
    }
}

.mco-nav-arrow {
    font-size: 20px;
    color: #3498db !important;
}

.mco-nav-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.mco-btn-next .mco-nav-text {
    text-align: right;
}

.mco-nav-text small {
    font-size: 12px;
    color: #999 !important;
}

.mco-btn-back {
    justify-content: center;
    background: #3498db !important;
    color: #fff !important;
    border-color: #3498db !important;
}

.mco-btn-back:hover {
    background: #2980b9 !important;
    border-color: #2980b9 !important;
    color: #fff !important;
}

/* Mini Progress */
.mco-mini-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mco-mini-progress .mco-progress-bar {
    flex: 1;
    height: 8px;
    margin: 0;
}

.mco-mini-progress .mco-progress-text {
    font-size: 13px;
    white-space: nowrap;
}

/* ==========================================================================
   Toast / Notifications
   ========================================================================== */

.mco-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.mco-toast.mco-toast-visible {
    opacity: 1;
}

.mco-toast-success {
    background: #27ae60 !important;
}

.mco-toast-error {
    background: #e74c3c !important;
}

/* ==========================================================================
   Course Complete Modal
   ========================================================================== */

.mco-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mco-modal-overlay.mco-modal-visible {
    opacity: 1;
    visibility: visible;
}

.mco-modal {
    background: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.mco-modal-visible .mco-modal {
    transform: scale(1);
}

.mco-modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.mco-modal h2 {
    margin: 0 0 15px;
    color: #27ae60 !important;
    font-size: 24px;
}

.mco-modal p {
    margin: 0 0 25px;
    color: #666;
}

.mco-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mco-modal-close {
    background: none !important;
    border: none !important;
    color: #999 !important;
    cursor: pointer !important;
    padding: 10px;
    font-size: 14px;
}

.mco-modal-close:hover {
    color: #333 !important;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.mco-btn.mco-loading {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

.mco-btn.mco-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: mco-spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes mco-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Widget
   ========================================================================== */

.mco-progress-widget {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mco-progress-widget .mco-progress-bar {
    height: 8px;
    margin-bottom: 8px;
}

.mco-progress-widget .mco-progress-text {
    font-size: 13px;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.mco-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

/* ==========================================================================
   WooCommerce My Account - Curso Menu Items
   ========================================================================== */

.woocommerce-MyAccount-navigation-link[class*="mco-curso-"] {
    background-color: #fff3e0 !important;
    text-align: center !important;
}

.woocommerce-MyAccount-navigation-link[class*="mco-curso-"] a {
    display: block !important;
    padding: 20px 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, .1) !important;
    font-size: 1rem !important;
    color: #000000 !important;
    text-decoration: none !important;
}

.woocommerce-MyAccount-navigation-link[class*="mco-curso-"] a::before {
    content: "\1F393" !important;
    margin-right: 8px !important;
}

.woocommerce-MyAccount-navigation-link[class*="mco-curso-"] a:hover {
    background-color: #ffe0b2 !important;
    color: #000000 !important;
}

/* Dark mode support (if theme supports) */
@media (prefers-color-scheme: dark) {
    .mco-curso-wrapper,
    .mco-aula-wrapper {
        color: inherit;
    }
}
