/* Community Library Styles */

/* Base layout */
.academy__course-content {
    margin: 0 auto;
    max-width: 1400px;
    padding: 0 20px;
}

.academy__title {
    margin: 40px 0 30px;
}

/* Title section */
.academy--text {
    color: #1a1a1a;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.3;
    margin: 0;
}

.academy--span-text-or {
    color: #666;
    font-size: clamp(16px, 2vw, 20px);
    margin-top: 8px;
}

.academy--span-text {
    color: #8d4df3;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.academy--span-text:hover {
    color: #0120d4;
}

.academy--span-text::before {
    content: '';
    width: 0;
    height: 3px;
    background-color: #8d4df3;
    position: absolute;
    bottom: -4px;
    left: 50%;
    transition: width 0.4s ease, left 0.4s ease;
}

.academy--span-text:hover::before {
    width: 100%;
    left: 0;
}

/* Search section */
.academy__search {
    padding: 30px 0;
    display: flex;
    justify-content: center;
}

.academy__search-wrapper {
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.academy__search-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(141, 77, 243, 0.2);
}

.academy__search-wrapper .fa-magnifying-glass {
    color: #8d4df3;
    font-size: 18px;
    flex-shrink: 0;
}

.academy__search-wrapper .input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    color: #333;
    background: transparent;
}

.academy__search-wrapper .input::placeholder {
    color: #999;
}

.academy__search-wrapper .remove-search {
    color: #999;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: color 0.2s ease;
    display: none;
}

.academy__search-wrapper .remove-search:hover {
    color: #8d4df3;
}

.academy__search-wrapper .input:not(:placeholder-shown) ~ .remove-search {
    display: block;
}

.academy__search-wrapper .remove-search:active {
    transform: scale(0.95);
}

/* Keyword/Category section */
.academy__keyword {
    margin-bottom: 30px;
}

.academy__keyword--list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.keyword--list__title {
    display: none;
}

.keyword--list__item {
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid #e4e4e4;
    background: #fff;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.keyword--list__item:hover {
    border-color: #8d4df3;
    color: #8d4df3;
    background: #f8f6ff;
}

.keyword--list__item.active {
    background: linear-gradient(119.16deg, #8D4DF3 0%, #0120D4 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(141, 77, 243, 0.3);
}

/* Course/Community section */
.academy__course {
    margin-top: 40px;
}

.academy__course--title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
}

/* Grid layout */
.academy__course--system,
.academy__course--list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 1200px) {
    .academy__course--system,
    .academy__course--list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .academy__course--system,
    .academy__course--list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Card styling */
.course--list__item {
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e4e4;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.course--list__item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 2px solid #d0d0d0;
}

.course--list__link {
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image container */
.course--list--image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #8d4df3 0%, #0120d4 100%);
}

.course--list--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

.course--list--image img.loaded {
    opacity: 1;
}

.course--list__item:hover .course--list--image img {
    transform: scale(1.05);
}

/* Content area */
.course--list--content {
    padding: 20px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.course--list--title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 50px;
}

.course--list--desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 42px;
}

.course--list--teacher {
    color: gray;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: auto;
}

/* Info section */
.course--list--info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.course--list--vote {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fa9d3e;
    font-size: 14px;
}

.course--list--vote .number--vote {
    font-weight: 600;
}

.course--list--vote .star {
    color: #fa9d3e;
    font-size: 14px;
}

.course--list--vote .star.full {
    color: #fa9d3e;
}

.course--list--spvote {
    color: #999;
    font-size: 13px;
    margin-left: 4px;
}

.course--list--student {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 13px;
}

.course--list--student iconify-icon {
    font-size: 16px;
    color: #8d4df3;
}

/* Price section */
.course--list--price {
    font-size: 16px;
    font-weight: 700;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* Load more button */
.seemore {
    text-align: center;
    margin-top: 40px;
}

.seemore--link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #8d4df3;
    border-radius: 25px;
    background: transparent;
    color: #8d4df3;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.seemore--link:hover {
    background: linear-gradient(119.16deg, #8D4DF3 0%, #0120D4 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(141, 77, 243, 0.3);
}

.seemore--link iconify-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.seemore--link:hover iconify-icon {
    transform: translateX(4px);
}

/* Empty state */
.academy__course--system:empty::before,
.academy__course--list:empty::before {
    content: "Chưa có cộng đồng nào";
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* Image loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.course--list--image img.loaded {
    animation: fadeIn 0.3s ease-in;
}

/* Favorite button */
.btn-favorite {
    transition: transform 0.2s ease;
}

.btn-favorite:hover {
    transform: scale(1.2);
}

.btn-favorite:active {
    transform: scale(0.95);
}

/* Active badge */
.course--list--image .badge {
    font-size: 12px;
    padding: 4px 10px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Joined date info */
.course--list--content .border-top {
    border-color: #f0f0f0 !important;
}

.course--list--content .text-muted {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.course--list--content .text-muted i {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .academy__course-content {
        padding: 0 30px;
    }
}

@media (max-width: 768px) {
    .academy__course-content {
        padding: 0 15px;
    }
    
    .academy__title {
        margin: 30px 0 20px;
    }
    
    .academy--text {
        font-size: clamp(20px, 5vw, 28px);
    }
    
    .academy--span-text-or {
        font-size: clamp(14px, 3vw, 18px);
    }
    
    .academy__search {
        padding: 20px 0;
    }
    
    .academy__search-wrapper {
        padding: 10px 16px;
    }
    
    .academy__keyword {
        margin-bottom: 20px;
    }
    
    .academy__keyword--list {
        gap: 8px;
        padding-bottom: 5px;
    }
    
    .keyword--list__item {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .course--list--content {
        min-height: auto;
        padding: 16px;
    }
    
    .course--list--title {
        font-size: 16px;
        min-height: 44px;
    }
    
    .course--list--desc {
        font-size: 13px;
        min-height: 38px;
    }
    
    .academy__course {
        margin-top: 30px;
    }
    
    .academy__course--title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .seemore {
        margin-top: 30px;
    }
    
    .seemore--link {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .academy__course-content {
        padding: 0 10px;
    }
    
    .academy__title {
        margin: 20px 0 15px;
    }
    
    .keyword--list__item {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Pagination Styles - Bootstrap */
.pagination-wrapper {
    margin-top: 40px;
    padding: 20px 0;
}

/* Bootstrap pagination customization */
.pagination-wrapper .pagination {
    margin-bottom: 0;
}

.pagination-wrapper .page-link {
    color: #666;
    border-color: #e4e4e4;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.pagination-wrapper .page-link:hover {
    color: #8d4df3;
    background-color: #f8f6ff;
    border-color: #8d4df3;
}

.pagination-wrapper .page-item.active .page-link {
    background: linear-gradient(119.16deg, #8D4DF3 0%, #0120D4 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(141, 77, 243, 0.3);
}

.pagination-wrapper .page-item.active .page-link:hover {
    background: linear-gradient(119.16deg, #8D4DF3 0%, #0120D4 100%);
    color: #fff;
}

.pagination-wrapper .page-item.disabled .page-link {
    color: #999;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #fff;
    border-color: #e4e4e4;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-wrapper {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .pagination-wrapper .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pagination-wrapper {
        margin-top: 20px;
        padding: 10px 0;
    }
    
    .pagination-wrapper .page-link {
        padding: 0.35rem 0.5rem;
        font-size: 13px;
    }
    
    .pagination-wrapper .pagination {
        flex-wrap: wrap;
        justify-content: center !important;
    }
}

