/* Custom Styles for HistCoursera */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Variables */
:root {
    --primary-color: #2e5d4b;
    --primary-hover: #1e3d32;
    --secondary-color: #4a8c6e;
    --accent-color: #89b668;
    --success-color: #4d8c56;
    --warning-color: #d6b85e;
    --danger-color: #c24a4a;
    --light-color: #f0f5f2;
    --dark-color: #1a2821;
    --text-color: #2c3d33;
    --text-muted: #6b7e75;
    --bg-color: #f0f5f2;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* General Styles */
body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Buttons */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover, .btn-success:focus {
    background-color: #3d8b40;
    border-color: #3d8b40;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Card Hover Effects */
.card {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background-color: white;
}

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

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

.card-text {
    color: var(--text-muted);
}

/* Course Cards */
.course-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.course-card .card-text {
    flex-grow: 1;
}

.course-card .card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

.course-image {
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
    color: var(--dark-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
    color: var(--dark-color) !important;
}

.bg-info {
    background-color: var(--secondary-color) !important;
    color: var(--dark-color) !important;
}

/* Star Ratings */
.star-rating {
    color: #ffc107;
}

.star-rating-interactive .fa-star, 
.star-rating-interactive .fa-star-half-alt {
    cursor: pointer;
}

.star-rating-form .form-check-input {
    display: none;
}

.star-rating-form .form-check-label {
    cursor: pointer;
    padding: 0 2px;
}

.star-rating-form .form-check-input:checked ~ .form-check-label i {
    color: #ccc;
}

.star-rating-form .form-check-label:hover i,
.star-rating-form .form-check-label:hover ~ .form-check-label i {
    color: #ffc107;
}

/* Video Embed */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: white;
}

.navbar-dark .navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.navbar-dark .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-link.active {
    font-weight: 600;
    position: relative;
}

.nav-link.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 1.5px;
}

.navbar-dark .nav-link.active:after {
    background-color: white;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--card-shadow);
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .course-image {
        height: 180px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .navbar-nav .dropdown-menu {
        box-shadow: none;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5rem 0;
    border-radius: 0;
    margin-top: -1rem;
    position: relative;
    overflow: hidden;
}

.hero-section:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/static/img/pattern.svg');
    opacity: 0.1;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

footer h5 {
    font-weight: 600;
    margin-bottom: 1.25rem;
    position: relative;
    display: inline-block;
}

footer h5:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.5rem;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 1.5px;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    padding: 0.25rem 0;
}

footer a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

footer .social-icons {
    margin-top: 1rem;
}

footer .social-icons a {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: var(--transition);
}

footer .social-icons a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

footer hr {
    margin: 2rem 0;
    opacity: 0.1;
}

footer .copyright {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Lesson Description */
.lesson-description {
    line-height: 1.8;
    font-size: 1.1rem;
}

.lesson-description h1, 
.lesson-description h2, 
.lesson-description h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.lesson-description ul, 
.lesson-description ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-description img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: var(--card-shadow);
}

/* Comments Section Styles */
.comments-list {
    margin-top: 20px;
}

.comment {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 0;
}

.comment:last-child {
    border-bottom: none;
}

.replies {
    margin-left: 2.5rem;
    padding-left: 1.5rem;
    border-left: 3px solid rgba(0, 0, 0, 0.05);
}

.reply {
    padding: 1rem 0;
}

.reply:not(:last-child) {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.reply-btn {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.reply-form {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Comment author name */
.comment h5, .reply h6 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Comment timestamp */
.comment .text-muted, .reply .text-muted {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Comment text */
.comment p, .reply p {
    margin: 0.75rem 0;
    white-space: pre-line; /* Preserve line breaks */
}

/* Course Navigation */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    border-radius: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: ">";
}

/* Profile Avatar */
.rounded-circle {
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--card-shadow);
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-md {
    width: 60px;
    height: 60px;
}

.avatar-lg {
    width: 120px;
    height: 120px;
}

/* Feature Cards */
.feature-card {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background-color: white;
    padding: 2rem;
    text-align: center;
    height: 100%;
}

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

.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

/* Section Styling */
.section-title {
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
    text-align: center;
}

.section-title:after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -15px;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Gamification Elements */
.level-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
}

.points-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.streak-badge {
    background-color: var(--warning-color);
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    margin-left: 0.5rem;
}

/* Achievement & Task Toast Notifications */
.toast {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-bottom: none;
    padding: 0.75rem 1rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.toast-body {
    padding: 1rem;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .navbar-collapse {
        padding: 1rem 0;
    }
    
    .nav-link.active:after {
        display: none;
    }
    
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-section p {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .d-flex.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .d-flex.align-items-center > div {
        margin-bottom: 0.5rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .section-title {
        margin-bottom: 2.5rem;
    }
}

/* Progress Banner Styles */
.progress-banner {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    margin: -1px;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    color: white !important;
}

.progress-banner .icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
}

.progress-banner .progress {
    background: rgba(255, 255, 255, 0.2);
    height: 12px;
    border-radius: 10px;
}

.progress-banner .progress-bar {
    background-color: white;
}

.progress-banner .badge {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 20px;
    padding: 0.5rem 1rem;
}

.completion-banner {
    background-color: #d1e7dd;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    margin: -1px;
}

.completion-banner .achievement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

/* Icon Circle */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: rgba(67, 97, 238, 0.1);
}

/* Lesson Item Styles */
.lesson-item {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.lesson-item:hover {
    background-color: rgba(67, 97, 238, 0.05);
    color: inherit;
    text-decoration: none;
}

.lesson-number-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.lesson-completed {
    color: var(--success-color);
}

.lesson-type-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-video {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.badge-interactive {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

/* Course Stats Styles */
.course-stats-grid {
    display: grid;
    gap: 0;
}

.stats-item {
    transition: var(--transition);
}

.stats-item:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.stats-value {
    padding-left: 3.5rem;
}

.badge-custom {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.badge-category {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.badge-beginner {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.badge-intermediate {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.badge-advanced {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
}

.badge-count {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.badge-enrollment {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.badge-rating {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
} 