/* Custom styles for Course Management System */

/* Sticky footer layout */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Hero Section */
.hero-section {
    background: white;
    color: #495057;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

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

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #6c757d;
}

/* Lesson Cards */
.lesson-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

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

.lesson-image {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.lesson-image-placeholder {
    height: 200px;
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

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

.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.lesson-content h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid #28a745;
    padding-bottom: 0.5rem;
}

.lesson-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.3rem;
}

.lesson-content h3 {
    font-size: 1.5rem;
    color: #34495e;
}

.lesson-content p {
    margin-bottom: 1.5rem;
}

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

.lesson-content li {
    margin-bottom: 0.5rem;
}

.lesson-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.lesson-content em {
    color: #7f8c8d;
}

.lesson-content a {
    color: #28a745;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.lesson-content a:hover {
    border-bottom-color: #28a745;
}

.lesson-content blockquote {
    border-left: 4px solid #28a745;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #7f8c8d;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0 5px 5px 0;
}

.lesson-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #e74c3c;
}

.lesson-content pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.lesson-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* Navigation */
.lesson-navigation {
    border-top: 2px solid #ecf0f1;
}

/* Admin Dashboard */
.admin-stats-card {
    border-radius: 15px;
    border: none;
    transition: transform 0.3s ease;
}

.admin-stats-card:hover {
    transform: translateY(-3px);
}

/* Forms */
.form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-primary:hover {
    background-color: #218838;
    border-color: #218838;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
    border-color: #229954;
}

.btn-outline-primary {
    color: #28a745;
    border-color: #28a745;
}

.btn-outline-primary:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Cards */
.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
    border-radius: 15px 15px 0 0 !important;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #ecf0f1;
    font-weight: 600;
    color: #2c3e50;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Modal */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #ecf0f1;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #ecf0f1;
    border-radius: 0 0 15px 15px;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar.bg-primary,
.navbar-dark.bg-primary,
.navbar.navbar-expand-lg.navbar-dark.bg-primary {
    background-color: #adb5bd !important; /* Lighter gray */
    border-color: #adb5bd !important;
}

/* Force override for all navbar variations */
.navbar[class*="bg-primary"] {
    background-color: #adb5bd !important;
    border-color: #adb5bd !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-section {
        min-height: auto;
        display: block;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    .hero-section img {
        margin-top: 2rem;
        width: 100%;
        height: auto;
    }
    .features-section .card {
        margin-bottom: 1.5rem;
    }
    .lesson-card, .admin-stats-card, .card {
        margin-bottom: 1.5rem;
    }
    .navbar .navbar-nav {
        text-align: center;
    }
    .navbar .nav-item {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }
    .hero-section .lead {
        font-size: 0.95rem;
    }
    .features-section h2 {
        font-size: 1.3rem;
    }
    .lesson-content h1, .course-content h1 {
        font-size: 1.5rem;
    }
    .lesson-content h2, .course-content h2 {
        font-size: 1.2rem;
    }
    .lesson-content h3, .course-content h3 {
        font-size: 1rem;
    }
    .lesson-content, .course-content {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .footer {
        font-size: 0.9rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Markdown preview */
.markdown-preview {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.markdown-preview p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.markdown-preview li {
    margin-bottom: 0.25rem;
}

.markdown-preview strong {
    font-weight: 600;
    color: #2c3e50;
}

.markdown-preview em {
    font-style: italic;
    color: #7f8c8d;
}

.markdown-preview a {
    color: #28a745;
    text-decoration: none;
}

.markdown-preview a:hover {
    text-decoration: underline;
}

/* Image upload preview */
.image-preview {
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Tab styling */
.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    background-color: #28a745;
    color: white;
    border: none;
}

.nav-tabs .nav-link:hover {
    border: none;
    background-color: #ecf0f1;
    color: #2c3e50;
}

.nav-tabs .nav-link.active:hover {
    background-color: #218838;
    color: white;
}

/* Icons - Override Bootstrap text-primary to green */
.text-primary {
    color: #28a745 !important;
}

/* Feature section icons */
.fa-3x.text-primary {
    color: #28a745 !important;
}

/* Any other icon with primary color */
i.text-primary,
.fas.text-primary,
.far.text-primary,
.fab.text-primary {
    color: #28a745 !important;
}

/* Hover states for icons */
.text-primary:hover {
    color: #218838 !important;
}

/* Navbar icons */
.navbar .nav-link i {
    color: inherit;
}

/* Admin dashboard icons */
.admin-stats-card i {
    color: inherit;
}

/* Ensure all FontAwesome icons with primary color are green */
.fa.text-primary,
.fas.text-primary,
.far.text-primary,
.fab.text-primary,
.fal.text-primary,
.fad.text-primary {
    color: #28a745 !important;
}

/* Card icons in features section */
.card-body .text-primary {
    color: #28a745 !important;
}

/* Button icons */
.btn .fas,
.btn .far,
.btn .fab {
    color: inherit;
}

/* About Section - Match hero section styling */
.course-content {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #495057;
}

.course-content h1,
.course-content h2,
.course-content h3 {
    color: #212529;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.course-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.course-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.course-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
}

.course-content p {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    line-height: 1.8;
}

.course-content ul,
.course-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    font-size: 1.25rem;
}

.course-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
} 