/* Color Palette & Variables (Orange & Amber Liquid Theme) */
:root {
    --bg-dark: #0b0705;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-orange: #f97316; /* Primary Orange */
    --accent-amber: #f59e0b;  /* Accent Gold/Amber */
    --accent-coral: #ef4444;  /* Deep Orange-Red */
    --glass-bg: rgba(20, 14, 10, 0.45);
    --glass-border: rgba(249, 115, 22, 0.12);
    --glass-highlight: rgba(255, 115, 22, 0.05);
    --font-sans: 'Plus Jakarta Sans', 'Sarabun', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

/* Base Reset & Background Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Liquid Animated Background Elements (Warm Orange Glow) */
.liquid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(90px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    opacity: 0.18;
    animation: drift 25s ease-in-out infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-orange) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-coral) 0%, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 35%;
    left: 30%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, var(--accent-amber) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6%, 10%) scale(1.15); }
}

/* Layout Container Grid */
.nav-container, .hero-section, .simulation-section, .filter-section, .services-container, .footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism Common Style */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 140, 60, 0.2);
}

/* Header Navigation Styling */
.main-header {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(11, 7, 5, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand-group {
    display: flex;
    flex-direction: column;
}

.sys-status {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-orange);
    letter-spacing: 2px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2px;
}

.brand-primary {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, #ffedd5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-divider {
    color: var(--accent-orange);
    font-weight: 300;
}

.brand-secondary {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-secondary);
}

.core-version {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid rgba(249, 115, 22, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(249, 115, 22, 0.05);
}

/* Hero Card - Liquid Glass Concept */
.hero-section {
    padding-top: 3.5rem;
    padding-bottom: 1.5rem;
}

.hero-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 140, 60, 0.15);
    border-radius: 20px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.04) 0%, rgba(239, 68, 68, 0.04) 100%);
    pointer-events: none;
}

.hero-tag {
    font-family: var(--font-mono);
    color: var(--accent-orange);
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.hero-card h1 {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.hero-card p {
    color: var(--text-secondary);
    max-width: 800px;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.hero-meta {
    display: flex;
    gap: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(248, 250, 252, 0.45);
    border-top: 1px solid rgba(249, 115, 22, 0.1);
    padding-top: 1.5rem;
}

/* Simulator Panel Section (Ecosystem Operation Module) */
.simulation-section {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.simulator-wrapper {
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.simulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(249, 115, 22, 0.15);
    padding-bottom: 1rem;
}

.indicator-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-orange);
}

.status-dot.pulsing {
    box-shadow: 0 0 10px var(--accent-orange);
    animation: pulseGlow 1.8s infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.panel-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.sys-id-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 10px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 4px;
}

.simulator-body {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.sim-controls h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.sim-controls p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.sim-btn {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-amber) 100%);
    border: none;
    color: var(--bg-dark);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.15);
}

.sim-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
}

.sim-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.25);
    cursor: not-allowed;
    box-shadow: none;
}

.sim-console {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 180px;
}

.console-title-bar {
    background: rgba(249, 115, 22, 0.08);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(249, 115, 22, 0.15);
}

.console-output {
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #4ade80; /* Terminal Green default logs */
}

.console-line.system-msg {
    color: var(--accent-amber);
}

.console-line.error-msg {
    color: #f87171;
}

/* Filter Tab Navigation */
.filter-section {
    margin-bottom: 2.5rem;
    overflow-x: auto;
}

.filter-wrapper {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    min-width: max-content;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
    border-color: rgba(249, 115, 22, 0.4);
    color: #fff;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.1);
}

/* Dynamic Cards Grid & Dynamic Radial Glow on Move */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 6rem;
}

.service-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 140, 60, 0.1);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 230px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Dynamic Mouse Radial Tracker gradient inside cards */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 120px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(249, 115, 22, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 2;
}

.sys-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(249, 115, 22, 0.15);
}

.category-tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.2px;
    position: relative;
    z-index: 2;
}

.service-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: color 0.2s ease;
}

.explore-btn .arrow {
    transition: transform 0.2s ease;
}

.explore-btn:hover {
    color: #fff;
}

.explore-btn:hover .arrow {
    transform: translate(2px, -2px);
}

/* Loading state styling */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    font-family: var(--font-mono);
    color: var(--accent-orange);
}

/* Glass Interactive Modal Styling */
.glass-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 7, 5, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1.5rem;
}

.glass-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(20, 14, 10, 0.85);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-top: 1px solid rgba(255, 140, 60, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 550px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-modal.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: #fff;
}

.modal-sys-id {
    font-family: var(--font-mono);
    color: var(--accent-orange);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: inline-block;
}

#modalTitle {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.modal-desc-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(249, 115, 22, 0.08);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

#modalDesc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modal-meta-partner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(248, 250, 252, 0.4);
    border-top: 1px solid rgba(249, 115, 22, 0.1);
    padding-top: 1rem;
}

/* Footer Section */
.main-footer {
    border-top: 1px solid var(--glass-border);
    padding: 2.5rem 0;
    background: rgba(11, 7, 5, 0.75);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.design-credit {
    font-size: 0.75rem;
    opacity: 0.65;
}

/* Media Queries for Responsive Design */
@media (max-width: 992px) {
    .simulator-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
        height: auto;
        padding: 1.25rem;
    }

    .hero-card {
        padding: 2rem;
    }

    .hero-card h1 {
        font-size: 1.75rem;
    }

    .services-container {
        grid-template-columns: 1fr;
    }
}