/* Main Styles for eLearning Platform */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 50px; /* Add padding to prevent content from being hidden behind the sticky navbar */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #2c3e50;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: none;
}

/* Navigation */
.navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0.25rem 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1030;
    background-color: rgba(240, 248, 255, 0.98) !important; /* Light blue background */
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.2s ease-in-out;
    min-height: 50px !important;
    border-bottom: 1px solid rgba(173, 216, 230, 0.5) !important; /* Lighter blue border */
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem !important;
    padding: 0.25rem 0 !important;
}

.nav-link {
    font-weight: 500;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.9rem !important;
}

.navbar-toggler {
    padding: 0.25rem 0.5rem !important;
    font-size: 1rem !important;
}

/* Hero Section */
.hero-section {
    background: none;
    color: inherit;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
    min-height: 200px;
}

/* Ensure carousel items take full height */
#heroCarousel,
#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
    height: 100%;
}

/* Container and row adjustments */
#heroCarousel .container {
    max-width: 1400px;
    padding: 0 15px;
    height: 100%;
    min-height: 200px;
}

#heroCarousel .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    height: 100%;
    min-height: 200px;
    align-items: stretch;
}

/* Column adjustments */
#heroCarousel .col-lg-5,
#heroCarousel .col-lg-2 {
    position: relative;
    min-height: 1px;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
}

/* Add margin between cards on desktop */
@media (min-width: 992px) {
    #heroCarousel .col-lg-6:first-child {
        padding-right: 0.75rem; /* More space to the right of first column */
    }
    
    #heroCarousel .col-lg-6:last-child {
        padding-left: 0.75rem; /* More space to the left of second column */
    }
}

/* Text card styles */
.hero-text-card {
    height: 100%;
    min-height: 200px;
    padding: 0 10px !important;
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
}

.hero-text-card .card {
    height: 100% !important;
    min-height: 200px;
}

.hero-text-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Image card styles */
.hero-image-card {
    height: 100%;
    min-height: 200px;
    padding: 0 10px !important;
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    margin-left: auto;
}

.hero-image-card .card {
    height: 100% !important;
    min-height: 200px;
}

.hero-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-section h1 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.hero-section p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    height: 160px;
    object-fit: cover;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-text {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: #3498db;
    border-color: #3498db;
}

.btn-outline-primary:hover {
    background-color: #3498db;
    border-color: #3498db;
    transform: translateY(-2px);
}

/* Testimonials */
.testimonials {
    background-color: #f8f9fa;
    border-radius: 10px;
}

.testimonial-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ecf0f1;
    text-decoration: none;
}

footer h5 {
    color: #ecf0f1;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Ratings */
.ratings {
    color: #f1c40f;
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    position: relative;
    z-index: 1;
}

/* Cart Count Badge */
#cart-count {
    font-size: 0.6rem !important;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4em;
    top: -5px !important;
    right: -5px !important;
    transform: none !important;
    transform-origin: center;
    line-height: 1;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px #dc3545;
}

/* Ensure the cart icon has proper positioning context */
.nav-link[href*="cart"] {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Adjust the shopping cart icon container */
.fa-shopping-cart {
    font-size: 1.1rem;
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.rounded-lg {
    border-radius: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* All Skills Section */
#all-skills {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#all-skills h2 {
    background: linear-gradient(90deg, #2c3e50 0%, #4361ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
    margin-bottom: 1rem !important;
    font-size: 1.75rem;
}

/* Category Navigation */
.categories-container {
    position: relative;
    margin: 0 auto 1.5rem;
    max-width: 1200px;
}

.categories-scroll-container {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 1rem;
    margin: 0 -0.5rem;
    scrollbar-width: none; /* Firefox */
}

.categories-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.categories-scroll {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.5rem;
    min-width: max-content;
}

.category-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    color: #495057;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4361ee0d 0%, #3a86ff0d 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #4361ee30;
    color: #4361ee;
}

.category-btn:hover::before {
    opacity: 1;
}

.category-btn.active {
    background: linear-gradient(135deg, #4361ee 0%, #3a86ff 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
}

.category-btn.active .category-icon {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8f9fa;
    margin-bottom: 0.5rem;
    color: #4361ee;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.category-text {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.category-count {
    font-size: 0.7rem;
    background: #f1f3f5;
    color: #6c757d;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .categories-scroll {
        gap: 0.4rem;
        padding: 0 0.4rem;
    }
    
    .category-btn {
        padding: 0.6rem 0.5rem;
        min-width: 80px;
    }
    
    .category-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .category-text {
        font-size: 0.75rem;
    }
    
    .category-count {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
    }
}

/* Popular Courses & More Courses Sections */
#popular-courses,
#more-courses {
    padding: 1.5rem 0;
    position: relative;
    background-color: #fff;
}

#more-courses {
    background-color: #f8f9fa;
}

.course-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.1);
    border-color: #4361ee40;
}

.course-card .card-img-top {
    height: 140px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.3s ease;
}

.course-card:hover .card-img-top {
    transform: scale(1.03);
}

.course-card .card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    display: -moz-box;
    -moz-box-orient: vertical;
    display: -ms-box;
    -ms-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
    color: #2d3748;
}

.course-card .card-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.course-card .instructor {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.course-card .instructor i {
    margin-right: 6px;
    color: #4361ee;
}

.course-card .card-footer {
    background: transparent;
    border-top: 1px solid #f1f3f5;
    padding: 0.75rem 1.25rem;
    margin-top: auto;
}

.course-price {
    font-weight: 700;
    color: #4361ee;
    font-size: 1.05rem;
}

.course-price .original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    font-weight: normal;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.course-rating {
    color: #ffc107;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.course-rating span {
    color: #6c757d;
    margin-left: 0.25rem;
}

.course-duration {
    display: flex;
    align-items: center;
}

.course-duration i {
    margin-right: 0.25rem;
}

/* Responsive styles for course sections */
@media (max-width: 992px) {
    #popular-courses,
    #more-courses {
        padding: 1.25rem 0;
    }
    
    .course-card .card-body {
        padding: 1rem;
    }
    
    .course-card .card-title {
        font-size: 0.9rem;
    }
    
    .course-card .instructor {
        font-size: 0.75rem;
    }
    
    .course-price {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    #popular-courses,
    #more-courses {
        padding: 1rem 0;
    }
    
    .course-card .card-img-top {
        height: 120px;
    }
    
    .course-card .card-body {
        padding: 0.75rem;
    }
    
    .course-card .card-title {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .course-card .instructor {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    
    .course-card .card-footer {
        padding: 0.6rem 0.75rem;
    }
    
    .course-price {
        font-size: 0.95rem;
    }
    
    .course-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .course-card .card-img-top {
        height: 100px;
    }
    
    .course-card .card-title {
        font-size: 0.8rem;
    }
    
    .course-card .instructor {
        font-size: 0.65rem;
    }
    
    .course-card .card-footer {
        padding: 0.5rem;
    }
    
    .course-price {
        font-size: 0.9rem;
    }
    
    .course-meta {
        font-size: 0.7rem;
    }
}

/* Course Categories */
.category-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #3498db;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-dismissible .btn-close {
    padding: 1rem;
}
