/**
 * CrackSAE.online - Main Stylesheet
 */

: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;
    --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    background-color: #f5f5f5;
    color: #333;
}

/* Navigation Enhancements */
.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--warning-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0 50px;
    margin-top: -80px;
    padding-top: 130px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Course Cards */
.course-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

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

.course-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.course-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.course-card .card-body {
    padding: 20px;
}

.course-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.course-card .instructor-name {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.course-card .course-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.course-card .course-stats span {
    font-size: 0.85rem;
    color: #777;
}

/* Module Progress */
.module-list {
    list-style: none;
    padding: 0;
}

.module-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.module-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.module-item.completed {
    border-left: 4px solid var(--success-color);
}

.module-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.module-item .module-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    color: #666;
}

.module-item.completed .module-icon {
    color: var(--success-color);
}

.module-item.locked .module-icon {
    color: #ccc;
}

/* Progress Bar */
.progress {
    height: 25px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Quiz Components */
.quiz-question {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.quiz-question .question-number {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    margin-right: 10px;
}

.quiz-options {
    margin-top: 15px;
}

.quiz-option {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.quiz-option input[type="radio"] {
    margin-right: 10px;
}

.quiz-option.correct {
    background: #d4edda;
    border-color: var(--success-color);
}

.quiz-option.incorrect {
    background: #f8d7da;
    border-color: var(--danger-color);
}

/* Dashboard Stats */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Video Player */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

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

/* Disable right-click on video */
.video-container {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

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

.auth-container {
    max-width: 400px;
    margin: 50px auto;
}

.auth-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.auth-card h2 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

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

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

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

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Announcements */
.announcement-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.announcement-card.pinned {
    border: 2px solid var(--warning-color);
}

.announcement-card h5 {
    margin-bottom: 10px;
}

.announcement-card .announcement-meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Discussion Forum */
.discussion-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.discussion-item .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.discussion-item .discussion-content {
    flex: 1;
    margin-left: 15px;
}

.discussion-item .discussion-meta {
    color: #666;
    font-size: 0.85rem;
}

/* Responsive Tables */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* LaTeX Rendering */
.katex-display {
    margin: 15px 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .course-card .card-img-top {
        height: 150px;
    }
    
    .stat-card {
        text-align: center;
    }
    
    .module-item {
        flex-direction: column;
        text-align: center;
    }
    
    .module-item .module-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Print Styles */
@media print {
    .navbar, footer, .no-print {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .main-content {
        padding-top: 0 !important;
    }
}

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

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

/* Certificate */
.certificate-container {
    background: white;
    border: 3px solid gold;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.certificate-container h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.certificate-container .certificate-seal {
    width: 100px;
    height: 100px;
    margin: 20px auto;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

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