/* ============================================================================
   Shared Course Cards Styles
   Used by: teacher/courses, student/browse-courses, student/enrolled-courses,
   student/materials/subjects
   ============================================================================ */
#coursesGrid {
    margin-bottom: 30px;
}

.course-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card__link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card__link:hover {
    color: inherit;
    text-decoration: none;
}

.course-card:hover .course-card__link {
    transform: translateY(-4px);
}

.course-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

/* Course Thumbnail */
.course-card__thumb {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.course-card__thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    color: #9ca3af;
    font-size: 48px;
}

/* Badges */
.course-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: calc(100% - 60px);
    z-index: 2;
}

.badge-item {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: black;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.3);
}

.badge-item i {
    font-size: 14px;
}

.badge-item.published {
    background: rgba(16, 185, 129, 0.9);
}

.badge-item.draft {
    background: rgba(245, 158, 11, 0.9);
}

.badge-item.completed {
    background: rgba(16, 185, 129, 0.9);
}

.badge-item.level-beginner {
    background: rgba(34, 197, 94, 0.9);
}

.badge-item.level-intermediate {
    background: rgba(245, 158, 11, 0.9);
}

.badge-item.level-advanced {
    background: rgba(239, 68, 68, 0.9);
}

/* Meeting-specific badges */
.badge-item.level-live {
    background: rgba(16, 185, 129, 0.9);
}

.badge-item.level-upcoming {
    background: rgba(59, 130, 246, 0.9);
}

.badge-item.level-ended {
    background: rgba(107, 114, 128, 0.9);
}

/* Course Actions (Teacher-specific) */
.course-card__actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.actions-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    color: #6b7280;
    backdrop-filter: blur(10px);
}

.actions-btn:hover {
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.course-card__actions .dropdown-menu {
    min-width: 200px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    padding: 8px;
    margin-top: 8px;
}

.course-card__actions .dropdown-item {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    color: #374151;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.course-card__actions .dropdown-item:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.course-card__actions .dropdown-item i {
    font-size: 18px;
    width: 20px;
    margin-right: 12px;
}

.course-card__actions .dropdown-divider {
    margin: 8px 0;
    border-color: #e5e7eb;
}

.course-card__actions .dropdown-item.text-warning:hover {
    background-color: #fef3c7;
    color: #f59e0b;
}

.course-card__actions .dropdown-item.text-success:hover {
    background-color: #dcfce7;
    color: #10b981;
}

.course-card__actions .dropdown-item.text-danger:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Course Content */
.course-card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px;
    padding-bottom: 24px;
    min-height: 280px;
    /* Ensures consistent card height */
}

a.course-card__content {
    text-decoration: none;
    color: inherit;
}

a.course-card__content:hover {
    text-decoration: none;
}

.course-card__category {
    display: inline-flex;
    align-self: flex-start;
    max-width: max-content;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 6px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid #93c5fd;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.course-card:hover .course-card__category {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.course-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
    transition: color 0.2s ease;
    height: 50px;
    /* Fixed height for 2 lines (18px * 1.4 * 2 ≈ 50px) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.course-card:hover .course-card__title {
    color: #3b82f6;
}

.course-card__description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    height: 67px;
    /* Fixed height for 3 lines (14px * 1.6 * 3 ≈ 67px) */
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Progress Bar (Student-specific) */
.progress-bar-wrapper {
    margin-bottom: 16px;
}

.progress-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #6b7280;
}

.progress-bar-container {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-image: linear-gradient(45deg, #10b981, #34d399);
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 4px;
    animation: progressBarAnimation 2s ease-out forwards;
}

@keyframes progressBarAnimation {
    from {
        width: 0;
    }
}

/* Course Metadata */
.course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.course-card__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.course-card__meta-item i {
    font-size: 16px;
}

/* Grid Padding */
#coursesGrid,
#subjectsGrid,
.courses-management-section .row.gy-4 {
    padding: 32px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .course-card__badges {
        max-width: calc(100% - 24px);
    }

    .course-card__title {
        font-size: 16px;
    }

    .course-card__description {
        font-size: 13px;
    }

    .course-card__meta {
        gap: 12px;
    }

    /* Reduce padding on mobile */
    #coursesGrid,
    #subjectsGrid,
    .courses-management-section .row.gy-4 {
        padding: 20px !important;
    }
}

/* RTL Support */
[dir="rtl"] .course-card__actions {
    right: auto;
    left: 12px;
}

[dir="rtl"] .course-card__badges {
    left: auto;
    right: 12px;
}

[dir="rtl"] .course-card__actions .dropdown-item i {
    margin-right: 0;
    margin-left: 12px;
}

/* ============================================================================
   MEETING-SPECIFIC STYLES - Shadcn Inspired
   ============================================================================ */

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.125rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

/* Pulse Dot for Live Badge */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-live 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Meeting Card Specific Footer Buttons */
.btn-join-live {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    width: 100%;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-join-live:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    text-decoration: none;
}

.btn-join-live:active {
    transform: translateY(0);
}

.btn-watch-recording {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    width: 100%;
}

.btn-watch-recording:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

.course-card__time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.course-card__time i {
    font-size: 1rem;
    color: #94a3b8;
}

/* Badge Count in Section Headers */
.badge-count {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

/* Empty State */
.empty-state-card {
    background: #ffffff;
    border: 2px dashed #e2e8f0;
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #94a3b8;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.empty-state-description {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================================
   ENHANCED SHADCN COMPONENTS
   ============================================================================ */

/* Course Card Header Enhancement */
.course-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* Note: Main .course-card__category styles are defined above in the shared section */

/* Enhanced Meta Items */
.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.meta-item i {
    font-size: 1rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Course Card Footer */
.course-card__footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Section Management */
.courses-management-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f5f9;
}

.section-title-area {
    flex: 1;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.section-title i {
    font-size: 1.5rem;
}

.section-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    width: 280px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.125rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: #94a3b8;
}

/* ============================================================================
   RESPONSIVE ENHANCEMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .stat-card {
        min-width: auto;
        flex: 1 1 calc(50% - 0.5rem);
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
    }

    .section-controls {
        width: 100%;
        justify-content: space-between;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .empty-state-card {
        padding: 3rem 1.5rem;
    }

    .empty-state-icon {
        width: 4rem;
        height: 4rem;
        font-size: 2rem;
    }

    .empty-state-title {
        font-size: 1.25rem;
    }

    .empty-state-description {
        font-size: 0.9375rem;
    }
}

@media (max-width: 576px) {
    .stat-card {
        flex: 1 1 100%;
    }
}

/* ============================================================================
   ANIMATION ENHANCEMENTS
   ============================================================================ */

.course-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card:hover .course-card__thumb img {
    transform: scale(1.05);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card__thumb img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger Animation for Cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Add stagger delay */
.course-card:nth-child(1) {
    animation-delay: 0.05s;
}

.course-card:nth-child(2) {
    animation-delay: 0.1s;
}

.course-card:nth-child(3) {
    animation-delay: 0.15s;
}

.course-card:nth-child(4) {
    animation-delay: 0.2s;
}

.course-card:nth-child(5) {
    animation-delay: 0.25s;
}

.course-card:nth-child(6) {
    animation-delay: 0.3s;
}

.course-card:nth-child(7) {
    animation-delay: 0.35s;
}

.course-card:nth-child(8) {
    animation-delay: 0.4s;
}