* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0d1117;
    color: #c9d1d9;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.left-panel,
.right-panel {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Hide scrollbar but keep functionality */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    display: none;
}

.left-panel,
.right-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.left-panel {
    border-right: 1px solid #30363d;
}

.header {
    margin-bottom: 2rem;
    position: sticky;
    top: -2rem;
    background-color: #0d1117;
    z-index: 10;
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin-left: -2rem;
    margin-right: -2rem;
    margin-top: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.overall-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #58a6ff;
    position: relative;
}

.status-indicator.up {
    background-color: #3fb950;
}

.status-indicator.up::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #3fb950;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.5);
    }
}

.status-indicator.down {
    background-color: #f85149;
}

.status-indicator.down::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f85149;
    transform: translate(-50%, -50%);
    animation: pulse-danger 1s ease-out infinite;
}

@keyframes pulse-danger {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.5);
    }
}

.status-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.monitors-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: -2rem;
}

.monitor-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.5rem;
}

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

.monitor-info {
    flex: 1;
}

.monitor-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.monitor-target {
    font-size: 0.85rem;
    color: #8b949e;
}

.monitor-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.up {
    background-color: #1f6feb;
    color: #fff;
}

.status-badge.down {
    background-color: #da3633;
    color: #fff;
}

.status-badge.unknown {
    background-color: #6e7681;
    color: #fff;
}

.monitor-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    color: #8b949e;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-weight: 600;
}

.chart-container {
    height: 150px;
    margin-top: 1rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    justify-content: center;
}

.time-btn {
    padding: 0.375rem 0.75rem;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #8b949e;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.time-btn:hover {
    background-color: #30363d;
    color: #c9d1d9;
}

.time-btn.active {
    background-color: #1f6feb;
    border-color: #1f6feb;
    color: #ffffff;
}

.incidents-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: -0.6rem;
}

.incident-date-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.incident-date-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #c9d1d9;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #30363d;
    margin-bottom: 0.5rem;
}

.incident-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.5rem;
}

.incident-card.ongoing {
    border-left: 3px solid #f85149;
}

.incident-card.resolved {
    border-left: 3px solid #3fb950;
}

.incident-card.scheduled {
    border-left: 3px solid #d29922;
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.incident-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.incident-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.incident-status-badge.ongoing {
    background-color: #da3633;
    color: #fff;
}

.incident-status-badge.resolved {
    background-color: #238636;
    color: #fff;
}

.incident-status-badge.scheduled {
    background-color: #d29922;
    color: #fff;
}

.incident-description {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.incident-time {
    font-size: 0.85rem;
    color: #8b949e;
}

.affected-services {
    margin: 0.75rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.affected-service {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.affected-service.affected {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.affected-service.resolved {
    background-color: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.affected-service.scheduled {
    background-color: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.no-data {
    text-align: center;
    color: #8b949e;
    padding: 2rem;
    font-size: 0.95rem;
}

/* History button */
.history-btn {
    background-color: #1f6feb;
    color: #ffffff;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.history-btn:hover {
    background-color: #388bfd;
}

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

.history-modal.active {
    display: flex;
}

.history-modal-content {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #30363d;
}

.history-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.history-close-btn {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-close-btn:hover {
    color: #c9d1d9;
}

.history-modal-body {
    padding: 1.5rem;
}

/* History list container */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #161b22;
}

.history-list::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border-left: 4px solid;
    background-color: #161b22;
    transition: all 0.2s;
}

.history-item:hover {
    background-color: #1c2128;
}

.history-item.good {
    border-left-color: #238636;
}

.history-item.warning {
    border-left-color: #d29922;
}

.history-item.bad {
    border-left-color: #f85149;
}

.history-item.no-data {
    border-left-color: #30363d;
    opacity: 0.6;
}

.history-date {
    font-weight: 500;
    color: #c9d1d9;
    min-width: 100px;
}

.history-percent {
    font-weight: 600;
    color: #c9d1d9;
    min-width: 70px;
    margin-left: auto;
    margin-right: 17.2rem; /* 중앙 정렬 */
    text-align: right;
}

.history-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.history-item.good .history-status {
    background-color: rgba(35, 134, 54, 0.15);
    color: #3fb950;
}

.history-item.warning .history-status {
    background-color: rgba(210, 153, 34, 0.15);
    color: #d29922;
}

.history-item.bad .history-status {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

.history-item.no-data .history-status {
    background-color: rgba(48, 54, 61, 0.15);
    color: #8b949e;
}

/* Legend */
.history-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.legend-good {
    background-color: #238636;
}

.legend-warning {
    background-color: #d29922;
}

.legend-bad {
    background-color: #f85149;
}

.legend-no-data {
    background-color: #30363d;
}

/* Subscribe button */
.right-panel .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-incidents-btn {
    display: none;
    padding: 0.5rem;
    background-color: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.toggle-incidents-btn:hover {
    background-color: #30363d;
}

.toggle-icon {
    display: block;
    transition: transform 0.3s ease;
}

.toggle-incidents-btn.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.subscribe-btn {
    padding: 0.5rem 1rem;
    background-color: #238636;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.subscribe-btn:hover {
    background-color: #2ea043;
}

.mobile-incidents-btn {
    display: none;
    padding: 0.5rem 1rem;
    background-color: #1f6feb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.mobile-incidents-btn:hover {
    background-color: #388bfd;
}

.incidents-section {
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .left-panel,
    .right-panel {
        padding: 1rem;
    }

    .header {
        position: sticky;
        top: -1rem;
        margin-bottom: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        margin-top: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        background-color: #0d1117;
        z-index: 10;
    }

    .monitors-section {
        margin-top: 0;
    }

    .incidents-section {
        display: block;
        transition: none;
    }

    .incidents-section.collapsed {
        display: none !important;
    }

    h1 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .overall-status {
        padding: 0.75rem;
    }

    .status-text {
        font-size: 0.85rem;
    }

    .monitors-section {
        gap: 1rem;
    }

    .monitor-card {
        padding: 1rem;
    }

    .monitor-header {
        margin-bottom: 0.75rem;
    }

    .monitor-name {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .monitor-target {
        font-size: 0.75rem;
    }

    .monitor-metrics {
        gap: 1rem;
        margin-bottom: 0.75rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .metric-value {
        font-size: 0.9rem;
    }

    .chart-controls {
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }

    .time-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    .chart-container {
        height: 120px;
    }

    .history-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    .status-badge {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }

    .subscribe-btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.8rem;
    }

    .incidents-section {
        gap: 1rem;
    }

    .incident-date {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .incident-card {
        padding: 1rem;
    }

    .incident-header {
        margin-bottom: 0.75rem;
    }

    .incident-title {
        font-size: 0.95rem;
    }

    .incident-body {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .incident-meta {
        font-size: 0.7rem;
        margin-top: 0.75rem;
    }

    .affected-services {
        gap: 0.35rem;
        margin-top: 0.5rem;
    }

    .service-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }

    .left-panel {
        border-right: none;
        border-bottom: 1px solid #30363d;
    }

    .history-list {
        max-height: 400px;
    }

    .history-item {
        padding: 0.6rem 0.8rem;
    }

    .history-date {
        font-size: 0.85rem;
    }

    .history-percent {
        font-size: 0.85rem;
    }

    .history-status {
        font-size: 0.8rem;
    }

    .no-data {
        font-size: 0.85rem;
        padding: 2rem 1rem;
    }

    .toggle-incidents-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .right-panel {
        display: none;
    }

    .left-panel {
        border-right: none;
        border-bottom: none;
    }

    .mobile-incidents-btn {
        display: block;
    }

    .container {
        min-height: 100vh;
        height: auto;
    }

    .left-panel {
        height: auto;
        overflow-y: visible;
    }

    .history-list {
        max-height: 350px;
    }

    .history-item {
        padding: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .history-date {
        font-size: 0.8rem;
    }

    .history-percent {
        font-size: 0.8rem;
    }

    .history-status {
        font-size: 0.75rem;
    }
}
