/* ============================================= */
/*       ULTRA LIQUID GLASS CIVIL - STYLES      */
/*     แหล่งความรู้พื้นฐานวิศวกรรมโยธา          */
/*       Real Glass Effect - Premium Theme      */
/* ============================================= */

/* --------------------------------------------- */
/*              1. CSS VARIABLES                 */
/* --------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Inspired by Liquid Glass */
    --primary: #1d1d1f;
    --secondary: #424245;
    --accent: #00c896;
    --accent-light: #4dd9b4;
    --accent-glow: rgba(0, 200, 150, 0.4);

    /* Mint/Teal Gradient */
    --gradient-mint: linear-gradient(135deg, #00c896 0%, #00d9a5 30%, #4dd9b4 60%, #7ee8cc 100%);
    --gradient-vibrant: linear-gradient(90deg, #00c6ff 0%, #0072ff 50%, #9013fe 100%);

    /* Soft UI Backgrounds */
    --bg-main: #eaeaeb;
    --bg-glass: rgba(255, 255, 255, 0.35);
    --bg-glass-medium: rgba(255, 255, 255, 0.55);
    --bg-glass-heavy: rgba(255, 255, 255, 0.75);

    /* Text */
    --text-main: #1d1d1f;
    --text-muted: #6b7280;

    /* Ultra Glass Effects */
    --blur-light: blur(20px) saturate(180%);
    --blur-medium: blur(40px) saturate(200%);
    --blur-heavy: blur(60px) saturate(220%);

    /* Glass Border */
    --glass-border: 1.5px solid rgba(255, 255, 255, 0.5);
    --glass-border-strong: 2px solid rgba(255, 255, 255, 0.7);

    /* Glass Shadows */
    --glass-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    --glass-shadow-heavy:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 30px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset,
        0 -2px 6px rgba(255, 255, 255, 0.9) inset;

    --radius: 24px;
    --radius-lg: 32px;
    --radius-pill: 100px;
}

/* Dark Mode Variables */
body.dark-mode {
    --primary: #f5f5f7;
    --secondary: #a1a1a6;
    --accent: #00d9a5;
    --accent-glow: rgba(0, 217, 165, 0.4);

    --bg-main: #0a0a0b;
    --bg-glass: rgba(255, 255, 255, 0.08);
    --bg-glass-medium: rgba(255, 255, 255, 0.12);
    --bg-glass-heavy: rgba(255, 255, 255, 0.18);

    --text-main: #f5f5f7;
    --text-muted: #9ca3af;

    --glass-border: 1.5px solid rgba(255, 255, 255, 0.15);
    --glass-border-strong: 2px solid rgba(255, 255, 255, 0.25);

    --glass-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    --glass-shadow-heavy:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 -2px 6px rgba(255, 255, 255, 0.05) inset;
}

/* --------------------------------------------- */
/*              2. BASE STYLES                   */
/* --------------------------------------------- */
body {
    font-family: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    position: relative;
}

/* Background Decorative Elements - Hidden for clean look */
.bg-blobs,
.blob,
.blob-1,
.blob-2,
.blob-3 {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #00c896 0%, #00d9a5 100%);
    top: -150px;
    right: -100px;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #0072ff 0%, #00c6ff 100%);
    bottom: -200px;
    left: -150px;
    animation-delay: -8s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #7ee8cc 0%, #4dd9b4 100%);
    top: 35%;
    left: 5%;
    opacity: 0.3;
    animation-delay: -15s;
}

@keyframes blobFloat {
    from {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    to {
        transform: translate(80px, 120px) scale(1.15) rotate(10deg);
    }
}

/* --------------------------------------------- */
/*              3. HEADER & NAV                  */
/* --------------------------------------------- */
header {
    /* Ultra Liquid Glass Header */
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-bottom: var(--glass-border);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.05),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark-mode header {
    background: linear-gradient(180deg,
            rgba(20, 20, 25, 0.7) 0%,
            rgba(15, 15, 20, 0.5) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo-subtitle {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Navigation Tabs - Liquid Glass Pills */
nav {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.3) 100%);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border-bottom: var(--glass-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 76px;
    z-index: 999;
}

body.dark-mode nav {
    background: linear-gradient(180deg,
            rgba(20, 20, 25, 0.6) 0%,
            rgba(15, 15, 20, 0.4) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-tabs {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    padding: 0.5rem 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
    color: white;
    background: var(--gradient-mint);
    box-shadow:
        0 4px 16px rgba(0, 200, 150, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

body.dark-mode .tab-btn.active {
    color: white;
    background: var(--gradient-mint);
}

/* --------------------------------------------- */
/*              4. MAIN CONTENT                  */
/* --------------------------------------------- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.tab-content {
    display: none;
    animation: pageIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tab-content.active {
    display: block;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------- */
/*         5. SOFT UI / NEUMORPHISM CARDS        */
/* --------------------------------------------- */

/* 🔘 SOFT UI STYLE - Clean Neumorphism */
.content-box {
    /* Solid light background - almost white */
    background: #f0f0f3;

    /* Subtle rounded corners */
    border-radius: 24px;

    /* Thin gray border */
    border: 1px solid rgba(255, 255, 255, 0.8);

    /* Neumorphism shadow - raised effect */
    box-shadow:
        /* Outer shadow - bottom right (dark) */
        8px 8px 20px rgba(174, 174, 192, 0.4),
        /* Outer shadow - top left (light/highlight) */
        -8px -8px 20px rgba(255, 255, 255, 0.9),
        /* Inner subtle highlight */
        inset 1px 1px 0 rgba(255, 255, 255, 0.9);

    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Remove the ::before and ::after pseudo elements */
.content-box::before {
    display: none;
}

.content-box::after {
    display: none;
}

/* Hover Effect - Subtle lift */
.content-box:hover {
    transform: translateY(-2px);
    box-shadow:
        10px 10px 25px rgba(174, 174, 192, 0.45),
        -10px -10px 25px rgba(255, 255, 255, 0.95),
        inset 1px 1px 0 rgba(255, 255, 255, 1);
}

/* Dark Mode - Soft UI */
body.dark-mode .content-box {
    background: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        8px 8px 20px rgba(0, 0, 0, 0.5),
        -8px -8px 20px rgba(50, 50, 60, 0.3),
        inset 1px 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode .content-box:hover {
    box-shadow:
        10px 10px 25px rgba(0, 0, 0, 0.6),
        -10px -10px 25px rgba(50, 50, 60, 0.35),
        inset 1px 1px 0 rgba(255, 255, 255, 0.08);
}

.content-box>* {
    position: relative;
    z-index: 2;
}

.content-box h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-box h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Hero Section */
.hero {
    text-align: left;
    padding: 2rem 0 4rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-muted);
    max-width: 800px;
    font-weight: 400;
}

/* --------------------------------------------- */
/*         6. ULTRA GLASS FORMULA BOX            */
/* --------------------------------------------- */
.formula {
    background: #f0f0f3;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    font-family: inherit;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        6px 6px 16px rgba(174, 174, 192, 0.35),
        -6px -6px 16px rgba(255, 255, 255, 0.85),
        inset 1px 1px 0 rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: 1.5rem 0;
}

.formula::before {
    display: none;
}

body.dark-mode .formula {
    background: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        6px 6px 16px rgba(0, 0, 0, 0.4),
        -6px -6px 16px rgba(50, 50, 60, 0.25),
        inset 1px 1px 0 rgba(255, 255, 255, 0.05);
}

/* --------------------------------------------- */
/*         7. SOFT UI TABLE                      */
/* --------------------------------------------- */
.table-wrapper {
    margin: 1.5rem 0;
    border-radius: 20px;
    overflow: hidden;
    background: #f0f0f3;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        6px 6px 16px rgba(174, 174, 192, 0.35),
        -6px -6px 16px rgba(255, 255, 255, 0.85),
        inset 1px 1px 0 rgba(255, 255, 255, 0.9);
}

.table-wrapper::before {
    display: none;
}

body.dark-mode .table-wrapper {
    background: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        6px 6px 16px rgba(0, 0, 0, 0.4),
        -6px -6px 16px rgba(50, 50, 60, 0.25),
        inset 1px 1px 0 rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 1;
}

th {
    background: rgba(0, 0, 0, 0.04);
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode th {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 1rem;
}

body.dark-mode td {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

body.dark-mode tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* --------------------------------------------- */
/*         8. DARK MODE BUTTON - GLASS           */
/* --------------------------------------------- */
.dark-mode-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border: var(--glass-border);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 2px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dark-mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.8) 0%,
            transparent 100%);
    border-radius: 50% 50% 0 0;
    pointer-events: none;
}

body.dark-mode .dark-mode-btn {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.dark-mode-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 2px 0 rgba(255, 255, 255, 1) inset,
        0 0 0 1px rgba(255, 255, 255, 0.6) inset,
        0 0 30px rgba(0, 200, 150, 0.2);
}

.icon-sun,
.icon-moon {
    position: absolute;
    transition: all 0.3s ease;
}

.icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

body.dark-mode .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

body.dark-mode .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* --------------------------------------------- */
/*         9. UTILITIES - GLASS STYLE            */
/* --------------------------------------------- */
.vibrant-bar {
    height: 40px;
    width: 280px;
    background: var(--gradient-mint);
    border-radius: var(--radius-pill);
    margin: 2rem 0;
    box-shadow:
        0 10px 30px rgba(0, 200, 150, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset,
        0 -2px 8px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    overflow: hidden;
}

.vibrant-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            transparent 100%);
    border-radius: var(--radius-pill) var(--radius-pill) 0 0;
}

/* Circle Plus - Ultra Glass */
.circle-plus {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border: var(--glass-border);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.1),
        0 2px 0 rgba(255, 255, 255, 1) inset,
        0 0 0 1px rgba(255, 255, 255, 0.6) inset,
        0 -8px 20px rgba(255, 255, 255, 0.5) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.circle-plus::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.9) 0%,
            transparent 100%);
    border-radius: 50% 50% 0 0;
    pointer-events: none;
}

.circle-plus:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(255, 255, 255, 1) inset,
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 -8px 20px rgba(255, 255, 255, 0.6) inset,
        0 0 40px rgba(0, 200, 150, 0.15);
}

.circle-plus.dark {
    background: linear-gradient(145deg,
            rgba(30, 30, 35, 0.95) 0%,
            rgba(20, 20, 25, 0.9) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.circle-plus.dark::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 100%);
}

/* Section Header */
.section-header {
    margin-bottom: 3rem;
}

.section-header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Lists */
ul {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Feature Item */
.feature-item {
    padding: 1.5rem;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.1) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 1rem 0;
}

body.dark-mode .feature-item {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================= */
/*              10. ANIMATIONS                   */
/* ============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================= */
/*              11. RESPONSIVE                   */
/* ============================================= */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }

    .section-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .content-box {
        padding: 1.5rem;
        border-radius: var(--radius);
    }

    .content-box::before {
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .content-box::after {
        border-radius: var(--radius);
    }

    .header-content {
        padding: 1rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .section-header h1 {
        font-size: 2rem;
    }

    .table-wrapper {
        border-radius: 16px;
    }

    .formula {
        border-radius: 16px;
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .content-box h2 {
        font-size: 1.4rem;
    }

    .nav-tabs {
        padding: 0.5rem 1rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}