/**
 * Front Module Styles
 * 
 * Main stylesheet for front-end module
 * Contains custom CSS variables and styles
 * 
 * @package    Front
 * @category   Styles
 * @author     Coach LMS
 * @version    1.0.0
 */

:root {
    --color-primary: #3F51B5;
    --color-secondary: #2196F3;
    --color-accent: #3F51B5;
    --color-background: #F8F9FB;
    --color-white: #FFFFFF;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
}

/* Gradient Primary */
.gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* Hover Scale Effect */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: translateY(-8px);
}

/* Checkout Step Styles */
.step-active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
}

/* =============================
   Select2 Custom Styling for Checkout Page
   ============================= */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    min-height: 48px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-left: 1rem;
    padding-right: 1rem;
    line-height: 46px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 46px;
}

.select2-container .select2-selection--single { height: 50px !important;  border-radius: 0.7rem !important;}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered{
    line-height: 2.2 !important;
}

/* =============================
   Stripe Card Element Styling
   ============================= */
#stripe-card-element {
    min-height: 50px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

#stripe-card-element.is-focused {
    border-color: #3F51B5 !important;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1) !important;
}

#stripe-card-element.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

#stripe-card-element.is-complete {
    border-color: #10b981 !important;
}

/* Stripe Input Styling */
#stripe-card-element .StripeElement {
    padding: 0;
}

#stripe-card-element input {
    font-size: 16px;
    color: #1f2937;
}

/* Error Message Styling */
#stripe-card-errors {
    min-height: 20px;
    padding: 8px 12px;
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
}

#stripe-card-errors:empty {
    display: none;
}

.step-completed {
    background: var(--color-accent);
    color: white;
}

.step-inactive {
    background: #e5e7eb;
    color: #6b7280;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Float Animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

/* Body Background */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-background);
}

/* Text Colors */
.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-secondary);
}

.text-accent {
    color: var(--color-accent);
}

/* Background Colors */
.bg-primary {
    background-color: var(--color-primary);
}

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

.bg-accent {
    background-color: var(--color-accent);
}

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

/* Button Styles */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--color-secondary);
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(63, 81, 181, 0.3);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-white);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--color-secondary);
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.3);
}

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

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* Category Swiper Cards - Same Size */
.category-swiper .swiper-slide {
    height: auto;
    display: flex;
}

.category-card {
    display: flex;
    flex-direction: column;
}

.category-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

/* Category Swiper Navigation Arrows */
.category-swiper-button-next,
.category-swiper-button-prev {
    width: 50px !important;
    height: 50px !important;
    padding: 20px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%) !important;
    color: var(--color-white) !important;
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.3);
    transition: all 0.3s ease;
}

.category-swiper-button-next:hover,
.category-swiper-button-prev:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(63, 81, 181, 0.4);
}

.category-swiper-button-next::after,
.category-swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}

.category-swiper-button-next {
    right: 0px !important;
}

.category-swiper-button-prev {
    left: 0px !important;
}

/* Media Queries for Category Swiper */
@media screen and (max-width: 768px) {
    .category-card {
        min-height: 200px;
    }
    
    .category-swiper-button-next,
    .category-swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
        padding: 15px;
    }
    
    .category-swiper-button-next::after,
    .category-swiper-button-prev::after {
        font-size: 14px !important;
    }
}

/* Testimonials Swiper Navigation Arrows */
.testimonials-swiper-button-next,
.testimonials-swiper-button-prev {
    width: 50px !important;
    height: 50px !important;
    padding: 20px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%) !important;
    color: var(--color-white) !important;
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.3);
    transition: all 0.3s ease;
}

.testimonials-swiper-button-next:hover,
.testimonials-swiper-button-prev:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(63, 81, 181, 0.4);
}

.testimonials-swiper-button-next::after,
.testimonials-swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}

.testimonials-swiper-button-next {
    right: 0px !important;
}

.testimonials-swiper-button-prev {
    left: 0px !important;
}

/* Media Queries for Testimonials Swiper */
@media screen and (max-width: 768px) {
    .testimonials-swiper-button-next,
    .testimonials-swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
        padding: 15px;
    }
    
    .testimonials-swiper-button-next::after,
    .testimonials-swiper-button-prev::after {
        font-size: 14px !important;
    }
}
.tab-active {
    border-bottom: 3px solid #3F51B5;
    color: #3F51B5;
}

/* Course Learn Page Styles */
.learn-page {
    font-family: 'Poppins', sans-serif;
}

.gradient-primary {
    background: linear-gradient(135deg, #3F51B5 0%, #03A9F4 100%);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

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

.sidebar-item.active {
    background: linear-gradient(135deg, #3F51B5 0%, #03A9F4 100%);
    color: white;
}

.sidebar-item.completed {
    color: #00C896;
}

.progress-ring {
    transform: rotate(-90deg);
}

.quiz-option {
    transition: all 0.3s ease;
}

.quiz-option:hover {
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: #3F51B5;
    background: rgba(63, 81, 181, 0.1);
}

.quiz-option.correct {
    border-color: #00C896;
    background: rgba(0, 200, 150, 0.2);
}

.quiz-option.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.certificate {
    background: linear-gradient(135deg, #fff 0%, #f8f9fb 100%);
    border: 8px solid #3F51B5;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulseSlow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes progressBar {
    from {
        width: 0%;
    }
}

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

.animate-slide-down {
    animation: slideDown 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out;
}

.animate-pulse-slow {
    animation: pulseSlow 2s ease-in-out infinite;
}

#quizProgress {
    animation: progressBar 0.5s ease-out;
}

#quizResults {
    animation: fadeIn 0.8s ease-out;
}

#quizTimer {
    transition: all 0.3s ease;
}

#quizTimer.low-time {
    animation: pulseSlow 1s ease-in-out infinite;
    color: #ef4444;
}

/* Student Course View Styles */
.tab-btn {
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    background: linear-gradient(135deg, #3F51B5 0%, #03A9F4 100%) !important;
    color: white !important;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3F51B5 0%, #03A9F4 100%);
}

.tab-btn:hover:not(.active) {
    background: rgba(63, 81, 181, 0.1);
}

.certificate {
    background: linear-gradient(135deg, #fff 0%, #f8f9fb 100%);
    border: 8px solid #3F51B5;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.module-card {
    transition: all 0.3s ease;
}

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

.assignment-card,
.quiz-card,
.resource-card {
    transition: all 0.3s ease;
}

.assignment-card:hover,
.quiz-card:hover,
.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   CKEditor Content Styles - Ensure Lists, Links, and Formatting Display Properly
   ========================================================================== */

/* Prose class styles for CKEditor content */
.prose ul,
.prose ol {
    list-style-position: outside !important;
    margin-left: 1.5rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    padding-left: 1.5rem !important;
}

.prose ul {
    list-style-type: disc !important;
}

.prose ol {
    list-style-type: decimal !important;
}

.prose li {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.75 !important;
    display: list-item !important;
}

/* Nested lists */
.prose ul ul {
    list-style-type: circle !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.prose ul ul ul {
    list-style-type: square !important;
}

.prose ol ol {
    list-style-type: lower-alpha !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.prose ol ol ol {
    list-style-type: lower-roman !important;
}

/* Links styling */
.prose a {
    color: var(--color-primary) !important;
    text-decoration: underline !important;
    transition: all 0.3s ease !important;
}

.prose a:hover {
    color: var(--color-secondary) !important;
    text-decoration: underline !important;
}

.prose a:visited {
    color: var(--color-primary) !important;
}

/* Headings */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    font-weight: 700 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
}

.prose h1 {
    font-size: 2.25rem !important;
}

.prose h2 {
    font-size: 1.875rem !important;
}

.prose h3 {
    font-size: 1.5rem !important;
}

.prose h4 {
    font-size: 1.25rem !important;
}

.prose h5 {
    font-size: 1.125rem !important;
}

.prose h6 {
    font-size: 1rem !important;
}

/* Paragraphs */
.prose p {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.75 !important;
}

/* Strong and emphasis */
.prose strong {
    font-weight: 700 !important;
}

.prose em {
    font-style: italic !important;
}

/* Blockquotes */
.prose blockquote {
    border-left: 4px solid var(--color-primary) !important;
    padding-left: 1rem !important;
    margin-left: 0 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    font-style: italic !important;
    color: var(--color-gray-600) !important;
}

/* Code */
.prose code {
    background-color: var(--color-gray-100) !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 0.25rem !important;
    font-size: 0.875em !important;
    font-family: 'Courier New', monospace !important;
}

.prose pre {
    background-color: var(--color-gray-100) !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    overflow-x: auto !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.prose pre code {
    background-color: transparent !important;
    padding: 0 !important;
}

/* Images */
.prose img {
    max-width: 100% !important;
    height: auto !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: 0.5rem !important;
}

/* Tables */
.prose table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.prose table th,
.prose table td {
    border: 1px solid var(--color-gray-300) !important;
    padding: 0.75rem !important;
    text-align: left !important;
}

.prose table th {
    background-color: var(--color-gray-100) !important;
    font-weight: 600 !important;
}

/* Horizontal rules */
.prose hr {
    border: none !important;
    border-top: 2px solid var(--color-gray-300) !important;
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}

/* Restore list styles for CKEditor content (Tailwind removes them by default) */
.ckeditor-content ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin-left: 1.5rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 1.5rem !important;
}

.ckeditor-content ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
    margin-left: 1.5rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 1.5rem !important;
}

.ckeditor-content li {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.6 !important;
}

/* Nested lists */
.ckeditor-content ul ul {
    list-style-type: circle !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.ckeditor-content ul ul ul {
    list-style-type: square !important;
}

.ckeditor-content ol ol {
    list-style-type: lower-alpha !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.ckeditor-content ol ol ol {
    list-style-type: lower-roman !important;
}

.ckeditor-content a {
    color: var(--color-primary) !important;
    text-decoration: underline !important;
    transition: all 0.3s ease !important;
}

.ckeditor-content a:hover {
    color: var(--color-secondary) !important;
    text-decoration: underline !important;
}

/* Quiz Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

.animate-slide-down {
    animation: slide-down 0.5s ease-out forwards;
}

.animate-slide-up {
    animation: slide-up 0.5s ease-out forwards;
}

.animate-bounce-in {
    animation: bounce-in 0.6s ease-out forwards;
}

.animate-pulse-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

/* Quiz Option Hover Effects */
.quiz-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-option:active {
    transform: translateY(0);
}

/* Confetti Animation */
@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    pointer-events: none;
}