:root {
    --sidebar-width: 280px;
    --navbar-height: 70px;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-sidebar: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-sidebar: #ffffff;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --hover-bg: #f1f5f9;
    --active-color:rgb(227, 96, 124);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: rgba(171, 152, 115);
    color: var(--text-sidebar);
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    pointer-events: none;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-sidebar);
}

/* Navigation Menu */
.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 5px 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.menu-item.active {
    background: linear-gradient(135deg,rgb(168, 237, 252) 0%,rgb(21, 74, 165) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.menu-item i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.menu-item .menu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.menu-item.active .menu-arrow {
    transform: rotate(90deg);
}

/* Sub Sidebar Styles */
.sub-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: var(--sidebar-width);
    width: 280px;
    height: calc(100vh - var(--navbar-height));
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    z-index: 998;
    transition: transform 0.3s ease, left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);
}

.sub-sidebar.show {
    transform: translateX(0);
}

.sub-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sub-sidebar-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.sub-sidebar-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    position: relative;
}

.sub-sidebar-close-btn:hover {
    background: var(--hover-bg);
    color: var(--active-color);
    transform: scale(1.1);
}

.sub-sidebar-close-btn:active {
    transform: scale(0.95);
}

.sub-sidebar-menu {
    padding: 10px 0;
    margin: 0;
    list-style: none;
}

.sub-sidebar-menu li {
    margin: 5px 10px;
}

.sub-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sub-nav-item:hover {
    background: var(--hover-bg);
    color: var(--active-color);
    transform: translateX(5px);
}

.sub-nav-item.active {
    background: linear-gradient(135deg,rgb(240, 137, 180) 0%, rgba(252, 51, 112)100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sub-nav-item i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.hidden ~ .sub-sidebar {
    left: 0;
}

.sub-sidebar.show {
    left: var(--sidebar-width);
}

.sidebar.hidden ~ .sub-sidebar.show {
    left: 0;
}

/* Navbar Styles */
.navbar-custom {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background-color: rgba(171, 152, 115);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 999;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: left 0.3s ease, background-color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.sidebar.hidden ~ .navbar-custom {
    left: 0;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.social-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.social-btn.facebook:hover {
    color: #1877f2;
    background: rgba(24, 119, 242, 0.1);
}

.social-btn.youtube:hover {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}


/* Content Area */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-right: 0;
    margin-top: var(--navbar-height);
    padding: 40px;
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s ease, margin-right 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
    position: relative;
    background: var(--bg-primary);
}

.sidebar.hidden ~ .content-wrapper {
    margin-left: 0;
}

.sub-sidebar.show ~ .content-wrapper {
    margin-left: calc(var(--sidebar-width) + 280px);
}

.sub-sidebar.show ~ .intro-section {
    left: calc(var(--sidebar-width) + 280px);
}


/* Remove padding when intro section is visible */
.content-wrapper.intro-active {
    padding: 0;
}

.content-wrapper.intro-active .content-header {
    padding: 40px;
}

.content-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.content-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.content-header p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Intro Section */
.intro-section {
    position: fixed;
    top: var(--navbar-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    width: calc(100% - var(--sidebar-width));
    height: calc(100vh - var(--navbar-height));
    min-height: 500px;
    overflow: hidden;
    z-index: 1;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sidebar.hidden ~ .content-wrapper .intro-section {
    left: 0;
    width: 100%;
}


@media (max-width: 767.98px) {
    .intro-section {
        left: 0;
        width: 100%;
        top: 60px;
        height: calc(100vh - 60px);
    }
}

.intro-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.intro-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-width: 100%;
    min-height: 100%;
}

.intro-slide.active {
    opacity: 1;
}

/* Ensure images fill the entire area without white borders on all sides */
@media (min-width: 768px) {
    .intro-slide {
        background-size: 120% 120%;
        background-position: center center;
    }
}

@media (max-width: 767.98px) {
    .intro-slide {
        background-size: 130% 130%;
        background-position: center center;
    }
}

.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.intro-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    width: 90%;
    max-width: 700px;
    padding: 0;
}

.welcome-box {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
    margin-bottom: 30px;
}

.welcome-box h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.welcome-box .subtitle-th {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: #334155;
    margin-bottom: 10px;
    font-weight: 500;
}

.welcome-box .subtitle-en {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #64748b;
    margin-bottom: 30px;
}

.start-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    text-decoration: none;
    display: inline-block;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: white;
}

.contact-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 4;
    width: 90%;
    max-width: 1200px;
}

.contact-item {
    background: white;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.9rem;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.contact-item i {
    font-size: 1.2rem;
}

.contact-item.email i {
    color: #1e293b;
}

.contact-item.phone i {
    color: #10b981;
}

.contact-item.facebook i {
    color: #1877f2;
}

.contact-item.youtube i {
    color: #ff0000;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-indicators {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 4;
}

@media (max-width: 768px) {
    .welcome-box {
        padding: 30px 25px;
    }
    
    .welcome-box h1 {
        font-size: 2rem;
    }
    
    .contact-info {
        bottom: 15px;
        gap: 10px;
    }
    
    .contact-item {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .contact-item.email span,
    .contact-item.phone span {
        display: none;
    }
    
    .intro-indicators {
        bottom: 80px;
    }
}

@media (max-width: 576px) {
    .welcome-box {
        padding: 25px 20px;
    }
    
    .start-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .contact-item {
        padding: 8px 12px;
    }
    
    .contact-item i {
        font-size: 1rem;
    }
}

.intro-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.intro-indicator.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}
/* Content Cards */
.content-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.content-card:hover {
    box-shadow: 0 6px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Responsive Styles - Bootstrap Breakpoints */

/* Extra Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    :root {
        --sidebar-width: 300px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .intro-content h1 {
        font-size: 3rem;
    }
    
    .intro-content p {
        font-size: 1.3rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .content-wrapper {
        padding: 20px;
    }
    
    .intro-section {
        height: calc(100vh - var(--navbar-height));
        min-height: 450px;
        margin: -20px -20px 20px -20px;
    }
    
    .intro-content h1 {
        font-size: 2.5rem;
    }
    
    .intro-content p {
        font-size: 1.2rem;
    }
    
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sub-sidebar {
        left: 0;
        z-index: 999;
    }
    
    .navbar-custom {
        left: 0;
        padding: 0 15px;
    }
    
    .content-wrapper {
        margin-left: 0;
        padding: 15px;
    }
    
    .intro-section {
        height: calc(100vh - var(--navbar-height));
        min-height: 400px;
        margin: -15px -15px 15px -15px;
    }
    
    .intro-content {
        padding: 15px;
    }
    
    .intro-content h1 {
        font-size: 2rem;
    }
    
    .intro-content p {
        font-size: 1.1rem;
    }
    
    
    .navbar-title {
        font-size: 1.1rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    :root {
        --navbar-height: 60px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sub-sidebar {
        left: 0;
        z-index: 999;
    }
    
    .sub-sidebar-header {
        padding: 15px;
    }
    
    .sub-sidebar-close-btn {
        font-size: 1.3rem;
        padding: 4px 8px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .logo {
        width: 35px;
        height: 35px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .menu-item {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .navbar-custom {
        left: 0;
        height: 60px;
        padding: 0 15px;
    }
    
    .navbar-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .hamburger-btn {
        font-size: 1.3rem;
        padding: 6px;
    }
    
    .content-wrapper {
        margin-left: 0;
        margin-top: 60px;
        padding: 12px;
    }
    
    .intro-section {
        height: calc(100vh - 60px);
        min-height: 350px;
        margin: -12px -12px 12px -12px;
    }
    
    .intro-content {
        padding: 15px;
        width: 95%;
    }
    
    .intro-content h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .intro-content p {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .intro-indicators {
        bottom: 20px;
    }
    
    .intro-indicator {
        width: 10px;
        height: 10px;
    }
    
    .intro-indicator.active {
        width: 25px;
    }
    
    
    .content-wrapper {
        padding: 20px;
    }
    
    .content-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .content-header h1 {
        font-size: 1.75rem;
    }
    
    .content-header p {
        font-size: 1rem;
    }
    
    .content-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* Very small devices (less than 400px) */
@media (max-width: 399.98px) {
    .navbar-title {
        font-size: 0.9rem;
    }
    
    .intro-content h1 {
        font-size: 1.5rem;
    }
    
    .intro-content p {
        font-size: 0.9rem;
    }
    
}

