/* =============================================
   Oh My Code — Custom Styles
   Primary: #22c55e  |  Dark: #0d0d0d
   ============================================= */

:root {
    --omc-primary:      #22c55e;
    --omc-primary-2:    #4ade80;
    --omc-primary-dark: #166534;
    --omc-dark:         #0F0F0F;
    --omc-bg:           #0d0d0d;
    --omc-bg2:          #131313;
    --omc-card:         rgba(255,255,255,0.04);
    --omc-border:       rgba(255,255,255,0.07);
    --omc-gradient:     linear-gradient(135deg, #166534, #22c55e);
    --omc-gradient-r:   linear-gradient(135deg, #22c55e, #4ade80);
    --omc-pattern:      linear-gradient(rgba(34,197,94,0.045) 1px, transparent 1px),
                        linear-gradient(to right, rgba(34,197,94,0.045) 1px, transparent 1px);
    --omc-pattern-size: 60px 60px;
    --omc-radius:       12px;
    --omc-transition:   0.3s ease;
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }

body {
    background-color: var(--omc-bg);
    background-image: var(--omc-pattern);
    background-size: var(--omc-pattern-size);
    color: #e8e8e8;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    line-height: 1.7;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5 { font-weight: 700; color: #ffffff; }
.text-gradient {
    background: var(--omc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.section-subtitle {
    color: #aaa;
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 2.5rem;
}

/* ---- Navbar ---- */
.omc-navbar {
    background: rgba(15, 15, 15, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--omc-border);
    transition: background var(--omc-transition);
}
.omc-navbar .navbar-brand { font-weight: 600; font-size: 1.4rem; }
.omc-navbar .nav-link {
    color: #ccc !important;
    font-weight: 500;
    padding: 0.5rem 0.8rem !important;
    transition: color var(--omc-transition);
    position: relative;
}
.omc-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px;
    background: var(--omc-gradient);
    transition: left var(--omc-transition), right var(--omc-transition);
    border-radius: 2px;
}
.omc-navbar .nav-link:hover,
.omc-navbar .nav-link.active { color: var(--omc-primary) !important; }
.omc-navbar .nav-link:hover::after,
.omc-navbar .nav-link.active::after { left: 0.8rem; right: 0.8rem; }

/* Language Toggle */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: 30px;
    padding: 3px 4px;
}
.lang-toggle a {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    color: #aaa;
    text-decoration: none;
    transition: all var(--omc-transition);
}
.lang-toggle a.active {
    background: var(--omc-gradient);
    color: #fff;
}

/* ---- Buttons ---- */
.btn-omc {
    background: var(--omc-gradient);
    color: #fff !important;
    font-weight: 700;
    border: none;
    border-radius: var(--omc-radius);
    padding: 0.65rem 1.8rem;
    transition: all var(--omc-transition);
    box-shadow: 0 4px 20px rgba(34,197,94,0.25);
}
.btn-omc:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(34,197,94,0.40);
}
.btn-omc-outline {
    background: transparent;
    color: var(--omc-primary) !important;
    border: 2px solid var(--omc-primary);
    border-radius: var(--omc-radius);
    padding: 0.65rem 1.8rem;
    font-weight: 700;
    transition: all var(--omc-transition);
}
.btn-omc-outline:hover {
    background: var(--omc-gradient);
    color: #000 !important;
    border-color: transparent;
    transform: translateY(-2px);
}

/* ---- Hero ---- */
.hero-section {
    min-height: 100vh;
    background-color: var(--omc-bg);
    background-image:
        radial-gradient(ellipse at 65% 45%, rgba(34,197,94,0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 10% 80%, rgba(74,222,128,0.06) 0%, transparent 50%),
        var(--omc-pattern);
    background-size: auto, auto, var(--omc-pattern-size);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34,197,94,0.07) 0%, transparent 70%);
    right: -150px; top: -150px;
    pointer-events: none;
}
.hero-badge {
    display: inline-block;
    background: rgba(0,200,151,0.12);
    border: 1px solid rgba(0,200,151,0.3);
    color: var(--omc-primary);
    border-radius: 30px;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}
.hero-headline {
    font-size: clamp(2rem, 5.5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.2rem;
}
.hero-sub {
    color: #bbb;
    font-size: 1.15rem;
    margin-bottom: 2rem;
    max-width: 540px;
}

/* ---- Sections ---- */
.section-dark {
    background-color: var(--omc-bg);
    background-image: var(--omc-pattern);
    background-size: var(--omc-pattern-size);
}
.section-dark2 {
    background-color: var(--omc-bg2);
    background-image: var(--omc-pattern);
    background-size: var(--omc-pattern-size);
}
.section-white {
    background: #ffffff;
    color: #1a1a1a;
}
.section-white h1, .section-white h2,
.section-white h3, .section-white h4 { color: #0f0f0f; }
.section-white .section-subtitle { color: #555; }

/* ---- Cards ---- */
.omc-card {
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: var(--omc-radius);
    padding: 1.75rem;
    transition: all var(--omc-transition);
    height: 100%;
}
.omc-card:hover {
    border-color: rgba(34,197,94,0.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(34,197,94,0.10);
}
.omc-card .card-icon {
    width: 52px; height: 52px;
    background: rgba(34,197,94,0.10);
    border: 1px solid rgba(34,197,94,0.18);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: var(--omc-primary);
}
.omc-card h5 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.omc-card p  { color: #aaa; font-size: 0.93rem; margin: 0; }

/* Why points */
.why-point {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 1rem;
}
.why-point .check {
    width: 24px; height: 24px;
    background: var(--omc-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #000;
    margin-top: 2px;
}
.why-point span { color: #ddd; font-size: 0.97rem; }

/* ---- Tech Stack ---- */
.tech-card {
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: var(--omc-radius);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--omc-transition);
    cursor: default;
}
.tech-card:hover {
    border-color: var(--omc-primary);
    background: rgba(34,197,94,0.07);
    transform: translateY(-4px);
}
.tech-card .tech-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--omc-primary);
    display: block;
}
.tech-card span { font-size: 0.85rem; font-weight: 600; color: #ccc; display: block; }

/* ---- Portfolio ---- */
.portfolio-item {
    position: relative;
    border-radius: var(--omc-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--omc-bg2);
    border: 1px solid var(--omc-border);
}
.portfolio-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--omc-transition);
    display: flex; flex-direction: column;
    justify-content: flex-end; padding: 1.25rem;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay h6 { color: #fff; font-size: 0.95rem; margin: 0; }
.portfolio-overlay small { color: var(--omc-primary); }

/* Filter buttons */
.filter-btn {
    background: transparent;
    color: #aaa;
    border: 1px solid var(--omc-border);
    border-radius: 30px;
    padding: 5px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--omc-transition);
    cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--omc-gradient);
    color: #000;
    border-color: transparent;
}

/* ---- Blog ---- */
.blog-card {
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: var(--omc-radius);
    overflow: hidden;
    transition: all var(--omc-transition);
    height: 100%;
}
.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34,197,94,0.3);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.blog-card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--omc-bg2); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body { padding: 1.4rem; }
.blog-card-body .category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--omc-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}
.blog-card-body h5 { font-size: 1rem; color: #fff; margin-bottom: 0.5rem; line-height: 1.4; }
.blog-card-body p  { color: #999; font-size: 0.88rem; margin-bottom: 1rem; }
.blog-card-body .meta { color: #666; font-size: 0.8rem; }

/* ---- Contact ---- */
.contact-form .form-control,
.contact-form .form-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--omc-border);
    border-radius: 10px;
    color: #e8e8e8;
    padding: 0.75rem 1rem;
    transition: border-color var(--omc-transition);
}
.contact-form .form-control:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--omc-primary);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
    color: #e8e8e8;
}
.contact-form label { color: #ccc; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.4rem; }
.contact-info-item { display:flex; gap:14px; align-items:flex-start; margin-bottom:1.4rem; }
.contact-info-icon {
    width:44px; height:44px;
    background: rgba(34,197,94,0.10);
    border: 1px solid rgba(34,197,94,0.18);
    border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    color: var(--omc-primary);
    font-size: 1.1rem;
    flex-shrink:0;
}
.contact-info-item h6 { margin:0; font-size:0.9rem; color:#aaa; }
.contact-info-item p  { margin:0; font-size:0.95rem; color:#fff; }

/* ---- Process Steps ---- */
.process-steps {
    display: flex;
    gap: 0;
    position: relative;
    overflow: visible;
}
.process-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    position: relative;
    padding: 1rem 0.5rem 1rem;
}
/* Connector line: from center of this step to center of next */
.process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;        /* 1rem padding-top + half of 48px circle */
    left: 50%;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--omc-primary), var(--omc-primary-2));
    z-index: 0;
}
.process-step-num {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--omc-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
}
.process-step .step-icon {
    font-size: 1.4rem;
    color: var(--omc-primary);
    margin-bottom: 0.4rem;
    display: block;
}
.process-step h6 { font-size: 0.82rem; color: var(--omc-primary); margin-bottom: 0.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.process-step p  { font-size: 0.78rem; color: #888; margin: 0; }
@media (max-width: 767px) {
    .process-steps { flex-direction: column; align-items: center; gap: 1rem; }
    .process-step:not(:last-child)::after {
        top: auto; left: 50%; bottom: -1rem;
        width: 2px; height: 1rem;
        background: linear-gradient(to bottom, var(--omc-primary), var(--omc-primary-2));
    }
}

/* ---- Stats ---- */
.stat-item { text-align:center; }
.stat-num {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    background: var(--omc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height:1;
}
.stat-label { color:#aaa; font-size:0.88rem; margin-top:0.25rem; }

/* ---- Floating Buttons ---- */
.floating-btns {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 1000;
    display: flex; flex-direction: column; gap: 10px;
    align-items: flex-end;
}
.float-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
    transition: all var(--omc-transition);
}
.float-btn:hover { transform: scale(1.1); color:#fff; }
.float-btn-fb  { background: #0084FF; }
.float-btn-line{ background: #00B900; }
.float-btn-call{ background: var(--omc-gradient); }

/* ---- Footer ---- */
.omc-footer {
    background-color: #080808;
    background-image: var(--omc-pattern);
    background-size: var(--omc-pattern-size);
    border-top: 1px solid rgba(34,197,94,0.12);
    padding: 4rem 0 2rem;
    color: #aaa;
}
.omc-footer h6 { color: #e0e0e0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin-bottom: 1rem; }
.omc-footer p   { color: #aaa; }
.omc-footer .text-muted { color: #999 !important; }
.omc-footer a   { color: #bbb; text-decoration: none; font-size: 0.88rem; display: block; margin-bottom: 0.45rem; transition: color var(--omc-transition); }
.omc-footer a:hover { color: var(--omc-primary); }
.omc-footer .tagline { color: #bbb !important; font-size: 0.92rem; line-height: 1.7; }
.omc-footer .social-link {
    display:inline-flex; align-items:center; justify-content:center;
    width:36px; height:36px;
    border-radius:8px;
    background:rgba(255,255,255,0.06);
    color:#ccc;
    font-size:0.95rem;
    transition:all var(--omc-transition);
    text-decoration:none;
}
.omc-footer .social-link:hover { background:var(--omc-primary); color:#000; }

/* ---- Scroll-reveal ---- */
.reveal { opacity:0; transform:translateY(30px); transition:opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity:1; transform:none; }

/* ---- Admin ---- */
.admin-sidebar {
    width: 260px;
    background: #0a0a0a;
    border-right: 1px solid var(--omc-border);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    overflow-y: auto;
    z-index: 200;
}
.admin-sidebar .brand {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--omc-border);
}
.admin-sidebar .nav-link {
    color: #aaa !important;
    padding: 0.6rem 1.5rem !important;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--omc-transition);
    border-left: 3px solid transparent;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: var(--omc-primary) !important;
    background: rgba(34,197,94,0.08);
    border-left-color: var(--omc-primary);
}
.admin-main {
    margin-left: 260px;
    min-height: 100vh;
    background: #111;
}
.admin-topbar {
    background: rgba(10,10,10,0.9);
    border-bottom: 1px solid var(--omc-border);
    padding: 0.75rem 1.5rem;
    position: sticky; top:0; z-index:100;
}
.admin-content { padding: 2rem 1.5rem; }
.admin-card {
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: var(--omc-radius);
    padding: 1.5rem;
}
.stat-box {
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: var(--omc-radius);
    padding: 1.5rem;
    text-align: center;
}
.stat-box h2 { font-size: 2.5rem; font-weight:900; color:var(--omc-primary); margin:0; }
.stat-box p  { color:#aaa; margin:0.25rem 0 0; font-size:0.88rem; }

/* Table */
.omc-table { color:#ddd; }
.omc-table thead th { background:#0d0d0d; color:#aaa; border-color:var(--omc-border); font-size:0.82rem; text-transform:uppercase; letter-spacing:0.05em; }
.omc-table td, .omc-table th { border-color:var(--omc-border); vertical-align:middle; }
.omc-table tbody tr:hover { background:rgba(255,255,255,0.03); }

/* Badge */
.badge-published { background:rgba(34,197,94,0.12); color:var(--omc-primary); border:1px solid rgba(34,197,94,0.25); }
.badge-draft     { background:rgba(255,255,255,0.08); color:#aaa; border:1px solid var(--omc-border); }

/* Responsive admin */
@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
}

/* ---- Map Container ---- */
.map-container {
    border-radius: var(--omc-radius);
    overflow: hidden;
    height: 260px;
    position: relative;
    border: 1px solid var(--omc-border);
}
.map-container iframe {
    width: 100%; height: 100%;
    display: block; border: 0;
}

/* ---- Utilities ---- */
.divider-gradient {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34,197,94,0.5), transparent);
    border: none;
}
.glow-text { text-shadow: 0 0 30px rgba(34,197,94,0.35); }

/* Dark mode overrides for .section-white */
@media (prefers-color-scheme: dark) {
    .section-white { background: #f5f5f5; }
}

/* ---- Legal Pages ---- */
.legal-body h4 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    border-left: 3px solid var(--omc-primary);
    padding-left: 0.75rem;
}
.legal-body p,
.legal-body ul { color: #bbb; line-height: 1.85; }
.legal-body ul  { padding-left: 1.4rem; }
.legal-body li  { margin-bottom: 0.35rem; }
.legal-body a   { color: var(--omc-primary); }
.legal-body a:hover { color: var(--omc-primary-2); }
.legal-body code {
    background: rgba(34,197,94,0.1);
    color: var(--omc-primary-2);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}
.legal-contact-box {
    background: var(--omc-card);
    border: 1px solid var(--omc-border);
    border-radius: var(--omc-radius);
    padding: 1.25rem 1.5rem;
    color: #bbb;
    line-height: 2;
    margin-top: 0.5rem;
}
.legal-contact-box a { color: var(--omc-primary); }

/* ---- Cookie Banner ---- */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: #0d0d0d;
    border-top: 1px solid rgba(34,197,94,0.25);
    padding: 1rem 1.25rem;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    animation: cookieSlideUp 0.35s ease;
}
.cookie-banner--hidden {
    animation: cookieSlideDown 0.35s ease forwards;
}
@keyframes cookieSlideUp   { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes cookieSlideDown { from { transform: translateY(0); }   to { transform: translateY(110%); } }

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-text {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 260px;
}
.cookie-icon { font-size: 1.5rem; color: var(--omc-primary); flex-shrink: 0; margin-top: 0.1rem; }
.cookie-text strong { display: block; color: #e0e0e0; margin-bottom: 0.2rem; font-size: 0.95rem; }
.cookie-text span   { color: #999; font-size: 0.85rem; line-height: 1.5; }
.cookie-text a      { color: var(--omc-primary); }
.cookie-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.btn-cookie-decline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #aaa;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--omc-transition);
}
.btn-cookie-decline:hover { border-color: #fff; color: #fff; }
.btn-cookie-accept {
    background: var(--omc-primary);
    border: none;
    color: #000;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--omc-transition);
}
.btn-cookie-accept:hover { background: var(--omc-primary-2); }
@media (max-width: 576px) {
    .cookie-banner-inner { gap: 1rem; }
    .cookie-actions { width: 100%; justify-content: flex-end; }
}
