/* ==========================================================================
   Six69.work Portal Hub - Premium Light Glassmorphism Style
   ========================================================================== */

/* Custom CSS Variables for Theme Consistency */
:root {
    /* Colors (60:30:10 Rule) */
    --bg-base-start: #EBF1F9;
    --bg-base-end: #F4F7FC;
    --card-bg: rgba(228, 232, 238, 0.8);
    --card-border: rgba(0, 0, 0, 0.12);
    --card-border-hover: rgba(0, 0, 0, 0.28);
    
    /* Text & Accents (10% Accent / 30% Support) */
    --text-primary: #0F2942;       /* Deep Navy */
    --text-secondary: #5A6E85;     /* Soft slate grey */
    --accent-blue: #0091FF;        /* Bright blue */
    --accent-blue-hover: #0077D6;
    --accent-blue-light: rgba(0, 145, 255, 0.1);
    
    /* Status Colors */
    --status-online: #00C853;      /* Pastel Green */
    --status-offline: #E53935;     /* Rose Red */
    --status-checking: #FFB300;    /* Amber Yellow */
    
    /* Shadow effects */
    --shadow-sm: 0 4px 6px -1px rgba(15, 41, 66, 0.05), 0 2px 4px -1px rgba(15, 41, 66, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(15, 41, 66, 0.07), 0 4px 6px -2px rgba(15, 41, 66, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(15, 41, 66, 0.1), 0 10px 10px -5px rgba(15, 41, 66, 0.04);
    
    /* Font Stack - Sans-serif (ไม่มีหัว) */
    --font-family: 'Plus Jakarta Sans', 'Anuphan', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base-end);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* ==========================================================================
   Animated Background Glow & Grid
   ========================================================================== */
.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, var(--bg-base-end) 0%, var(--bg-base-start) 100%);
}

/* Floating decorative blobs for glassmorphic depth */
.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    mix-blend-mode: multiply;
    animation: floatBlob 25s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background-color: #D2E4FC;
    animation-duration: 20s;
}

.blob-2 {
    bottom: -15%;
    right: -5%;
    width: 600px;
    height: 600px;
    background-color: #E3F2FD;
    animation-duration: 28s;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    width: 400px;
    height: 400px;
    background-color: #E8EAF6;
    animation-duration: 24s;
    animation-delay: -10s;
}

/* Subtle background grid pattern */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(60px, 40px) scale(1.1);
    }
    100% {
        transform: translate(-40px, -60px) scale(0.9);
    }
}

/* ==========================================================================
   Main Container
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.header {
    text-align: center;
    margin-bottom: 3.5rem;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.logo-box {
    background-color: var(--text-primary);
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -1px;
    box-shadow: 0 4px 10px rgba(15, 41, 66, 0.2);
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    position: relative;
}

.header p.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 500px;
    margin: 0.5rem auto 1.25rem;
    line-height: 1.5;
}

/* Global status indicator */
.system-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.pulsing {
    animation: pulseGlow 1.8s infinite ease-in-out;
}

.status-dot.online {
    background-color: var(--status-online);
    box-shadow: 0 0 8px var(--status-online);
}

.status-dot.offline {
    background-color: var(--status-offline);
    box-shadow: 0 0 8px var(--status-offline);
}

.status-dot.warning {
    background-color: var(--status-checking);
    box-shadow: 0 0 8px var(--status-checking);
}

/* ==========================================================================
   Services Grid & Cards
   ========================================================================== */
.grid-services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 4rem;
}

.card-item {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    background: 
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        var(--card-border) border-box;
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: 
        background 0.3s ease,
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        flex 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mouse tracking inner glow pseudo-element */
.card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(
        350px circle at var(--mouse-x, -9999px) var(--mouse-y, -9999px),
        rgba(0, 145, 255, 0.08), /* subtle cyan-blue glow inside the card */
        transparent 65%
    );
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Ensure card content sits above mouse glow */
.card-header-icon, .card-body, .card-footer {
    position: relative;
    z-index: 1;
}

/* Stagger animations for cards */
.card-item:nth-child(1) { animation-delay: 0.1s; }
.card-item:nth-child(2) { animation-delay: 0.2s; }
.card-item:nth-child(3) { animation-delay: 0.3s; }
.card-item:nth-child(4) { animation-delay: 0.4s; }
.card-item:nth-child(5) { animation-delay: 0.5s; }
.card-item:nth-child(6) { animation-delay: 0.6s; }

/* Card Hover States */
.card-item:hover {
    background: 
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        radial-gradient(
            250px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(0, 145, 255, 0.75) 0%,
            rgba(0, 145, 255, 0.25) 50%,
            transparent 100%
        ) border-box;
    box-shadow: 
        0 10px 25px -5px rgba(0, 145, 255, 0.08), 
        0 8px 16px -6px rgba(0, 145, 255, 0.05),
        var(--shadow-lg);
}

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

/* Card Header elements */
.card-header-icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    background-color: var(--bg-base-start);
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.card-item:hover .icon-wrapper {
    transform: scale(1.08) rotate(2deg);
    background-color: var(--text-primary);
    color: #FFFFFF;
}

/* Status Badge inside Card */
.status-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Badge variants mapping to JS states */
.status-badge[data-status="online"] {
    color: var(--status-online);
}
.status-badge[data-status="online"] .badge-dot {
    background-color: var(--status-online);
    box-shadow: 0 0 5px var(--status-online);
    animation: pulseBadgeDot 1.5s infinite ease-in-out;
}

.status-badge[data-status="offline"] {
    color: var(--status-offline);
}
.status-badge[data-status="offline"] .badge-dot {
    background-color: var(--status-offline);
    box-shadow: 0 0 5px var(--status-offline);
}

.status-badge[data-status="checking"] {
    color: var(--status-checking);
}
.status-badge[data-status="checking"] .badge-dot {
    background-color: var(--status-checking);
    animation: pulseBadgeDot 1s infinite alternate;
}

/* Card Content details */
.card-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: font-size 0.3s ease;
}

.card-body p.desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

/* Card Footer elements */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 1rem;
    margin-top: auto;
}

.port-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Button UI */
.btn-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #FFFFFF;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    isolation: isolate;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: -150%;
    left: -50%;
    width: 200%;
    height: 400%;
    background: conic-gradient(
        #00f7ff,
        #7c3aed,
        #ec4899,
        #00f7ff
    );
    animation: rotateBtnBorder 4s linear infinite;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: transform;
}

.btn-action::after {
    content: '';
    position: absolute;
    inset: 1.5px;
    background: var(--text-primary);
    border-radius: inherit;
    z-index: -1;
    transition: background-color 0.3s ease;
}

.arrow-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    position: relative;
    z-index: 1;
}

.btn-action span {
    position: relative;
    z-index: 1;
}

/* Card Hover Button Effect */
.card-item:hover .btn-action {
    box-shadow: 0 4px 12px rgba(0, 145, 255, 0.35);
}

.card-item:hover .btn-action::before {
    opacity: 1;
}

.btn-action:hover::after {
    background: var(--accent-blue-hover);
}

.card-item:hover .btn-action .arrow-icon {
    transform: translateX(3px);
}

@keyframes rotateBtnBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Click styling when card is offline */
.card-item.is-offline {
    background: 
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        rgba(229, 57, 53, 0.25) border-box;
}

.card-item.is-offline::before {
    background: radial-gradient(
        350px circle at var(--mouse-x, -9999px) var(--mouse-y, -9999px),
        rgba(229, 57, 53, 0.08),
        transparent 65%
    );
}

.card-item.is-offline:hover {
    background: 
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        radial-gradient(
            250px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(229, 57, 53, 0.75) 0%,
            rgba(229, 57, 53, 0.25) 50%,
            transparent 100%
        ) border-box;
    box-shadow: 
        0 10px 25px -5px rgba(229, 57, 53, 0.08), 
        0 8px 16px -6px rgba(229, 57, 53, 0.05),
        var(--shadow-lg);
}

.card-item.is-offline .btn-action::after {
    background: var(--status-offline);
}

.card-item.is-offline:hover .btn-action {
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.card-item.is-offline .btn-action:hover::after {
    background: #c62828;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */
.footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 1rem;
    opacity: 0.8;
}

/* ==========================================================================
   Toast Notification Engine
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    pointer-events: none; /* Let clicks pass through if needed, toast inner will enable pointer-events */
}

.toast {
    background: #FFFFFF;
    border: 1px solid var(--card-border-hover);
    border-left: 5px solid var(--status-offline);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-lg), 0 20px 40px -15px rgba(15, 41, 66, 0.2);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.removing {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
}

.toast-icon {
    color: var(--status-offline);
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.toast-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 2px;
    border-radius: 4px;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.toast-close svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ==========================================================================
   Animations Keyframes
   ========================================================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
        box-shadow: 0 0 4px currentColor;
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 12px currentColor;
    }
}

@keyframes pulseBadgeDot {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(50px) translateY(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

/* ==========================================================================
   Media Queries for Responsiveness
   ========================================================================== */

/* Tablets - 2x2 Grid */
@media (max-width: 1024px) {
    .grid-services {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile Devices - 1 column layout */
@media (max-width: 640px) {
    body {
        padding: 1.5rem 0.75rem;
    }
    
    .header {
        margin-bottom: 2.5rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .logo-box {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        font-size: 1.2rem;
    }
    
    .grid-services {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-bottom: 2.5rem;
    }
    
    .card-item {
        min-height: 270px;
        padding: 1.5rem;
    }
    
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: calc(100% - 24px);
        max-width: none;
    }
}

/* Desktop Screens - Single Row Flex Accordion */
@media (min-width: 1025px) {
    .grid-services {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
    }

    .card-item {
        flex: 1;
        min-width: 0;
        min-height: 380px;
    }

    /* Container hover state: shrink all cards slightly */
    .grid-services:hover .card-item {
        flex: 0.75;
    }

    /* Hovered card: expand significantly */
    .grid-services .card-item:hover {
        flex: 2.2;
    }

    /* Accordion transitions for child elements */
    .card-item p.desc {
        transition: opacity 0.3s ease, max-height 0.3s ease, margin-bottom 0.3s ease;
        opacity: 1;
        max-height: 100px;
        overflow: hidden;
    }
    
    .grid-services:hover .card-item p.desc {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
    }
    
    .grid-services .card-item:hover p.desc {
        opacity: 1;
        max-height: 100px;
        margin-bottom: 1.75rem;
    }

    /* Button and text transitions */
    .card-item .btn-action {
        transition: all 0.3s ease;
        padding: 0.5rem 1rem;
    }
    
    .card-item .btn-action span {
        transition: opacity 0.3s ease, width 0.3s ease;
        opacity: 1;
        display: inline-block;
        white-space: nowrap;
    }
    
    .grid-services:hover .card-item .btn-action {
        padding: 0.5rem;
        border-radius: 50%;
    }
    
    .grid-services:hover .card-item .btn-action span {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }
    
    .grid-services .card-item:hover .btn-action {
        padding: 0.5rem 1rem;
        border-radius: 30px;
    }
    
    .grid-services .card-item:hover .btn-action span {
        opacity: 1;
        width: auto;
    }

    /* Status badge transitions */
    .card-item .status-badge {
        transition: all 0.3s ease;
    }

    .card-item .status-badge .badge-text {
        transition: opacity 0.3s ease, width 0.3s ease;
        opacity: 1;
        display: inline-block;
        white-space: nowrap;
    }
    
    .grid-services:hover .card-item .status-badge {
        padding: 0.35rem;
        border-radius: 50%;
    }
    
    .grid-services:hover .card-item .status-badge .badge-text {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }
    
    .grid-services .card-item:hover .status-badge {
        padding: 0.35rem 0.65rem;
        border-radius: 20px;
    }
    
    .grid-services .card-item:hover .status-badge .badge-text {
        opacity: 1;
        width: auto;
    }

    /* Port tag transitions */
    .card-item .port-tag {
        transition: opacity 0.3s ease, width 0.3s ease, padding 0.3s ease;
        opacity: 1;
        display: inline-block;
        white-space: nowrap;
    }
    
    .grid-services:hover .card-item .port-tag {
        opacity: 0;
        width: 0;
        padding: 0;
        overflow: hidden;
    }
    
    .grid-services .card-item:hover .port-tag {
        opacity: 1;
        width: auto;
        padding: 0.25rem 0.5rem;
    }

    /* Title size scale-down slightly when collapsed */
    .grid-services:hover .card-item .card-body h2 {
        font-size: 1.1rem;
    }
    
    .grid-services .card-item:hover .card-body h2 {
        font-size: 1.3rem;
    }

    /* Control group transitions for accordion on desktop */
    .card-item .control-group {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        padding-top: 0;
        border-top-color: transparent;
        pointer-events: none;
    }
    
    .grid-services:hover .card-item .control-group {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        padding-top: 0;
        border-top-color: transparent;
        pointer-events: none;
    }
    
    .grid-services .card-item:hover .control-group {
        opacity: 1;
        max-height: 100px;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px dashed rgba(0, 0, 0, 0.08);
        pointer-events: auto;
    }
}

/* ==========================================================================
   Portal Web Monitor Additions (Admin Mode, Logout, Control Group, Logs)
   ========================================================================== */

.portal-controls {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 0.75rem;
    z-index: 100;
}

.btn-portal-control {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-portal-control:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-logout:hover {
    border-color: var(--status-offline);
    color: var(--status-offline);
    background: rgba(229, 57, 53, 0.05);
}

/* Control actions inside cards */
.control-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 1rem;
    width: 100%;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}

.btn-ctrl {
    flex: 1;
    padding: 0.65rem 0.5rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-ctrl-kill {
    background: rgba(229, 57, 53, 0.1);
    color: #E53935;
    border: 1px solid rgba(229, 57, 53, 0.2);
}

.btn-ctrl-kill:hover {
    background: #E53935;
    color: #FFFFFF;
}

.btn-ctrl-restart {
    background: rgba(0, 145, 255, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 145, 255, 0.2);
}

.btn-ctrl-restart:hover {
    background: var(--accent-blue);
    color: #FFFFFF;
}

/* Logs Terminal Styling */
.logs-section {
    width: 100%;
    background: rgba(15, 41, 66, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 3.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logs-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.logs-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.logs-title-wrapper h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-clear-logs {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-logs:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.logs-terminal {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 12px;
    padding: 1.25rem;
    height: 220px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #e2e8f0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.log-line {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 0.25rem;
    word-break: break-all;
}

.log-line .log-time {
    color: #64748b;
    margin-right: 0.5rem;
    font-weight: bold;
}

.log-line.success {
    color: #4ade80;
}

.log-line.error {
    color: #f87171;
}

.log-line.info {
    color: #38bdf8;
}

@media (max-width: 640px) {
    .portal-controls {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 1.5rem;
        justify-content: center;
        width: 100%;
    }
}

