/* Custom Styles & Overrides */
body {
    font-family: 'DM Sans', sans-serif;
    color: #000000;
    background-color: #FFFFFF;
    overflow-x: hidden;
}

.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

.bg-terminal {
    background-color: #1A1A1A;
}

/* Logo styling - make it black */
header img[alt="Cybernet Logo"] {
    filter: brightness(0) saturate(100%);
}

/* Nav hover lines */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #FF5F57;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Logo grayscale toggle */
.client-logo img {
    transition: filter 0.3s ease;
    filter: grayscale(100%);
    opacity: 0.6;
}
.client-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Interactive cards */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: #000000;
}

/* Mobile specific hidden class for simplicity */
.mobile-menu-open { display: block !important; }

/* Terminal Console Animations */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.terminal-line {
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
}

.terminal-line.animated {
    animation: typing 2s steps(40, end) forwards;
}

.terminal-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #A3A3A3;
    animation: blink 1s infinite;
    margin-left: 2px;
}

/* Stagger animation for multiple lines */
.terminal-line:nth-child(1) { animation-delay: 0s; }
.terminal-line:nth-child(2) { animation-delay: 2.2s; }
.terminal-line:nth-child(3) { animation-delay: 4.4s; }
.terminal-line:nth-child(4) { animation-delay: 6.6s; }
.terminal-line:nth-child(5) { animation-delay: 8.8s; }
.terminal-line:nth-child(6) { animation-delay: 11s; }

/* Fade in effect for terminal content */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.terminal-content {
    animation: fadeIn 0.5s ease-in forwards;
}

/* Enhanced Dropdown Menu */
.group {
    position: relative;
}

.group > .absolute {
    transition: all 0.2s ease;
}

/* Mobile Dropdown Styling */
#mobileMenu details {
    cursor: pointer;
}

#mobileMenu summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    outline: none;
}

#mobileMenu summary::-webkit-details-marker {
    display: none;
}

#mobileMenu summary:focus {
    outline: none;
}

#mobileMenu details[open] > summary i {
    transform: rotate(180deg);
}

#mobileMenu summary i {
    display: inline-block;
    transition: transform 0.3s ease;
}

#mobileMenu details[open] > div {
    animation: slideDown 0.2s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure dropdown doesn't get cut off */
header {
    overflow: visible !important;
}

/* Mobile Menu Visibility */
#mobileMenu {
    transition: all 0.3s ease;
    display: block;
}

/* Tailwind hidden class override */
#mobileMenu.hidden {
    display: none !important;
    height: 0;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
}

/* Show animation */
@keyframes mobileMenuSlide {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 100vh;
    }
}

#mobileMenu:not(.hidden) {
    animation: mobileMenuSlide 0.3s ease forwards;
}

.sticky {
    overflow: visible !important;
}

/* ===========================
   Server Status Card
   =========================== */
.server-status-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Header row */
.server-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.server-status-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.server-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.server-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
}

/* Stats grid - vertical dividers only */
.server-status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #e5e7eb;
}

.server-status-cell {
    padding: 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #e5e7eb;
}

.server-status-cell:last-child {
    border-right: none;
}

.server-status-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.server-status-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 26px;
    font-weight: 700;
    color: #000000;
    line-height: 1.1;
}

/* Node Location section */
.node-location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.node-live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.node-location-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    gap: 12px;
}

.node-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    min-width: 90px;
}

.node-cpu {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    flex: 1;
}

.node-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
}

.node-check {
    width: 12px;
    height: 12px;
    color: #16a34a;
    flex-shrink: 0;
}

/* Footer row */
.node-all-systems {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #16a34a;
}

/* ===========================
   Stats Section Grid
   =========================== */
.stats-section-wrap {
    background-color: #f3f4f6;
    padding: 28px 24px;
}

.stats-section-grid {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
}

@media (min-width: 768px) {
    .stats-section-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.stats-grid-cell {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

/* Remove right border on last of each row - mobile 3-col */
.stats-grid-cell:nth-child(3n) {
    border-right: none;
}

/* Remove bottom border on last row - mobile */
.stats-grid-cell:nth-child(n+4) {
    border-bottom: none;
}

@media (min-width: 768px) {
    .stats-grid-cell {
        padding: 20px 22px;
        border-bottom: none;
        border-right: 1px solid #e5e7eb;
    }

    /* Reset mobile nth-child overrides */
    .stats-grid-cell:nth-child(3n) {
        border-right: 1px solid #e5e7eb;
    }

    .stats-grid-cell:last-child {
        border-right: none;
    }
}

.stats-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 5px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .stats-value {
        font-size: 22px;
    }
}

.stats-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===========================
   Powered By Marquee Section
   =========================== */
.powered-by-section {
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 28px 0;
    overflow: hidden;
}

.powered-by-label {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: #7f8389;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 20px;
}

.marquee-track {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.marquee-inner {
    display: flex;
    align-items: center;
    width: max-content;
    animation: marquee-scroll 32s linear infinite;
    gap: 0;
}

.marquee-inner:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    height: 28px;
    flex-shrink: 0;
}

.marquee-item:last-child {
    border-right: none;
}

.marquee-item img {
    height: 28px;
    width: auto;
    filter: grayscale(100%) opacity(0.55);
    transition: filter 0.3s ease;
    display: block;
}

.marquee-item img:hover {
    filter: grayscale(0%) opacity(1);
}
