/* ============================================
   EDRONA LMS - Courses Page Stylesheet
   Extends the main style.css theme
   ============================================ */

/* ============================================
   Page Title Section
   ============================================ */
.page-title-section {
    padding: 140px 0 60px;
    background: linear-gradient(135deg, #1a5f7a 0%, #159895 100%);
    position: relative;
    overflow: hidden;
    color: var(--white);
}

.page-title-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="3" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
    z-index: 0;
}

.page-title-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.breadcrumb {
    justify-content: center;
    background: transparent;
    margin-bottom: 20px;
    padding: 0;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--white) !important;
}

.breadcrumb-item.active {
    color: var(--white) !important;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(255, 255, 255, 0.6) !important;
}

.page-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Courses Section
   ============================================ */
.courses-section {
    padding: 80px 0;
    background: var(--white);
}

/* ============================================
   Sidebar Styles
   ============================================ */
.courses-sidebar {
    position: sticky;
    top: 120px;
}

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    transition: var(--transition-normal);
}

.sidebar-widget:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(26, 95, 122, 0.2);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-bg);
}

/* Search Widget */
.search-widget {
    padding: 20px;
    background: var(--light-bg);
    border: none;
}

.search-box {
    position: relative;
    display: flex;
}

.search-box input {
    width: 100%;
    flex: 1;
    padding: 12px 45px 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-btn:hover {
    color: var(--primary-color);
}

/* ============================================
   jQuery UI Autocomplete Custom Styles
   ============================================ */
.ui-autocomplete {
    position: absolute;
    z-index: 1000;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(26, 95, 122, 0.1);
    overflow: hidden;
    animation: autocompleteSlideIn 0.2s ease-out;
}

@keyframes autocompleteSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ui-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
    outline: none;
    max-height: 320px;
    overflow-y: auto;
}

/* Custom Scrollbar */
.ui-menu::-webkit-scrollbar {
    width: 8px;
}

.ui-menu::-webkit-scrollbar-track {
    background: var(--light-bg);
}

.ui-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.ui-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.ui-menu-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.ui-menu-item:last-child {
    border-bottom: none;
}

.ui-menu-item-wrapper {
    display: block;
    padding: 12px 18px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Hover effect with sliding background */
.ui-menu-item-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
                rgba(26, 95, 122, 0.08) 0%,
                rgba(87, 197, 182, 0.08) 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.ui-menu-item-wrapper:hover::before,
.ui-state-active::before {
    left: 0;
}

.ui-menu-item-wrapper:hover,
.ui-state-active {
    background: linear-gradient(90deg,
                rgba(26, 95, 122, 0.1) 0%,
                rgba(87, 197, 182, 0.1) 100%);
    color: var(--primary-color);
    padding-left: 24px;
    font-weight: 500;
}

/* Active/Focus state */
.ui-state-active {
    border: none;
    background: linear-gradient(90deg,
                rgba(26, 95, 122, 0.12) 0%,
                rgba(87, 197, 182, 0.12) 100%);
}

/* Icon for search suggestions */
.ui-menu-item-wrapper::after {
    content: '\F52A';
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.ui-menu-item-wrapper:hover::after,
.ui-state-active::after {
    opacity: 1;
    right: 15px;
}

/* Helper text at bottom */
.ui-autocomplete::after {
    content: attr(data-helper-text);
    display: block;
    padding: 10px 18px;
    background: var(--light-bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Loading state */
.ui-autocomplete-loading {
    background-image: none !important;
}

.search-box.loading .search-btn {
    pointer-events: none;
}

.search-box.loading .search-btn i {
    animation: spin 1s linear infinite;
    color: var(--primary-color);
}

/* No results message */
.ui-autocomplete .no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ui-autocomplete .no-results i {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.3;
    display: block;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .ui-menu-item-wrapper {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Filter List */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    transition: var(--transition-fast);
}

.filter-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--radius-md);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.filter-item a i {
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.filter-item a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    border-color: var(--border-color);
}

.filter-item a:hover i {
    color: var(--primary-color);
}

.filter-item.active a {
    background: rgba(26, 95, 122, 0.1);
    color: var(--primary-color);
    border-color: rgba(26, 95, 122, 0.2);
    font-weight: 500;
}

.filter-item.active a i {
    color: var(--primary-color);
}

/* Filter Select */
.filter-select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--white);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

/* Filter Tags (shared styles) */
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: var(--transition-fast);
}

.filter-tag:hover {
    border-color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(26, 95, 122, 0.15);
    transform: translateY(-1px);
}

.remove-tag {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-tag:hover {
    color: #dc3545;
    transform: scale(1.2);
}

/* ============================================
   Active Filters Section (Top)
   ============================================ */
.active-filters-section {
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.05) 0%, rgba(87, 197, 182, 0.05) 100%);
    border: 2px dashed rgba(26, 95, 122, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px 25px;
    margin-bottom: 25px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.active-filters-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.active-filters-title i {
    font-size: 1.1rem;
}

.clear-all-btn {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.clear-all-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.active-filters-section .filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================
   Courses Header
   ============================================ */
.courses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
    gap: 15px;
}

.courses-count h5 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.courses-count strong {
    color: var(--primary-color);
}

.courses-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.courses-sort label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
}

.sort-select {
    min-width: 180px;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.sort-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

/* ============================================
   Courses Grid
   ============================================ */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

/* ============================================
   Course Card
   ============================================ */
.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(26, 95, 122, 0.2);
}

/* Course Image */
.course-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.course-card:hover .course-image img {
    transform: scale(1.08);
}

/* Course Badge */
.course-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.course-badge.badge-new {
    background: #10b981;
}

.course-badge.badge-popular {
    background: #f59e0b;
}

.course-badge.badge-free {
    background: #8b5cf6;
}

/* Course Price */
.course-price {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.course-price.price-free {
    background: rgba(139, 92, 246, 0.9);
}

/* Course Actions */
.course-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    color: var(--text-color);
}

.action-btn:hover {
    background: var(--white);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.wishlist-btn.active {
    background: var(--white);
    color: #dc3545;
}

.wishlist-btn.active:hover {
    background: var(--white);
    color: #c82333;
}

.wishlist-btn.active i {
    color: #dc3545;
}

/* Wishlist heart animation */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.25);
    }
    100% {
        transform: scale(1);
    }
}

.wishlist-animate {
    animation: heartBeat 0.5s ease-in-out;
}

/* Course Content */
.course-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.course-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.course-category i {
    font-size: 0.9rem;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-rating i {
    color: #fbbf24;
    font-size: 1rem;
}

.course-rating span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.course-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.course-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.course-title a:hover {
    color: var(--primary-color);
}

.course-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Course Footer */
.course-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.course-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-item i {
    font-size: 1rem;
    color: var(--primary-color);
}

.course-buttons {
    display: flex;
    gap: 10px;
}

.course-buttons .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    justify-content: center;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* Primary Button */
.course-buttons .btn-primary {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: var(--white);
}

.course-buttons .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.3);
}

/* Outline Primary Button */
.course-buttons .btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.course-buttons .btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.2);
}

/* Enroll Button */
.btn-enroll {
    background: var(--gradient-primary);
    border: none;
    color: var(--white);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-enroll:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 95, 122, 0.3);
    color: var(--white);
}

/* Enrolled Button (for already enrolled courses) */
.enrolled-btn {
    background-color: #00a75a !important;
    border-color: #00f885 !important;
}

.enrolled-btn:hover {
    background-color: #008f4d !important;
}

/* ============================================
   Pagination
   ============================================ */
.courses-pagination {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.pagination {
    gap: 8px;
}

.page-link {
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-weight: 500;
}

.page-link:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 1199px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 991px) {
    .page-title-section {
        padding: 120px 0 50px;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .courses-section {
        padding: 60px 0;
    }

    .courses-sidebar {
        position: static;
        margin-bottom: 40px;
    }

    .search-box {
        max-width: 100%;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .page-title {
        font-size: 1.8rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .active-filters-section {
        padding: 15px 18px;
        margin-bottom: 20px;
    }

    .active-filters-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .active-filters-title {
        justify-content: center;
    }

    .clear-all-btn {
        width: 100%;
        justify-content: center;
    }

    .courses-header {
        flex-direction: column;
        align-items: stretch;
    }

    .courses-sort {
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .course-card {
        max-width: 100%;
    }

    .course-buttons {
        flex-direction: column;
    }

    .filter-tags {
        gap: 8px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        padding: 10px 40px 10px 15px;
        font-size: 0.9rem;
    }

    .search-btn {
        right: 3px;
        padding: 6px 10px;
        font-size: 1rem;
    }
}

@media (max-width: 575px) {
    .page-title-section {
        padding: 100px 0 40px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .active-filters-section {
        padding: 12px 15px;
        margin-bottom: 15px;
    }

    .active-filters-title {
        font-size: 0.95rem;
    }

    .clear-all-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .filter-tags {
        gap: 6px;
    }

    .filter-tag {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .sidebar-widget {
        padding: 20px;
    }

    .search-widget {
        padding: 15px;
    }

    .search-box input {
        padding: 10px 38px 10px 12px;
        font-size: 0.85rem;
    }

    .search-btn {
        right: 2px;
        padding: 5px 8px;
        font-size: 0.95rem;
    }

    .course-image {
        height: 180px;
    }

    .course-content {
        padding: 20px;
    }

    .course-title {
        font-size: 1.05rem;
    }

    .course-stats {
        flex-direction: column;
        gap: 10px;
    }

    .courses-pagination .pagination {
        flex-wrap: wrap;
    }
}
/* media query between 1200 and 1600 */
@media (min-width: 1200px) and (max-width: 1599px) {
    .course-buttons .btn{
        padding: 8px 8px;
        font-size: 0.85rem;
    }
    .courses-grid{
        gap: 20px;
    }
}

/* ============================================
   Empty State
   ============================================ */
.courses-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.courses-empty-state i {
    font-size: 5rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 20px;
}

.courses-empty-state h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.courses-empty-state p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* ============================================
   Loading State
   ============================================ */
.courses-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light-bg);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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