/* ==============================
   CMWORDPRESS Portfolio — Style
   Minimal & Modern Dark Theme
   ============================== */

/* === CSS Reset & Variables === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium Dark Theme Colors */
    --bg-primary: #0b1120;
    --bg-secondary: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #27364f;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --accent-1: #38bdf8; /* Ocean Blue */
    --accent-2: #2dd4bf; /* Teal */
    --accent-3: #0ea5e9; /* Sky Blue */
    --gradient-primary: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --gradient-glow: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(45, 212, 191, 0.08));

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* Spacing */
    --section-padding: 120px 0;
    --container-max: 1200px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease-out;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Shadows & Z-index */
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.2);
    --z-nav: 50;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Force heading colors for plugin sections against theme overrides */
:is(.hero, .services, .portfolio, .why-us, .cta-section, .footer) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--text-primary) !important;
}

a {
    text-decoration: none;
    color: inherit;
    outline: none;
}

a:focus-visible, 
button:focus-visible, 
input:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 4px;
    border-radius: 4px;
}

img {
    max-width: 100%;
    display: block;
}

/* === Section Container === */
.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* === Navigation === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 16px 0;
    transition: var(--transition-smooth);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(11, 17, 32, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.3));
}

.logo-text {
    color: var(--text-primary);
}

.logo-accent {
    color: var(--accent-1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-smooth);
    border-radius: 1px;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--gradient-primary);
    color: #0b1120;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.nav-cta:hover {
    color: #0b1120 !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.2);
}

.cta-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-2);
    border-radius: 50%;
    will-change: opacity, box-shadow;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(45, 212, 191, 0); }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* === Hero Section === */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px 24px 80px;
    background-color: var(--bg-primary);
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 20%, transparent 70%);
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
}

.hero-glow-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-1);
    top: -200px;
    right: -100px;
    opacity: 0.05;
}

.hero-glow-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-3);
    bottom: -150px;
    left: -100px;
    opacity: 0.03;
}

.hero-container {
    max-width: 860px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-2);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-2);
    border-radius: 50%;
    will-change: opacity, box-shadow;
    animation: pulse 2s ease-in-out infinite;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    will-change: background-position;
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 40px;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle strong {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 64px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #0b1120;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    color: #0b1120 !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(56, 189, 248, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 0.95rem;
}

.btn-xl {
    padding: 18px 40px;
    font-size: 1.05rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-plus,
.stat-percent {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-1);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* === Section Common === */
.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.15);
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.section-tag-light {
    color: var(--accent-1);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* === Services Section === */
.services {
    padding: var(--section-padding);
    background: var(--bg-secondary);
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.services-grid > * {
    min-width: 0;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
}

.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.service-icon-ecommerce {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-1);
}

.service-icon-spa {
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent-2);
}

.service-icon-booking {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-3);
}

.service-icon-consult {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.service-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-features li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 20px;
    position: relative;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-weight: 700;
    font-size: 0.75rem;
}

/* === Portfolio Section === */
.portfolio {
    padding: var(--section-padding);
    position: relative;
    background-color: var(--bg-primary);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 48px;
}

.filter-btn {
    padding: 8px 22px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.portfolio-grid > * {
    min-width: 0;
}

.portfolio-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    opacity: 1;
    transform: scale(1);
}

.portfolio-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

.portfolio-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-8px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.portfolio-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--gradient-primary);
    color: #0b1120;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

.portfolio-card:hover .portfolio-link {
    transform: translateY(0);
}

.portfolio-link:hover {
    color: #0b1120 !important;
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.2);
}

.portfolio-info {
    padding: 24px;
}

.portfolio-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 10px;
}

.portfolio-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.portfolio-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === Why Us Section === */
.why-us {
    padding: var(--section-padding);
    background: var(--bg-secondary);
    position: relative;
}

.why-us::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.why-grid > * {
    min-width: 0;
}

.why-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    transition: var(--transition-smooth);
    position: relative;
}

.why-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.why-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-muted);
    opacity: 0.5;
    line-height: 1;
    margin-bottom: 20px;
}

.why-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.why-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === CTA Section === */
.cta-section {
    padding: 140px 0;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-primary);
    background-image: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(59, 130, 246, 0.05));
}

.cta-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--accent-1);
    border-radius: 50%;
    filter: blur(200px);
    opacity: 0.1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cta-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    line-height: 1.3;
}

.cta-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 40px;
}

/* === Footer === */
.footer {
    padding: 60px 0 32px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.footer-content {
    text-align: center;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.footer-services {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-dot {
    color: var(--accent-1);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 80px 0;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(11, 17, 32, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        z-index: 99998;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: flex;
        z-index: 99999;
    }

    .nav-cta {
        display: none;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }

    .stat-divider {
        width: 40px;
        height: 1px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .why-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-filters {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

/* === Selection === */
::selection {
    background: rgba(56, 189, 248, 0.2);
    color: #0b1120;
}
