/* Custom Styles for LMS Lifelong Learning KU - Updated with index.php styles */

/* 
* Global Styles 
*/
/* Import Thai fonts including Pridi */
@import url('https://fonts.googleapis.com/css2?family=Pridi:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&family=Kanit:wght@300;400;500;600;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* Base font for Thai language with Pridi as first option */
:root {
    --thai-font-family: 'Pridi', 'Prompt', 'Sarabun', 'Kanit', 'Noto Sans Thai', sans-serif;
}

:root {
    /* Color scheme based on user specification */
    --teal-deep: #5fb3b3; /* สีเขียวเข้ม - บนสุด */
    --mint-medium: #88c999; /* สีเขียวกลาง */
    --mint-light: #b8e6c1; /* สีเขียวอ่อน */
    --cream-yellow: #f0e6a6; /* สีเหลืองครีม - ล่างสุด */
    
    /* Updated color variables using new color scheme */
    --primary-color: var(--teal-deep); /* Changed from #006266 to use new colors */
    --secondary-color: var(--mint-medium); /* Changed from #4A6700 to use new colors */
    --accent-color: var(--mint-light); /* Changed from #D4A200 to use new colors */
    --light-accent: var(--cream-yellow); /* New variable for cream yellow */
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family: var(--thai-font-family);
    
    /* Text colors that contrast well */
    --text-dark: #2d3748;          /* Dark text for light backgrounds */
    --text-medium: #4a5568;        /* Medium gray text */
    --text-light: #ffffff;         /* White text for dark backgrounds */
    --text-accent: #2d5a5a;        /* Dark teal for headings */
}

body {
    font-family: var(--font-family);
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* New gradient backgrounds using the color scheme */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 100%);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-family: var(--thai-font-family);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: color-mix(in srgb, var(--primary-color) 80%, black);
    border-color: color-mix(in srgb, var(--primary-color) 80%, black);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--thai-font-family);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary-color);
    color: white;
}

/* New gradient backgrounds using the color scheme */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--mint-medium) 0%, var(--mint-light) 100%);
}

.bg-gradient-light {
    background: linear-gradient(135deg, var(--mint-light) 0%, var(--cream-yellow) 100%);
}

/*
* Navigation
*/
.navbar-dark {
    background-color: var(--primary-color) !important;
}

/* .navbar-brand img {
    max-height: 40px;
} */

.navbar-nav .nav-link {
    font-family: var(--thai-font-family);
    font-weight: 500;
}

/*
* Banner
*/
.banner {
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.banner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner > div {
    z-index: 2;
}

.banner h1, .banner h2, .banner h3 {
    font-family: var(--thai-font-family);
    font-weight: 600;
}

/*
* Cards
*/
.card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.card-img-top {
    height: 180px;
    object-fit: cover;
}

.card-title {
    font-family: var(--thai-font-family);
    font-weight: 600;
}

.card-text {
    font-family: var(--thai-font-family);
}

/*
* Course Detail
*/
.lesson-content {
    font-size: 1.1rem;
    line-height: 1.8;
    font-family: var(--thai-font-family);
}

.lesson-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.lesson-content h1, .lesson-content h2, .lesson-content h3, 
.lesson-content h4, .lesson-content h5, .lesson-content h6 {
    font-family: var(--thai-font-family);
    font-weight: 600;
}

/*
* Dashboard
*/
.avatar img {
    object-fit: cover;
    border: 3px solid #f5f5f5;
}

/*
* Typography improvements with Pridi
*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--thai-font-family);
    font-weight: 600;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--thai-font-family);
    font-weight: 700;
}

.lead {
    font-family: var(--thai-font-family);
    font-weight: 400;
}

/*
* ===== CSS from index.php - Section Styles =====
*/

/* Section Styles */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-medium);
    margin-bottom: 3rem;
}


.course-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-mint);
    height: 100%;
    border-top: 3px solid var(--mint-medium);
    background: white;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .card-img-top {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
}

.category-badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Feature Cards */
.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.features-icon {
    color: var(--teal-deep);
    margin-bottom: 1.5rem;
}

.feature-title {
    color: var(--text-accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-description {
    color: var(--text-medium);
    line-height: 1.6;
}

/* Category Cards */
.category-card {
    display: block;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.category-title {
    color: var(--text-accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.category-description {
    color: #6b7280;
}

/* Statistics Section */
.stat-item {
    color: white;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/*Additional Styles for Loading and Back to Top */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #5fb3b3, #88c999);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-content {
    text-align: center;
    color: #2d3748;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(95, 179, 179, 0.3);
    border-top: 4px solid #5fb3b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/*
* Responsive adjustments
*/
@media (max-width: 767.98px) {
    .banner {
        min-height: 200px;
    }
    
    .card-img-top {
        height: 160px;
    }
    
    .section-padding {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
    }
}


/* Additional color utilities for the new color scheme */
.text-teal-deep {
    color: var(--teal-deep) !important;
}

.text-mint-medium {
    color: var(--mint-medium) !important;
}

.text-mint-light {
    color: var(--mint-light) !important;
}

.text-cream-yellow {
    color: var(--cream-yellow) !important;
}

.bg-teal-deep {
    background-color: var(--teal-deep) !important;
}

.bg-mint-medium {
    background-color: var(--mint-medium) !important;
}

.bg-mint-light {
    background-color: var(--mint-light) !important;
}

.bg-cream-yellow {
    background-color: var(--cream-yellow) !important;
}