/* ==========================================
   Top 1% - ท็อปวันเปอร์เซ็นต์ - Global Styles
   ========================================== */

/* Google Fonts - Kanit */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #000000;
    --glass-bg: rgba(28, 28, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #0A84FF;
    --text-main: #FFFFFF;
    --text-sec: #86868b;
    --gradient-orange: linear-gradient(135deg, #FFD60A, #FF9F0A);
    --gradient-blue: linear-gradient(135deg, #0A84FF, #5AC8FA);
    --gradient-purple: linear-gradient(135deg, #BF5AF2, #AF52DE);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    width: 100%;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* Animated Background */
.ambient-light {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(64, 156, 255, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(80px);
    z-index: -1;
    animation: float 10s infinite ease-in-out;
}

.ambient-light-2 {
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(191, 90, 242, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(80px);
    z-index: -1;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 40px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* ==========================================
   Graph Stats Widgets (iOS Style)
   ========================================== */
.graph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.graph-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    height: 180px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.graph-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.graph-info {
    z-index: 2;
    margin-bottom: auto;
}

.graph-label {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 5px;
}

.graph-number {
    font-size: 2em;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.5px;
}

/* Bar Chart Visualization */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
    width: 100%;
}

.bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-height: 4px;
    position: relative;
}

.bar.active {
    background: linear-gradient(to top, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

/* Line/Wave Chart styling (simulated with bars for now) */
.bar.purple {
    background: rgba(255, 255, 255, 0.1);
}

.bar.purple.active {
    background: linear-gradient(to top, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 0 15px rgba(251, 194, 235, 0.3);
}

/* Circular/Progress Styling */
.progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(250, 112, 154, 0.4);
}

/* Grid Dots */
.dots-chart {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.dot.active {
    background: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* ==========================================
   Floating Bubbles
   ========================================== */
.floating-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: bubbleFloat 15s ease-in-out infinite;
}

/* ==========================================
   About Page Responsive Grids
   ========================================== */
.about-intro-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: center;
}

.about-skills-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    align-items: start;
}

.about-gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 900px) {

    .about-intro-grid,
    .about-skills-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        padding: 0 15px;
        /* Add padding to prevent touching edges */
    }

    .about-intro-grid>div:last-child {
        width: 180px;
        /* Reduced from 250px */
        margin: 0 auto;
        order: -1;
    }

    .about-skills-grid>div:first-child {
        width: 180px;
        /* Reduced from 200px */
        margin: 0 auto;
    }

    .about-gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }

    /* Mobile Skills Styling */
    .skills-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 0 20px;
    }

    .skill-tag {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }
}


.bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* Left Side Bubbles */
.bubble-1 {
    width: 90px;
    height: 90px;
    left: 4%;
    top: 20%;
    animation-duration: 14s;
}

.bubble-2 {
    width: 70px;
    height: 70px;
    left: 7%;
    top: 50%;
    animation-duration: 18s;
    animation-delay: -4s;
}

.bubble-3 {
    width: 80px;
    height: 80px;
    left: 3%;
    top: 75%;
    animation-duration: 16s;
    animation-delay: -8s;
}

/* Right Side Bubbles */
.bubble-4 {
    width: 85px;
    height: 85px;
    right: 5%;
    left: auto;
    top: 30%;
    animation-duration: 15s;
    animation-delay: -2s;
}

.bubble-5 {
    width: 75px;
    height: 75px;
    right: 4%;
    left: auto;
    top: 65%;
    animation-duration: 20s;
    animation-delay: -6s;
}

@keyframes bubbleFloat {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.7;
    }

    25% {
        transform: translateY(-25px) translateX(15px) scale(1.03);
        opacity: 0.85;
    }

    50% {
        transform: translateY(-10px) translateX(-20px) scale(0.97);
        opacity: 0.6;
    }

    75% {
        transform: translateY(15px) translateX(20px) scale(1.02);
        opacity: 0.8;
    }
}

/* Hide bubbles on smaller screens */
@media (max-width: 1200px) {
    .floating-bubbles {
        display: none;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    width: 100%;
}

/* ==========================================
   Navbar - Dynamic Island Style
   ========================================== */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 44, 46, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 30px;
    border-radius: 50px;
    display: flex;
    gap: 24px;
    z-index: 100;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link.active {
    color: var(--accent-color);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    text-align: center;
    padding: 120px 20px 60px;
}

.profile-pic {
    width: 120px;
    height: 120px;
    background: var(--gradient-orange);
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(255, 159, 10, 0.3);
}

h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #FFF, #86868b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #FFF, #c0c0c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

p {
    line-height: 1.6;
}

p.bio {
    color: var(--text-sec);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* ==========================================
   Page Header
   ========================================== */
.page-header {
    text-align: center;
    padding: 140px 20px 60px;
}

.page-header h1 {
    margin-bottom: 20px;
}

.page-header p {
    color: var(--text-sec);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   Bento Grid Layout
   ========================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding-bottom: 30px;
}

/* ==========================================
   Card Styles
   ========================================== */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 28px;
    padding: 30px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-large {
    grid-column: span 2;
}

.card h3 {
    margin-top: 0;
}

.card p {
    color: var(--text-sec);
    font-size: 15px;
}

/* ==========================================
   Course Specifics
   ========================================== */
.course-tag {
    background: rgba(10, 132, 255, 0.2);
    color: #5AC8FA;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 12px;
}

.course-tag.new {
    background: rgba(255, 69, 58, 0.2);
    color: #FF453A;
}

.course-tag.popular {
    background: rgba(50, 215, 75, 0.2);
    color: #32D74B;
}

.course-tag.free {
    background: rgba(255, 214, 10, 0.2);
    color: #FFD60A;
}

.price {
    font-size: 28px;
    font-weight: 700;
    display: block;
    margin: 20px 0;
}

.price-original {
    font-size: 16px;
    color: var(--text-sec);
    text-decoration: line-through;
    margin-left: 10px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-block;
    padding: 14px 30px;
    background: #FFFFFF;
    color: #000;
    text-align: center;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    transition: 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #e0e0e0;
    transform: scale(0.98);
}

.btn-full {
    width: 100%;
    padding: 14px 0;
}

.btn-accent {
    background: var(--accent-color);
    color: #fff;
}

.btn-accent:hover {
    background: #0077ED;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   About Page
   ========================================== */
.about-content {
    display: grid;
    gap: 40px;
    padding-bottom: 80px;
}

.about-section {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 28px;
    padding: 40px;
    border: 1px solid var(--glass-border);
}

.about-section h3 {
    margin-bottom: 20px;
    color: var(--text-main);
}

.about-section p {
    color: var(--text-sec);
    font-size: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: var(--text-sec);
    margin-top: 5px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skill-tag {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================
   Contact Page
   ========================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding-bottom: 80px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.contact-card:hover {
    transform: translateX(10px);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.contact-details h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.contact-details p {
    color: var(--text-sec);
    font-size: 14px;
}

.contact-form {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 28px;
    padding: 40px;
    border: 1px solid var(--glass-border);
}

.contact-form h3 {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-sec);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ==========================================
   Social Links
   ========================================== */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.3s;
    font-size: 20px;
}

.social-link:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* ==========================================
   Course Grid
   ========================================== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding-bottom: 80px;
}

.course-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.course-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    position: relative;
    overflow: hidden;
}

.course-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--gradient-orange);
    border-radius: 50%;
    opacity: 0.8;
}

.course-content {
    padding: 25px;
}

.course-content h3 {
    margin-bottom: 10px;
}

.course-content p {
    color: var(--text-sec);
    font-size: 14px;
    margin-bottom: 20px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

.course-lessons {
    color: var(--text-sec);
    font-size: 13px;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--glass-border);
    padding: 20px 20px;
    text-align: center;
}

.footer p {
    color: var(--text-sec);
    font-size: 14px;
}

/* ==========================================
   Responsive Fixes
   ========================================== */
@media (max-width: 768px) {
    .card-large {
        grid-column: span 1;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    .navbar {
        width: 80%;
        justify-content: center;
        padding: 10px 20px;
        gap: 16px;
    }

    .nav-link {
        font-size: 13px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        padding: 120px 20px 40px;
    }
}

/* ==========================================
   Custom Scrollbar
   ========================================== */
/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.05);
}

/* Hide scrollbar arrows */
::-webkit-scrollbar-button {
    display: none;
}

/* Teaching Slider - Hide Scrollbar */
.teaching-slider::-webkit-scrollbar {
    display: none;
}

/* ==========================================
   Teaching Slider
   ========================================== */
.teaching-slider {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    padding: 10px 0;
}

.teaching-slider::-webkit-scrollbar {
    display: none;
}

.teaching-slider:active {
    cursor: grabbing;
}

.teaching-item {
    flex: 0 0 calc(50% - 10px) !important;
    width: calc(50% - 10px) !important;
    min-width: 350px !important;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    scroll-snap-align: start;
    transition: transform 0.3s ease;
}

.teaching-item:hover {
    transform: scale(1.02);
}

.teaching-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .teaching-item {
        flex: 0 0 95% !important;
        width: 95% !important;
        min-width: unset !important;
        max-width: calc(100vw - 60px) !important;
    }

    .slider-arrow {
        display: none !important;
    }
}

/* ==========================================
   Slider Container & Arrows
   ========================================== */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.slider-prev {
    left: -25px;
}

.slider-next {
    right: -25px;
}