/* style.css - Ultra Modern Theme */

:root {
    --primary-color: #6a11cb;
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --secondary-gradient: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    --bg-color: #f4f7f6;
    --sidebar-width: 280px;
    --text-color: #333;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.05);
    --hover-shadow: 0 15px 35px rgba(37, 117, 252, 0.2);
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* --- Sidebar --- */
.wrapper { display: flex; align-items: stretch; width: 100%; }

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #fff;
    color: #555;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bounce Effect */
    box-shadow: 5px 0 15px rgba(0,0,0,0.03);
    z-index: 999;
    position: relative;
}

#sidebar.active { margin-left: calc(var(--sidebar-width) * -1); }

.sidebar-header {
    padding: 30px 20px;
    background: var(--primary-gradient);
    color: #fff;
    text-align: center;
    border-bottom-right-radius: 50px; /* ดีไซน์มุมโค้ง */
    margin-bottom: 20px;
}

.logo-box {
    background: rgba(255,255,255,0.2);
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    backdrop-filter: blur(5px);
}

#sidebar ul.components { padding: 0 10px; }
.menu-label { 
    padding: 10px 20px; 
    font-size: 0.8em; 
    color: #999; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    margin-bottom: 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 1em;
    display: block;
    color: #666;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: 0.3s;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
    transform: translateX(5px);
}

#sidebar ul li a i { margin-right: 10px; width: 20px; text-align: center; }

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
}
.user-pic img { width: 40px; height: 40px; margin-right: 10px; }
.user-info { flex-grow: 1; line-height: 1.2; }
.user-name { display: block; font-weight: 600; font-size: 0.9em; }
.user-role { font-size: 0.8em; color: #28a745; }
.btn-logout { color: #dc3545; font-size: 1.2em; }

/* --- Navbar Glass --- */
#content { width: 100%; transition: all 0.3s; }

.navbar-glass {
    background: rgba(255, 255, 255, 0.8); /* โปร่งแสง */
    backdrop-filter: blur(10px); /* เบลอพื้นหลัง */
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-circle-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: var(--primary-color);
    transition: 0.3s;
}
.btn-circle-icon:hover { transform: rotate(90deg); background: var(--primary-color); color: #fff; }

.page-title { font-size: 1.2em; font-weight: 600; color: #444; margin-left: 15px; vertical-align: middle; }
.btn-nav-login { 
    background: var(--primary-gradient); 
    color: #fff !important; 
    padding: 8px 25px !important; 
    border-radius: 30px; 
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
}

/* --- Hero Section --- */
.hero-modern {
    background: #fff;
    border-radius: 30px;
    margin: 20px 30px;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
}

/* Abstract Background Shapes */
.hero-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}
.shape-1 { top: -50px; right: -50px; width: 300px; height: 300px; background: rgba(106, 17, 203, 0.15); }
.shape-2 { bottom: -50px; left: 50px; width: 200px; height: 200px; background: rgba(37, 117, 252, 0.15); }

.hero-content { position: relative; z-index: 1; width: 60%; }
.hero-image { position: relative; z-index: 1; width: 40%; text-align: right; }

.hero-modern h1 { 
    font-weight: 700; 
    font-size: 3em; 
    background: var(--primary-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin-bottom: 15px;
}
.hero-modern p { font-size: 1.2em; color: #777; margin-bottom: 30px; }

/* --- Course Cards (Premium) --- */
.card-container { padding: 0 30px; }

.category-title {
    font-size: 1.5em;
    font-weight: 600;
    margin: 40px 0 20px;
    padding-left: 15px;
    border-left: 5px solid #6a11cb;
    color: #444;
}

.course-card-modern {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    border: none;
    box-shadow: var(--card-shadow);
    transition: all 0.4s ease;
    position: relative;
}

.course-card-modern:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--hover-shadow);
}

.card-img-top {
    height: 180px;
    width: 100%;
    object-fit: cover;
    position: relative;
}

.badge-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    color: #6a11cb;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card-body-modern { padding: 25px; }

.course-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    height: 45px;
    overflow: hidden;
    line-height: 1.4;
    color: #333;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.btn-course-action {
    display: block;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    background: #f0f2f5;
    color: #555;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.course-card-modern:hover .btn-course-action {
    background: var(--primary-gradient);
    color: #fff;
    text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    #sidebar.active { margin-left: 0; }
    .hero-modern { flex-direction: column; text-align: center; padding: 40px 20px; margin: 20px 10px; }
    .hero-content, .hero-image { width: 100%; }
    .hero-image { display: none; } /* ซ่อนรูปบนมือถือเพื่อให้เนื้อหาเด่น */
    .card-container { padding: 0 15px; }
}