.user {
    display: flex;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.user .sidebar {
    background-color: #003674;
    color: white;
    width: 240px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: transform 0.3s ease;
}

.sidebar-close {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: right;
    display: block;
    display:none;
}



.user .sidebar h2 {
    font-size: 1.5rem;
    margin: 30px 0;
    padding: 20px;
}

.user .sidebar a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    transition: background 0.2s;
    padding: 20px;
}

.user .sidebar a i {
  margin-right: 10px;
}


.user .sidebar a.active {
    background-color: #10A15E;
}

.user .sidebar a:hover {
    background-color: #0271CD;
}

.user .content {
    flex: 1;
    padding: 30px;
}

.user header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user .menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #1f2937;
    background-color: white;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 6px;
}




@media (max-width: 768px) {
    .user {
    flex-direction: column;
    }

    .user .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100%;
    z-index: 1000;
    left: 0;
    transform: translateX(-100%);
    }

.user .sidebar.open {
    transform: translateX(0%);
}

    .user .menu-toggle {
    display: block;
    }

    .user .content {
    margin-top: 20px;
    padding: 20px;
    }

    .sidebar-close {
        display:block;
    }
}



.user .course {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.user .course-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 31.5%;
    transition: transform 0.2s;
}

.user .course-card:hover {
    transform: translateY(-5px);
}


.user .card-content h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.user .card-content p {
    margin: 5px 0 0;
    color: #666;
    float: right;
}

/* Different icon colors for variety */
.user .total .card-icon { 
    background-color: #4CAF50; 
    color: #ffffff;
    border-radius: 50%;
    padding:13px 10px 5px 10px;
    width:70px;
    height:70px;
    text-align: center;
    font-size: 40px;   
    

}
.user .paid .card-icon { 
    background-color: #2196F3; 
    color: #ffffff;
    border-radius: 50%;
    padding:13px 10px 5px 10px;
    width:70px;
    height:70px;
    text-align: center;   
    font-size: 40px;
    


}
.user .free .card-icon { 
    background-color: #FF9800; 
    color: #ffffff;
    border-radius: 50%;
    padding:13px 10px 5px 10px;
    width:70px;
    height:70px;
    text-align: center; 
    font-size: 40px; 
     

}

/* Tablet view (768px to 1024px) */
@media (max-width: 1024px) {
    .user .course-card {
        width: 48%; /* two cards per row */
        padding: 18px;
    }
}

/* Mobile view (up to 767px) */
@media (max-width: 767px) {
    .user .course-card {
        width: 100%; /* full width cards */
        flex-direction: row; /* icon and content remain side by side */
        padding: 15px;
    }

    .user .card-icon {
        font-size: 36px;
        margin-right: 12px;
    }

    .user .card-content h3 {
        font-size: 16px;
    }

    .user .card-content p {
        font-size: 14px;
    }
}



/* user course details */
.course-header {
        position: relative;
        display: flex;
        align-items: center;
        gap: 20px;
        background: #f8f9fa;
        padding: 10px;
        border-radius: 8px;
        margin-bottom: 20px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }


    .ribbon {
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        --f: .5em; /* folded part */
        --r: .8em; /* ribbon shape */
        position: absolute;
        bottom: 10px;
        right: calc(-1 * var(--f));
        padding-inline: 1.25em;
        line-height: 1.8;
        background: #10A15E;
        border-top: var(--f) solid #0005;
        border-left: var(--r) solid transparent;
        clip-path: polygon(
            var(--r) 100%, 100% 100%, 100% var(--f),
            calc(100% - var(--f)) 0,
            calc(100% - var(--f)) var(--f),
            var(--r) var(--f),
            0 calc(50% + var(--f)/2)
        );
    }

    .course-cover img {
        width: 550px;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

    .course-info h1 {
        margin: 0;
        font-size: 24px;
        font-weight: bold;
    }

    .course-info h2 {
        margin: 5px 0;
        font-size: 18px;
        color: #555;
    }

    .course-info p {
        margin: 3px 0;
        font-size: 16px;
    }


    .course-header h1 {
        font-size: 2rem;
        margin-bottom: 5px;
    }

    .course-header h2 {
        font-size: 1rem;
        font-weight: normal;
        color: #555;
    }


    /* Tablet: max-width 991px */
    @media (max-width: 991px) {
        .course-header {
            flex-direction: column;
            align-items: flex-start;
        }

        .course-cover img {
            width: 100%;
            height: auto;
        }

        .ribbon {
            padding-inline: 1em;
            font-size: 16px;
        }

        .course-info {
            width: 100%;
        }
    }

    /* Mobile: max-width 576px */
    @media (max-width: 576px) {
        .course-header {
            padding: 8px;
            gap: 10px;
        }

        .course-cover img {
            width: 100%;
            height: auto;
            border-radius: 6px;
        }

        .ribbon {
            font-size: 14px;
            padding-inline: 0.75em;
            line-height: 1.6;

        }

        .course-info h1 {
            font-size: 20px;
        }

        .course-info h2 {
            font-size: 16px;
        }

        .course-info p {
            font-size: 14px;
        }
    }


    .accordion-item {
        background: #fff;
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
        box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    }

    .accordion-header {
        padding: 15px;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #e9ecef;
        color: #10A15E;
        transition: background 0.3s, color 0.3s;
    }

    .accordion-header:hover {
        background: #10A15E;
        color: white;
    }

    /* Active header style */
    .accordion-header.active {
        background: #10A15E;
        color: #fff;
    }

    .accordion-header span {
        font-size: 1.2rem;
        font-weight: bold;
        width: 20px;
        text-align: center;
        transition: color 0.3s;
    }

    .accordion-header.active span {
        color: #fff;
    }

    .accordion-content {
        max-height: 0;
        overflow: hidden;
        padding: 0 15px;
        background: #fff;
        transition: max-height 0.4s ease, padding 0.3s ease;
    }

    .accordion-content.open {
        padding: 0 15px;
        margin:15px 0px;
    }

    .accordion-content img {
        max-width: 100%;
        border-radius: 5px;
        margin-bottom: 10px;
    }

    .zoom-link {
        display: inline-block;
        padding: 5px 12px;
        background: #007bff;
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        border-radius: 5px;
        width:150px;
        text-align: center;
    }

    .play-recorded-video {
        display: inline-block;
        padding: 5px 12px;
        background: #d5003c;
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        border-radius: 5px;
        width:150px;
        text-align: center;
    }

    .play-recorded-video:hover {
        background: #a4002f;
        color: white;
    }
    
    .waitng-video {
        display: inline-block;
        padding: 5px 12px;
        background: #ffa600;
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        border-radius: 5px;
        width:150px;
        text-align: center;
    }

    .waitng-video:hover {
        background: #da8d00;
        color: white;
    }

    .not-available {
        display: inline-block;
        padding: 5px 12px;
        background: #707070;
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        border-radius: 5px;
        width:150px;
        text-align: center;
    }

    .not-available:hover {
        background: #707070;
        color: white;
    }



    

    

    .zoom-link:hover {
        background: #0056b3;
        color: white;
    }

    .play-video{
        display: inline-block;
        padding: 5px 12px;
        background: #004552ff;
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        border-radius: 5px;
        width:150px;
        text-align: center;
    }
    .play-video:hover {
        background: #00252d;
        color: white;
    }

    .offline{
        display: inline-block;
        padding: 5px 12px;
        background: #d70032ff;
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        border-radius: 5px;
        width:150px;
        text-align: center;
        cursor:not-allowed;
    }

    @media (max-width: 576px) {
        .course-header h1 {
            font-size: 1.4rem;
        }
        .accordion-header {
            font-size: 0.95rem;
        }
    }

    /* Tablet: max-width 991px */
    @media (max-width: 991px) {
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .table-responsive table {
            min-width: 700px; /* keeps table readable */
        }
    }

    /* Mobile: max-width 576px */
    @media (max-width: 576px) {
        .table-responsive {
            border-radius: 6px;
            margin-bottom: 10px;
        }

        .table-responsive table {
            font-size: 14px;
        }

        /* Make table header sticky for better scrolling UX */
        .table-responsive thead th {
            position: sticky;
            top: 0;
            background: #f8f9fa;
            z-index: 2;
        }
    }

    .table-responsive {
        max-height: none; /* remove any max-height restricting vertical growth */
        overflow-x: auto; /* horizontal scroll */
        overflow-y: visible; /* allow vertical expansion */
    }


    /* Optional: style scrollbar for better UX */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    .table-responsive::-webkit-scrollbar-thumb {
        background-color: #10a15e99;
        border-radius: 4px;
    }
    .table-responsive::-webkit-scrollbar-track {
        background: transparent;
    }


    /* Course Play Video for user */
    /* Modal backdrop */
    .modal-backdrop {
        position: fixed;
        inset: 0; /* top,right,bottom,left = 0 */
        background: rgba(0,0,0,0.7);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }
    .modal-backdrop.active {
        display: flex;
    }

    /* Modal content */
    .modal-content {
        position: relative;
        width: 90%;
        max-width: 800px;
        background: #222;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    }

    /* Close button */
    .modal-close {
        position: absolute;
        top: 10px;
        right: 14px;
        background: transparent;
        border: none;
        font-size: 28px;
        color: #fff;
        cursor: pointer;
        font-weight: bold;
        z-index: 10;
    }

    /* Video styling */
    .modal-content video {
        width: 100%;
        height: auto;
        display: block;
        background: black;
    }
