:root {
    --bg-color: #0f1115;
    --card-bg: #1a1d24;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-neon: #00ff9d;
    /* Neon Green */
    --accent-yellow: #ffeb3b;
    --accent-red: #ff3b3b;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    word-break: keep-all;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.search-bar input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--accent-neon);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.tab-btn:hover {
    color: #fff;
    border-color: #fff;
}

.tab-btn.active {
    background: var(--accent-neon);
    color: #000;
    border-color: var(--accent-neon);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
}

/* Grid */
#serviceGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Status Colors Border/Glow */
.service-card[data-status="Live"]:hover {
    border-color: var(--accent-neon);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.service-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    /* fallback */
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.green {
    background-color: var(--accent-neon);
    box-shadow: 0 0 10px var(--accent-neon);
}

.status-dot.yellow {
    background-color: var(--accent-yellow);
    box-shadow: 0 0 10px var(--accent-yellow);
}

.status-dot.red {
    background-color: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
    animation: pulse 1s infinite;
}

.Live .status-text {
    color: var(--accent-neon);
}

.Slow .status-text {
    color: var(--accent-yellow);
}

.Down .status-text {
    color: var(--accent-red);
}

/* Metrics */
.metrics {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric .label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.metric .value {
    color: var(--text-primary);
    font-weight: 600;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: #555;
    font-size: 0.9rem;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
    color: var(--text-primary);
}

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

.uptime-bars {
    display: flex;
    gap: 2px;
    height: 40px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 4px;
    align-items: flex-end;
}

.uptime-bar {
    flex: 1;
    height: 100%;
    background-color: var(--text-secondary);
    /* Default */
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    min-width: 4px;
}

.uptime-bar.live {
    background-color: var(--accent-neon);
}

.uptime-bar.slow {
    background-color: var(--accent-yellow);
}

.uptime-bar.down {
    background-color: var(--accent-red);
}

/* Tooltip */
.uptime-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
    pointer-events: none;
}

/* Detail Page Overhaul */
.detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.breadcrumb {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb .current {
    color: #fff;
    font-weight: 600;
}

/* Glass Panel Utility */
.glass-panel {
    background: rgba(30, 34, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header Section */
.header-panel {
    position: relative;
    padding: 40px;
    display: flex;
    align-items: center;
}

.header-bg-blur {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.15;
    filter: blur(50px);
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.service-logo-xl {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.header-info {
    flex: 1;
}

.service-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-badge {
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.service-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    max-width: 600px;
}

.btn-visit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #000;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.2s;
}

.btn-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Status Card */
.status-card {
    display: flex;
    align-items: center;
    gap: 25px;
}

.status-card.Live {
    border-left: 5px solid var(--accent-neon);
    background: linear-gradient(90deg, rgba(0, 255, 157, 0.05) 0%, rgba(30, 34, 42, 0.6) 100%);
}

.status-card.Down {
    border-left: 5px solid var(--accent-red);
    background: linear-gradient(90deg, rgba(255, 59, 59, 0.05) 0%, rgba(30, 34, 42, 0.6) 100%);
}

.status-indicator-large {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.status-dot-xl {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #555;
    z-index: 2;
}

.Live .status-dot-xl {
    background: var(--accent-neon);
    box-shadow: 0 0 20px var(--accent-neon);
}

.Down .status-dot-xl {
    background: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red);
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.Live .pulse-ring {
    border-color: rgba(0, 255, 157, 0.5);
}

.Down .pulse-ring {
    border-color: rgba(255, 59, 59, 0.5);
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.status-message h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.highlight-green {
    color: var(--accent-neon);
}

.highlight-red {
    color: var(--accent-red);
}

.highlight-yellow {
    color: var(--accent-yellow);
}

.status-message p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-ping {
    margin-left: auto;
    text-align: right;
}

.ping-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.ping-value small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* History */
.item-bars-xl {
    height: 80px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend {
    display: flex;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* FAQ & Related */
.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-question {
    display: block;
    padding: 15px 0;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 0;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

input[type="checkbox"] {
    display: none;
}

input:checked+.faq-question::after {
    content: '-';
}

input:checked~.faq-answer {
    max-height: 200px;
    padding-bottom: 15px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
}

.related-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.related-item img {
    border-radius: 50%;
}

.related-item .related-name {
    flex: 1;
    font-weight: 500;
}

.mini-dot,
.dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
}

.green {
    background: var(--accent-neon);
}

.red {
    background: var(--accent-red);
}

.yellow {
    background: var(--accent-yellow);
}

/* Warn Status (User Reports) */
.status-card.Warn .status-indicator-large .status-dot-xl {
    background: #FF6600;
    box-shadow: 0 0 20px #FF6600, 0 0 40px #FF6600;
}

.status-card.Warn .pulse-ring {
    border: 2px solid #FF6600;
}

.status-card.Warn {
    border-left: 5px solid #FF6600;
    background: linear-gradient(90deg, rgba(255, 102, 0, 0.05) 0%, rgba(30, 34, 42, 0.6) 100%);
}

.Warn .status-dot-xl {
    background: #FF6600;
    box-shadow: 0 0 20px #FF6600;
}

.Warn .pulse-ring {
    border-color: rgba(255, 102, 0, 0.5);
}

/* Report Button */
.status-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-report {
    background: rgba(255, 60, 0, 0.15);
    border: 1px solid rgba(255, 60, 0, 0.4);
    color: #ffcccc;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    width: 100%;
}

.btn-report:hover {
    background: rgba(255, 60, 0, 0.3);
    border-color: #ff5500;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 60, 0, 0.2);
}

.btn-report:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.report-msg {
    margin-top: 8px !important;
    font-size: 0.9rem;
    color: #ffaa00 !important;
    animation: fadeIn 0.5s ease;
    background: rgba(255, 170, 0, 0.1);
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}