/* Educational Platform Custom Styles */

/* Color Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.6;
}

/* Rounded Button Styles */
.btn {
    border-radius: 12px !important;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-sm {
    border-radius: 8px !important;
    padding: 0.5rem 1rem;
}

.btn-lg {
    border-radius: 16px !important;
    padding: 1rem 2rem;
}

/* Rounded Pill Buttons */
.rounded-pill {
    border-radius: 50rem !important;
}

/* Badge Styles */
.badge {
    border-radius: 8px !important;
    font-weight: 500;
}

.badge.rounded-pill {
    border-radius: 50rem !important;
}

/* Form Control Rounded */
.form-control, .form-select {
    border-radius: 10px !important;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

/* Input Group Rounded */
.input-group .form-control:first-child {
    border-radius: 10px 0 0 10px !important;
}

.input-group .form-control:last-child {
    border-radius: 0 10px 10px 0 !important;
}

.input-group .btn {
    border-radius: 0 10px 10px 0 !important;
}

.input-group-text {
    border-radius: 10px 0 0 10px !important;
    border: 2px solid #e9ecef;
}

/* Card Rounded */
.card {
    border-radius: 16px !important;
    border: none;
}

/* Alert Rounded */
.alert {
    border-radius: 12px !important;
    border: none;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #6f42c1);
    color: white;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

/* Statistics Section */
.stat-item {
    padding: 2rem 1rem;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

/* Course Cards */
.card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 16px !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Home page course cards */
.course-card {
    height: 100%;
    min-height: 420px;
}

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

.course-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.75rem;
}

.course-card .course-rating {
    font-size: 0.75rem;
}

.course-card .course-price {
    font-size: 1rem;
    font-weight: 600;
}

.course-card .course-price-original {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Courses page specific cards */
.course-item .course-card {
    min-height: 480px;
}

.course-item .card-body {
    padding: 1.25rem;
    height: auto;
    min-height: 280px;
}

.course-item .card-title {
    font-size: 1.1rem;
    height: auto;
    min-height: 2.6em;
    margin-bottom: 1rem;
}

.course-item .card-text {
    height: 4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 1rem;
}

.course-item .mt-auto {
    margin-top: auto !important;
}

/* Better spacing for course meta */
.course-meta {
    margin-bottom: 0.75rem;
}

.course-meta .badge {
    font-size: 0.7rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Improved course card layout */
.featured-course {
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.featured-course:hover {
    border-color: rgba(13, 110, 253, 0.3);
}

/* Course thumbnail */
.course-thumbnail {
    height: 180px;
    width: 100%;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

/* Button styling for course cards */
.course-card .btn,
.course-item .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
}

/* Prevent text overlap */
.course-card .d-flex {
    gap: 0.5rem;
}

.course-card .d-flex.justify-content-between {
    gap: 1rem;
}

.course-card small {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .course-card {
        min-height: auto;
        height: auto;
    }
    
    .course-card .card-body,
    .course-item .card-body {
        height: auto;
        min-height: auto;
    }
    
    .course-card .card-title,
    .course-item .card-title {
        height: auto;
        min-height: auto;
    }
    
    .course-item .card-text {
        height: auto;
    }
}

@media (max-width: 576px) {
    .course-card .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .course-card small {
        white-space: normal;
    }
}

/* Course Detail Page Styles */
.course-sidebar-card {
    border-radius: 16px !important;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.course-sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.course-sidebar-card .card-header {
    border-radius: 16px 16px 0 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

.course-sidebar-card .card-body {
    padding: 1.25rem;
}

/* Fix sidebar spacing and prevent overlap */
.col-lg-4 {
    position: relative;
    z-index: 1;
}

.col-lg-8 {
    position: relative;
    z-index: 2;
}

/* Ensure proper spacing between cards */
@media (min-width: 992px) {
    .course-sidebar-card {
        position: static !important;
        top: auto !important;
    }
}

/* Tab styles improvement */
.nav-tabs .nav-link {
    border-radius: 8px 8px 0 0 !important;
    border: none;
    padding: 0.75rem 1.25rem;
    margin-right: 0.25rem;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
    border-color: var(--primary-color);
}

/* Overview tab enhancements */
.overview-content .card {
    border-radius: 12px !important;
    border: none;
    transition: all 0.3s ease;
}

.overview-content .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Quick stats styling */
.overview-content .border {
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    transition: all 0.3s ease;
}

.overview-content .border:hover {
    border-color: rgba(13, 110, 253, 0.2) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Instructor profile styling */
.instructor-profile .card {
    border-radius: 16px !important;
    transition: all 0.3s ease;
}

.instructor-profile .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.instructor-badges .badge {
    border-radius: 8px !important;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Curriculum accordion styling */
.accordion-item {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0.75rem;
}

.accordion-button {
    border-radius: 8px !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.05);
    color: var(--primary-color);
}

.accordion-body {
    padding: 1.25rem;
}

.video-item {
    border-radius: 8px !important;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.video-item:hover {
    background-color: rgba(13, 110, 253, 0.02);
    border-color: rgba(13, 110, 253, 0.1);
    transform: translateX(4px);
}

/* Course header improvements */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 16px !important;
}

/* Price display enhancement */
.price-display {
    padding: 1rem;
    background: rgba(13, 110, 253, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(13, 110, 253, 0.1);
}

/* Responsive improvements */
@media (max-width: 991.98px) {
    .col-lg-8,
    .col-lg-4 {
        z-index: auto;
    }
    
    .course-sidebar-card {
        margin-bottom: 1rem;
    }
    
    .instructor-profile .col-md-3 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .overview-content .col-md-3,
    .overview-content .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .instructor-profile .col-md-3,
    .instructor-profile .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Loading states for course detail */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Category Cards */
.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #dee2e6;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Feature Items */
.feature-item {
    padding: 2rem 1rem;
}

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

/* Buttons */
.btn {
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Video Player */
.video-container {
    position: relative;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

.video-player {
    width: 100%;
    height: auto;
}

/* Course Sidebar */
.course-sidebar {
    background: var(--light-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
}

.section-header {
    background: #fff;
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin: 1rem 0 0.5rem 0;
    border-radius: 0 0.25rem 0.25rem 0;
    font-weight: 600;
}

.video-item {
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-item:hover {
    background: #e9ecef;
}

.video-item.active {
    background: var(--primary-color);
    color: white;
}

.video-item.completed {
    background: var(--success-color);
    color: white;
}

/* Dashboard */
.dashboard-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Tables */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background: var(--light-color);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Search Results */
.search-results {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-item {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-item:hover {
    background: var(--light-color);
}

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

/* Video Security */
video {
    pointer-events: none;
}

video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Custom Video Controls */
.custom-video-controls {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
}

.control-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    margin-right: 1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.control-button:hover {
    color: var(--primary-color);
}

.time-display {
    font-family: monospace;
    font-size: 0.875rem;
    margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .course-sidebar {
        position: static;
        margin-top: 2rem;
    }
    
    .stat-item,
    .feature-item {
        padding: 1rem;
    }
}

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

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

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .video-container,
    .btn,
    .course-sidebar {
        display: none !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}