/* Deep Space Weather Model Demo - Clean Gray Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Kanit Font Classes */
.kanit-thin { font-family: "Kanit", sans-serif; font-weight: 100; font-style: normal; }
.kanit-extralight { font-family: "Kanit", sans-serif; font-weight: 200; font-style: normal; }
.kanit-light { font-family: "Kanit", sans-serif; font-weight: 300; font-style: normal; }
.kanit-regular { font-family: "Kanit", sans-serif; font-weight: 400; font-style: normal; }
.kanit-medium { font-family: "Kanit", sans-serif; font-weight: 500; font-style: normal; }
.kanit-semibold { font-family: "Kanit", sans-serif; font-weight: 600; font-style: normal; }
.kanit-bold { font-family: "Kanit", sans-serif; font-weight: 700; font-style: normal; }
.kanit-extrabold { font-family: "Kanit", sans-serif; font-weight: 800; font-style: normal; }
.kanit-black { font-family: "Kanit", sans-serif; font-weight: 900; font-style: normal; }

body {
    font-family: "Kanit", sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 1rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Header */
.header {
    text-align: center;
    background: #fff;
    padding: 0.5rem 0.5rem 0.05rem 2rem;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.title-section {
    flex: 1;
}

/* Title with Logo */
.title-with-logo {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.2rem;
    margin-bottom: 0;
}

.logo {
    height: 65px;
    width: auto;
    object-fit: contain;
    margin-top: 0rem; /* タイトルと同じ高さに調整 */
}

.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Authors Section */
.authors {
    margin: 0;
}

.author-names {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    margin: 0;
    margin-top: -1.2rem;
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-align: center;
}

/* University name styling - smaller font size */
.university-name {
    font-size: 0.85rem;
    color: #888;
    font-weight: 400;
    display: block;
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
}

/* サブタイトルとボタンを著者名の位置に揃える */
.subtitle {
    transform: translateX(-38px);
}

.publication-links {
    transform: translateX(-38px);
}

/* Controls Section */
.controls-section {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Kanit", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.lang-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.theme-toggle {
    display: flex;
}

.theme-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Kanit", sans-serif;
}

.theme-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.theme-icon {
    font-size: 1rem;
}

.theme-text {
    font-size: 0.875rem;
}

/* Title and Subtitle */
.title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #333;
    line-height: 1.1;
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    margin-top: 0.1rem;
    color: #666;
    line-height: 0.9;
}

/* Publication Links */
.publication-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: -1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.link-block {
    display: inline-block;
}

.external-link {
    text-decoration: none;
    border: 1px solid #363636;
    background-color: #363636;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: "Kanit", sans-serif;
}

.external-link:hover {
    background-color: #4a4a4a;
    border-color: #4a4a4a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.external-link .icon {
    font-size: 1rem;
}

.external-link span:not(.icon) {
    font-size: 0.875rem;
}

.title {
    font-size: 2.25rem;
    font-weight: 900;
    color: #212529;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 300;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 0.75rem;
    flex: 1;
    min-height: 500px;
}

@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 2fr 1fr;
        gap: 0.5rem;
    }
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 0;
}

/* iPad Pro専用設定 (1024×1366) */
@media (min-width: 1024px) and (max-width: 1366px) {
    /* 304太陽画像を大きく */
    .solar-surface-panel .aia-304-container {
        max-width: 380px;
        max-height: 380px;
    }
    
    .solar-surface-panel .aia-304-canvas {
        max-width: 380px;
        max-height: 380px;
    }
    
    /* パネルタイトルのフォントサイズ */
    .panel-title {
        font-size: 1.5rem !important;
    }
    
    /* 長いタイトル用の特別調整 */
    .forecast-panel .panel-title {
        font-size: 1.3rem !important;
        line-height: 1.1;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    /* バー内のフォントサイズ */
    .status-level-blocks .level-block,
    .forecast-level-blocks .level-block {
        height: 65px;
        min-height: 65px;
        max-height: 65px;
        padding: 1rem 1.2rem;
        font-size: 1.3rem;
        flex: none;
        flex-shrink: 0;
    }
    
    .level-block span {
        font-size: 1.3rem !important;
    }
    
    .level-block span:first-child {
        font-size: 1.3rem !important;
    }
    
    .level-block span:last-child {
        font-size: 1.3rem !important;
    }
    
    /* パネルステータス表示のフォントサイズ */
    .panel-status .status-text {
        font-size: 1.5rem !important;
    }
    
    .panel-status .level-text {
        font-size: 1.2rem !important;
    }
    
    /* セクションタイトルのフォントサイズ */
    .section-main-title {
        font-size: 2rem !important;
    }
    
    /* パネルサブタイトルのフォントサイズ */
    .panel-subtitle {
        font-size: 1.3rem !important;
    }
    
    /* 時間表示のフォントサイズ */
    .time-label,
    .time-value {
        font-size: 1.2rem !important;
    }
    
    /* メインタイトルとサブタイトル */
    .title {
        font-size: 2.5rem !important;
    }
    
    .subtitle {
        font-size: 1.4rem !important;
    }
    
    .author-names {
        font-size: 1.2rem !important;
    }
    
    /* パネル高さの調整 */
    .panel {
        height: auto;
        min-height: 420px;
        padding: 1rem;
    }
    
    /* 現在の状況と予報コンテンツの高さ */
    .current-forecast-content {
        min-height: 450px;
        height: auto;
    }
    
    /* 現在状況パネルと予報パネルの高さ */
    .current-status-panel,
    .forecast-panel {
        min-height: 390px;
        height: auto;
    }
    
    /* level-block の高さ調整 */
    .status-level-blocks,
    .forecast-level-blocks {
        flex: 1;
        max-height: none;
        overflow: visible;
        padding: 1rem 0.8rem;
        gap: 0.6rem;
        justify-content: space-around;
    }
}

@media (max-width: 1200px) {
    .left-panel {
        gap: 0.2rem;
    }
}

@media (max-width: 900px) {
    .left-panel {
        gap: 0.15rem;
    }
}

@media (max-width: 768px) {
    .left-panel {
        gap: 0.1rem;
    }
}

@media (max-width: 480px) {
    .left-panel {
        gap: 0.08rem;
    }
}

/* Prediction Section (Top 30% of left panel) */
.prediction-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 0.25rem;
    height: 32%;
    min-height: 180px;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .prediction-section {
        height: auto;
        min-height: 140px;
    }
}

@media (max-width: 900px) {
    .prediction-section {
        min-height: 120px;
    }
}

@media (max-width: 768px) {
    .prediction-section {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .prediction-section {
        min-height: 90px;
    }
}

/* Section Headers */
.section-headers {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 0;
}

/* Section Headers for Two Columns */
.section-headers-two {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 0;
}

.section-header {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.2;
}

.prediction-result {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    grid-column: 1;
    grid-row: 2;
    height: 100%;
}

.flare-class {
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 0.05rem;
}

.flare-description {
    font-size: 0.875rem;
    margin-bottom: 0.05rem;
    color: #495057;
    font-weight: 500;
}

.confidence {
    font-size: 1rem;
    font-weight: 600;
}

.actual-class {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.1rem;
    padding: 0.15rem 0.3rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 2px solid transparent;
}

.actual-class.correct {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #155724;
}

.actual-class.incorrect {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #721c24;
}

.actual-value {
    font-weight: 700;
}

.prediction-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    height: 100%;
}

.detail-item {
    background: #f8f9fa;
    padding: 0.25rem;
    border: 1px solid #e9ecef;
    font-size: 0.875rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-weight: 600;
}

.detail-item.active {
    font-weight: 700;
}

/* Probabilities Section */
.probabilities-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    height: 100%;
    grid-column: 2;
    grid-row: 2;
    min-height: 120px;
}

.prob-item {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 0.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prob-value {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.05rem;
}

.prob-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
}

/* Class-specific colors for probabilities */
.prob-item.x-class {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.prob-item.m-class {
    border-color: #ffa726;
    background: rgba(255, 167, 38, 0.1);
}

.prob-item.c-class {
    border-color: #81c784;
    background: rgba(129, 199, 132, 0.1);
}

.prob-item.o-class {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.prob-item.predicted {
    background: var(--class-color);
    color: #fff;
}

.prob-item.predicted .prob-value,
.prob-item.predicted .prob-label {
    color: #fff;
}

/* Performance Sections - Unified Design */
.performance-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
    min-height: 120px;
}

.performance-section:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.performance-section:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.performance-display {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Binary Classification Section (legacy - keeping for compatibility) */
.binary-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    grid-column: 3;
    grid-row: 2;
    height: 100%;
    min-height: 120px;
}

.binary-item {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 0.6rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.binary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.3rem;
}

.binary-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.binary-period {
    font-size: 0.8rem;
    color: #868e96;
    font-weight: 500;
    margin-top: 0.1rem;
    font-style: italic;
}

/* Solar Section (Bottom 70% of left panel) */
.solar-section {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 0.1rem 0.2rem 0.5rem 0.2rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .solar-section {
        padding: 0.08rem 0.15rem 0.4rem 0.15rem;
    }
}

@media (max-width: 900px) {
    .solar-section {
        padding: 0.06rem 0.12rem 0.3rem 0.12rem;
    }
}

@media (max-width: 768px) {
    .solar-section {
        padding: 0.05rem 0.1rem 0.25rem 0.1rem;
    }
}

@media (max-width: 480px) {
    .solar-section {
        padding: 0.04rem 0.08rem 0.2rem 0.08rem;
    }
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.1rem;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1200px) {
    .section-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 900px) {
    .section-title {
        font-size: 0.85rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 0.8rem;
        line-height: 1.1;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 0.75rem;
        line-height: 1.0;
        margin-bottom: 0.08rem;
    }
}

.solar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.15rem;
    flex: 1;
    min-height: 250px;
    align-items: stretch;
    align-content: stretch;
    margin-bottom: 0;
    padding-bottom: 0;
    height: 100%;
}

.channel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 80px;
    height: 100%;
    justify-content: flex-start;
    position: relative;
    padding: 0 0.1rem 0 0;
}

.channel canvas,
.channel img {
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    object-fit: contain;
    border: 1px solid #dee2e6;
    display: block;
    border-radius: 4px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .channel canvas,
    .channel img {
        border-radius: 3px;
    }
}

@media (max-width: 768px) {
    .channel canvas,
    .channel img {
        border-radius: 2px;
    }
}

@media (max-width: 480px) {
    .channel canvas,
    .channel img {
        border-radius: 2px;
        border-width: 0.5px;
    }
}

.channel-label {
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 0.1rem 0.2rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin: 0;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.channel-copyright {
    position: absolute;
    bottom: 0.2rem;
    right: 0.1rem;
    background: transparent;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0;
    font-family: "Kanit", sans-serif;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

@media (max-width: 1200px) {
    .channel-copyright {
        font-size: 0.55rem;
    }
}

@media (max-width: 900px) {
    .channel-copyright {
        font-size: 0.5rem;
    }
}

@media (max-width: 768px) {
    .channel-copyright {
        font-size: 0.45rem;
    }
}

@media (max-width: 480px) {
    .channel-copyright {
        font-size: 0.4rem;
    }
}

/* Copyright positioning is now handled by wrapper structure */

/* AIA 304 copyright uses same styling as channel copyright */
.aia-304-copyright {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: transparent;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0;
    font-family: "Kanit", sans-serif;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* iPad positioning is now handled dynamically in JavaScript */

/* All copyright positions are now handled by wrapper structure */

/* Right Panel - Calendar */
.right-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 1400px) {
    .right-panel {
        padding: 0.4rem;
    }
}

@media (max-width: 1200px) {
    .right-panel {
        padding: 0.5rem;
        min-height: 400px;
    }
}

@media (max-width: 900px) {
    .right-panel {
        padding: 0.4rem;
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .right-panel {
        padding: 0.3rem;
        min-height: 320px;
    }
}

@media (max-width: 480px) {
    .right-panel {
        padding: 0.25rem;
        min-height: 300px;
    }
}

.calendar-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 100%;
    overflow: hidden;
}

.timestamp {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #333;
    flex-shrink: 0;
}

@media (max-width: 1400px) {
    .timestamp {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
}

@media (max-width: 1200px) {
    .timestamp {
        font-size: 0.75rem;
        padding: 0.35rem;
    }
}

@media (max-width: 900px) {
    .timestamp {
        font-size: 0.7rem;
        padding: 0.3rem;
    }
}

@media (max-width: 768px) {
    .timestamp {
        font-size: 0.65rem;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .timestamp {
        font-size: 0.6rem;
        padding: 0.2rem;
    }
}

.time-selector {
    flex-shrink: 0;
}

.time-selector label {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

@media (max-width: 1400px) {
    .time-selector label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
}

@media (max-width: 1200px) {
    .time-selector label {
        font-size: 0.75rem;
        margin-bottom: 0.18rem;
    }
}

@media (max-width: 900px) {
    .time-selector label {
        font-size: 0.7rem;
        margin-bottom: 0.15rem;
    }
}

@media (max-width: 768px) {
    .time-selector label {
        font-size: 0.65rem;
        margin-bottom: 0.12rem;
    }
}

@media (max-width: 480px) {
    .time-selector label {
        font-size: 0.6rem;
        margin-bottom: 0.1rem;
    }
}

.time-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #333;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: "Kanit", sans-serif;
}

@media (max-width: 1400px) {
    .time-select {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 1200px) {
    .time-select {
        padding: 0.35rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 900px) {
    .time-select {
        padding: 0.3rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .time-select {
        padding: 0.25rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .time-select {
        padding: 0.2rem;
        font-size: 0.6rem;
    }
}

#custom-calendar {
    flex: 1;
    min-height: 350px;
    max-height: 450px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: "Kanit", sans-serif;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1400px) {
    #custom-calendar {
        min-height: 320px;
        max-height: 400px;
    }
}

@media (max-width: 1200px) {
    #custom-calendar {
        min-height: 300px;
        max-height: 380px;
    }
}

@media (max-width: 900px) {
    #custom-calendar {
        min-height: 280px;
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    #custom-calendar {
        min-height: 260px;
        max-height: 320px;
    }
}

@media (max-width: 480px) {
    #custom-calendar {
        min-height: 240px;
        max-height: 280px;
    }
}

/* Custom Calendar Header */
.custom-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

@media (max-width: 1400px) {
    .custom-calendar-header {
        padding: 0.4rem;
    }
}

@media (max-width: 1200px) {
    .custom-calendar-header {
        padding: 0.35rem;
    }
}

@media (max-width: 900px) {
    .custom-calendar-header {
        padding: 0.3rem;
    }
}

@media (max-width: 768px) {
    .custom-calendar-header {
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .custom-calendar-header {
        padding: 0.2rem;
    }
}

.custom-calendar-nav {
    background: none;
    border: none;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

@media (max-width: 1400px) {
    .custom-calendar-nav {
        font-size: 0.9rem;
        padding: 0.2rem;
    }
}

@media (max-width: 1200px) {
    .custom-calendar-nav {
        font-size: 0.85rem;
        padding: 0.18rem;
    }
}

@media (max-width: 900px) {
    .custom-calendar-nav {
        font-size: 0.8rem;
        padding: 0.15rem;
    }
}

@media (max-width: 768px) {
    .custom-calendar-nav {
        font-size: 0.75rem;
        padding: 0.12rem;
    }
}

@media (max-width: 480px) {
    .custom-calendar-nav {
        font-size: 0.7rem;
        padding: 0.1rem;
    }
}

.custom-calendar-nav:hover {
    background: #e9ecef;
}

.custom-calendar-month-year {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-year-select {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    font-family: "Kanit", sans-serif;
    cursor: pointer;
}

@media (max-width: 1400px) {
    .month-year-select {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 1200px) {
    .month-year-select {
        padding: 0.18rem 0.35rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 900px) {
    .month-year-select {
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 768px) {
    .month-year-select {
        padding: 0.12rem 0.25rem;
        font-size: 0.6rem;
        border-radius: 3px;
    }
}

@media (max-width: 480px) {
    .month-year-select {
        padding: 0.1rem 0.2rem;
        font-size: 0.55rem;
        border-radius: 2px;
    }
}

.month-year-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Custom Calendar Body */
.custom-calendar-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.custom-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.custom-calendar-weekday {
    padding: 0.4rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
}

@media (max-width: 1400px) {
    .custom-calendar-weekday {
        padding: 0.35rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 1200px) {
    .custom-calendar-weekday {
        padding: 0.3rem;
        font-size: 0.6rem;
    }
}

@media (max-width: 900px) {
    .custom-calendar-weekday {
        padding: 0.25rem;
        font-size: 0.55rem;
    }
}

@media (max-width: 768px) {
    .custom-calendar-weekday {
        padding: 0.2rem;
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    .custom-calendar-weekday {
        padding: 0.15rem;
        font-size: 0.45rem;
    }
}

.custom-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    padding: 0.3rem;
    gap: 2px;
}

@media (max-width: 1400px) {
    .custom-calendar-days {
        padding: 0.25rem;
        gap: 1.5px;
    }
}

@media (max-width: 1200px) {
    .custom-calendar-days {
        padding: 0.2rem;
        gap: 1px;
    }
}

@media (max-width: 900px) {
    .custom-calendar-days {
        padding: 0.15rem;
        gap: 1px;
    }
}

@media (max-width: 768px) {
    .custom-calendar-days {
        padding: 0.1rem;
        gap: 0.5px;
    }
}

@media (max-width: 480px) {
    .custom-calendar-days {
        padding: 0.08rem;
        gap: 0.5px;
    }
}

.custom-calendar-day {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (max-width: 1400px) {
    .custom-calendar-day {
        height: 50px;
        font-size: 0.75rem;
    }
}

@media (max-width: 1200px) {
    .custom-calendar-day {
        height: 45px;
        font-size: 0.7rem;
    }
}

@media (max-width: 900px) {
    .custom-calendar-day {
        height: 40px;
        font-size: 0.65rem;
    }
}

@media (max-width: 768px) {
    .custom-calendar-day {
        height: 35px;
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .custom-calendar-day {
        height: 30px;
        font-size: 0.55rem;
    }
}

.custom-calendar-day:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.custom-calendar-day.selected {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
    transform: scale(1.05);
}

.custom-calendar-day.has-data {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.custom-calendar-day.other-month {
    color: #adb5bd;
    background: #f8f9fa;
}

.custom-calendar-day.disabled {
    color: #adb5bd;
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.5;
}

.custom-calendar-day.disabled:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

/* Flare class colors - matching attached image */
.x-class {
    background: #ff6b6b !important;
    color: #fff !important;
}

.x-class .flare-class {
    color: #fff;
}

.x-class .detail-item.active {
    background: #ff6b6b !important;
    color: #fff !important;
}

.m-class {
    background: #ffa726 !important;
    color: #fff !important;
}

.m-class .flare-class {
    color: #fff;
}

.m-class .detail-item.active {
    background: #ffa726 !important;
    color: #fff !important;
}

.c-class {
    background: #81c784 !important;
    color: #fff !important;
}

.c-class .flare-class {
    color: #fff;
}

.c-class .detail-item.active {
    background: #81c784 !important;
    color: #fff !important;
}

.o-class {
    background: #4caf50 !important;
    color: #fff !important;
}

.o-class .flare-class {
    color: #fff;
}

.o-class .detail-item.active {
    background: #4caf50 !important;
    color: #fff !important;
}



/* Loading state */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-radius: 50%;
    border-top-color: #333;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .header {
        padding: 0.5rem 1rem;
    }
    
    .controls-section {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 1rem;
        justify-content: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        gap: 0.5rem;
    }
    
    .prediction-section {
        grid-template-columns: 1fr 1fr;
        height: auto;
        min-height: 160px;
        margin-bottom: 0.5rem;
    }
    
    .section-headers-two {
        grid-template-columns: 1fr 1fr;
        gap: 0.2rem;
    }
    
    .section-header {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
        text-align: center;
        line-height: 1.1;
    }
    
    .performance-section {
        min-height: 100px;
    }
    
    .performance-display {
        min-height: 90px;
    }
    
    .solar-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        min-height: 350px;
    }
    
    .channel {
        min-height: 70px;
    }
    
    .channel-label {
        font-size: 0.7rem;
        padding: 0.05rem 0.15rem;
    }
}

@media (max-width: 900px) {
    .header {
        padding: 0.5rem;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .author-names {
        font-size: 0.9rem;
    }
    
    .controls-section {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .language-toggle {
        /* 自然な順序で横並び */
    }
    
    .theme-toggle {
        /* 自然な順序で横並び */
    }
    
    .publication-links {
        gap: 0.5rem;
        margin-top: -0.5rem;
    }
    
    .external-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .main-layout {
        gap: 0.4rem;
    }
    
    .prediction-section {
        grid-template-columns: 1fr 1fr;
        height: auto;
        min-height: 200px;
        margin-bottom: 0.4rem;
    }
    
    .section-headers-two {
        grid-template-columns: 1fr 1fr;
        gap: 0.1rem;
        margin-bottom: 0.3rem;
    }
    
    .section-header {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        line-height: 1.0;
    }
    
    .performance-section {
        min-height: 70px;
        margin-bottom: 0.2rem;
    }
    
    .performance-display {
        min-height: 60px;
        padding: 0.3rem;
    }
    
    .solar-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, 1fr);
        min-height: 400px;
        gap: 0.2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.25rem 0.25rem 0.25rem;
    }
    
    .container {
        gap: 0.25rem;
    }
    
    .header {
        padding: 0.5rem;
        position: relative;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        gap: 1rem;
    }
    
    .title-section {
        width: 100%;
        text-align: center;
        padding-right: 0;
    }
    
    .title-with-logo {
        flex-direction: row;
        gap: 0.75rem;
        align-items: flex-start;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .logo {
        height: 45px;
        flex-shrink: 0;
    }
    
    .title-content {
        flex: 1;
        text-align: center;
        align-items: center;
    }
    
    .title {
        font-size: 1.6rem;
        line-height: 1.0;
        text-align: center;
        margin-bottom: 0.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .subtitle {
        font-size: 0.8rem;
        margin-top: 0;
        text-align: center;
    }
    
    .author-names {
        font-size: 0.8rem;
        margin-top: -0.5rem;
        text-align: center;
        margin-left: 1.5rem;
    }
    
    .university-name {
        margin-bottom: 0.25rem;
    }
    
    .subtitle,
    .publication-links {
        transform: translateX(0);
    }
    
    .publication-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.15rem;
        margin-top: 0.2rem;
        margin-bottom: 0.2rem;
    }
    
    .external-link {
        padding: 0.15rem 0.3rem;
        font-size: 0.5rem;
    }
    
    .controls-section {
        position: relative;
        top: auto;
        right: auto;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: center;
        margin-top: 0.2rem;
        order: 3;
        width: 100%;
    }
    
    .theme-toggle {
        /* 自然な順序で横並び */
    }
    
    .language-toggle {
        /* 自然な順序で横並び */
    }
    
    .lang-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .theme-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .theme-text {
        font-size: 0.75rem;
    }
    
    .flare-class {
        font-size: 2.5rem;
    }
    
    .prediction-section {
        grid-template-columns: 1fr 1fr;
        min-height: 180px;
        margin-bottom: 0.3rem;
    }
    
    .section-headers-two {
        grid-template-columns: 1fr 1fr;
        gap: 0.15rem;
        margin-bottom: 0.25rem;
    }
    
    .section-header {
        font-size: 0.7rem;
        padding: 0.2rem 0.3rem;
        line-height: 1.0;
    }
    
    .performance-section {
        min-height: 60px;
        margin-bottom: 0.15rem;
    }
    
    .performance-display {
        min-height: 50px;
        padding: 0.25rem;
    }
    
    /* パーセンテージ表示のフォントサイズを調整 */
    .performance-display div[style*="font-size: 3rem"] {
        font-size: 2.2rem !important;
    }
    
    .solar-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, 1fr);
        min-height: 450px;
        gap: 0.15rem;
    }
    
    .channel {
        min-height: 80px;
    }
    
    .channel-label {
        font-size: 0.8rem;
        padding: 0.05rem 0.1rem;
        min-height: 1rem;
    }
    
    .image-caption {
        font-size: 0.75rem;
        margin-top: 0.3rem;
        line-height: 1.2;
        display: block !important;
        visibility: visible !important;
    }
    
    .model-image-container {
        min-height: 200px;
        height: auto !important;
        overflow: visible;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
    }
    
    .model-image {
        max-height: 180px !important;
        width: auto !important;
        flex-shrink: 0;
    }
    
    .model-images {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    

}

@media (max-width: 480px) {
    body {
        padding: 0.8rem 0.15rem 0.15rem 0.15rem;
    }
    
    .header {
        padding: 0.4rem 0.25rem;
    }
    
    .title-section {
        width: 100%;
        text-align: center;
        padding-right: 0;
    }
    
    .title-with-logo {
        gap: 0.5rem;
        justify-content: center;
    }
    
    .title {
        font-size: 1.4rem;
        line-height: 1.0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .subtitle {
        font-size: 0.75rem;
        text-align: center;
    }
    
    .author-names {
        font-size: 0.75rem;
        margin-top: -0.3rem;
        text-align: center;
        margin-left: 2.8rem;
    }
    
    .university-name {
        margin-bottom: 0.15rem;
    }
    
    .logo {
        height: 35px;
    }
    
    .publication-links {
        gap: 0.1rem;
        margin-top: 0.15rem;
        margin-bottom: 0.15rem;
        justify-content: center;
    }
    
    .external-link {
        padding: 0.1rem 0.25rem;
        font-size: 0.45rem;
    }
    
    .external-link .icon {
        font-size: 0.6rem;
    }
    
    .controls-section {
        flex-direction: row;
        gap: 1rem;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin-top: 0.15rem;
    }
    
    .lang-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
    }
    
    .theme-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .theme-icon {
        font-size: 0.8rem;
    }
    
    .theme-text {
        font-size: 0.7rem;
    }
    
    .section-main-title {
        font-size: 1.1rem;
    }
    
    .section-header {
        font-size: 0.6rem;
        padding: 0.1rem 0.15rem;
        line-height: 0.9;
        text-align: center;
    }
    
    .prediction-section {
        grid-template-columns: 1fr 1fr;
        min-height: 160px;
        margin-bottom: 0.25rem;
    }
    
    .section-headers-two {
        grid-template-columns: 1fr 1fr;
        gap: 0.1rem;
        margin-bottom: 0.2rem;
    }
    
    .performance-section {
        min-height: 50px;
        margin-bottom: 0.1rem;
    }
    
    .performance-display {
        min-height: 40px;
        padding: 0.2rem;
    }
    
    /* パーセンテージ表示のフォントサイズを調整 */
    .performance-display div[style*="font-size: 3rem"] {
        font-size: 2rem !important;
    }
    
    .solar-grid {
        min-height: 400px;
        gap: 0.1rem;
    }
    
    .channel-label {
        font-size: 0.7rem;
        padding: 0.03rem 0.08rem;
    }
    

}

.no-data {
    color: #6c757d;
    font-size: 1rem;
    font-style: italic;
    margin: 1rem 0;
    text-align: center;
}

/* Dark Theme (Space Mode) */
body.dark-theme {
    background: linear-gradient(135deg, #0c1445 0%, #1a2472 50%, #2d3561 100%);
    color: #e8e9ea;
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
}

.dark-theme .container {
    background: transparent;
}

.dark-theme .header {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .title {
    color: #f1f5f9;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.dark-theme .subtitle {
    color: #cbd5e1;
}

.dark-theme .theme-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
}

.dark-theme .theme-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
}

.dark-theme .left-panel,
.dark-theme .right-panel {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .prediction-result {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .prob-item,
.dark-theme .binary-item {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .solar-section {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .section-title {
    color: #f1f5f9;
}

.dark-theme .timestamp {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
}

.dark-theme .time-select {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
}

.dark-theme #custom-calendar {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .custom-calendar-header {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
}

.dark-theme .custom-calendar-nav {
    color: #f1f5f9;
}

.dark-theme .custom-calendar-nav:hover {
    background: rgba(51, 65, 85, 0.9);
}

.dark-theme .month-year-select {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
}

.dark-theme .custom-calendar-weekdays {
    background: rgba(30, 41, 59, 0.8);
}

.dark-theme .custom-calendar-weekday {
    color: #cbd5e1;
}

.dark-theme .custom-calendar-day {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
}

.dark-theme .custom-calendar-day:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: rgba(148, 163, 184, 0.5);
}

.dark-theme .custom-calendar-day.selected {
    background: rgba(59, 130, 246, 0.9);
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
    font-weight: 700;
    transform: scale(1.05);
}

.dark-theme .custom-calendar-day.has-data {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    color: #d1fae5;
}

.dark-theme .custom-calendar-day.other-month {
    color: #64748b;
    background: rgba(51, 65, 85, 0.3);
}

.dark-theme .custom-calendar-day.disabled {
    color: #64748b;
    background: rgba(51, 65, 85, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

.dark-theme .custom-calendar-day.disabled:hover {
    background: rgba(51, 65, 85, 0.3);
    border-color: rgba(148, 163, 184, 0.3);
}

.dark-theme .flare-description,
.dark-theme .prob-label,
.dark-theme .binary-label,
.dark-theme .binary-period,
.dark-theme .confidence {
    color: #e2e8f0;
}

.dark-theme .prob-value,
.dark-theme .binary-value,
.dark-theme .flare-class {
    color: #f1f5f9;
}

.dark-theme .channel-label {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    backdrop-filter: blur(10px);
}

.dark-theme .channel-copyright {
    background: transparent;
    color: #f1f5f9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}

.dark-theme .section-header {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
    font-size: 1rem;
}

.dark-theme .external-link {
    background-color: rgba(51, 65, 85, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
}

.dark-theme .external-link:hover {
    background-color: rgba(71, 85, 105, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: #ffffff;
}

.dark-theme .theme-btn {
    background-color: rgba(51, 65, 85, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
}

.dark-theme .theme-btn:hover {
    background-color: rgba(71, 85, 105, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: #ffffff;
}

/* Dark theme for authors */
.dark-theme .author-names {
    color: #cbd5e1;
}

.dark-theme .university-name {
    color: #cbd5e1;
}

/* Dark theme for language toggle */
.dark-theme .lang-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #94a3b8;
    backdrop-filter: blur(10px);
}

.dark-theme .lang-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: #cbd5e1;
}

.dark-theme .lang-btn.active {
    background: rgba(59, 130, 246, 0.9);
    border-color: #3b82f6;
    color: #fff;
}

/* Expandable Information Sections */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.info-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.info-header:hover {
    background: #e9ecef;
}

.info-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    font-family: "Kanit", sans-serif;
}

.expand-icon {
    font-size: 0.9rem;
    color: #6c757d;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.info-section.expanded .expand-icon {
    transform: rotate(180deg);
}

.info-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
}

.info-section.expanded .info-content {
    max-height: 1000px;
}

.info-body {
    padding: 1.5rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.text-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.text-content p {
    margin-bottom: 1rem;
}

.text-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.text-content li {
    margin-bottom: 0.5rem;
}

.text-content strong {
    font-weight: 600;
    color: #212529;
}

/* Related Links */
.related-links {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.related-links h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    font-family: "Kanit", sans-serif;
}

.link-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    text-decoration: none;
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: "Kanit", sans-serif;
}

.link-chip:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chip-icon {
    font-size: 1rem;
}

/* Video Content */
.video-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-container {
    width: 100%;
    max-width: 400px;
}

.video-container video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 1200px) {
    .video-container {
        max-width: 350px;
    }
}

@media (max-width: 900px) {
    .video-container {
        max-width: 100%;
    }
    
    .video-container video {
        max-height: 300px;
        object-fit: cover;
    }
}

@media (max-width: 768px) {
    .video-container {
        max-width: 100%;
        width: 100%;
    }
    
    .video-container video {
        max-height: 250px;
        border-radius: 6px;
        width: 100%;
        display: block;
    }
    
    .video-caption {
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    .video-container {
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        padding: 0 0.5rem;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    
    .video-container video {
        max-height: 220px;
        border-radius: 4px;
        width: 100%;
        display: block;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    .video-caption {
        font-size: 0.7rem;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

@media (max-width: 320px) {
    .video-container {
        padding: 0 0.25rem;
    }
    
    .video-container video {
        max-height: 180px;
        min-height: 150px;
        border-radius: 3px;
    }
    
    .video-caption {
        font-size: 0.65rem;
        margin-top: 0.5rem;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .video-credits {
        font-size: 0.5rem !important;
        margin-top: 0.5rem !important;
        padding: 0.3rem !important;
    }
    
    .video-credits div {
        font-size: 0.45rem !important;
        max-width: 250px !important;
        gap: 0.15rem 0.3rem !important;
    }
    
    .info-section.expanded .info-content {
        max-height: 1800px;
    }
}

@media (max-width: 280px) {
    .info-section.expanded .info-content {
        max-height: 2000px;
    }
    
    .video-container video {
        max-height: 160px;
        min-height: 120px;
    }
}

.video-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    line-height: 1.2;
}

/* Model Content */
.model-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.model-images {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 400px;
}

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

.model-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fff;
    padding: 1rem;
}

.clickable-image {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
    .model-images {
        max-width: 350px;
        gap: 1.2rem;
    }
    
    .model-image {
        padding: 0.8rem;
    }
}

@media (max-width: 900px) {
    .model-images {
        max-width: 100%;
        gap: 1rem;
    }
    
    .model-image {
        padding: 0.6rem;
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    .model-images {
        gap: 0.8rem;
    }
    
    .model-image {
        padding: 0.5rem;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .model-images {
        gap: 0.6rem;
        flex-direction: column;
        align-items: center;
    }
    
    .model-image {
        padding: 0.4rem;
    }
    
    .image-caption {
        font-size: 0.7rem;
        margin-top: 0.25rem;
        line-height: 1.1;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .model-image-container {
        min-height: 220px;
        height: auto !important;
        overflow: visible;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
    }
    
    .model-image {
        max-height: 200px !important;
        width: auto !important;
        flex-shrink: 0;
    }
}

.image-caption {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    margin: 0;
}

/* Placeholder Content */
.placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-box {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    width: 100%;
    max-width: 300px;
}

/* Dark Theme for Info Sections */
.dark-theme .info-section {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .info-header {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
}

.dark-theme .info-header:hover {
    background: rgba(51, 65, 85, 0.9);
}

.dark-theme .info-title {
    color: #f1f5f9;
}

.dark-theme .expand-icon {
    color: #cbd5e1;
}

.dark-theme .text-content {
    color: #e2e8f0;
}

.dark-theme .text-content strong {
    color: #f1f5f9;
}

.dark-theme .related-links {
    border-color: rgba(148, 163, 184, 0.3);
}

.dark-theme .related-links h4 {
    color: #f1f5f9;
}

.dark-theme .link-chip {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    backdrop-filter: blur(10px);
}

.dark-theme .link-chip:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: #f1f5f9;
}

.dark-theme .video-caption {
    color: #94a3b8;
}

.dark-theme .model-image {
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .image-caption {
    color: #94a3b8;
}

.dark-theme .placeholder-box {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #94a3b8;
}

/* Dark theme for performance sections */
.dark-theme .performance-display {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

/* Video Link Styling */
.video-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.video-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.dark-theme .video-link {
    color: #60a5fa;
}

.dark-theme .video-link:hover {
    color: #93c5fd;
}

/* Current Forecast Section */
.current-forecast-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.current-forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .current-forecast-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .current-forecast-header {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

.section-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    font-family: "Kanit", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .section-main-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .section-main-title {
        font-size: 1.4rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    .past-forecasts-section .section-main-title {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .section-main-title {
        font-size: 1.2rem;
    }
    
    .past-forecasts-section .section-main-title {
        margin-bottom: 0.75rem;
    }
}

.current-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .current-time {
        padding: 0.4rem 0.8rem;
        gap: 0.4rem;
    }
}

@media (max-width: 768px) {
    .current-time {
        padding: 0.35rem 0.7rem;
        border-radius: 15px;
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .current-time {
        padding: 0.3rem 0.6rem;
        border-radius: 12px;
        gap: 0.3rem;
    }
}

.time-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

@media (max-width: 900px) {
    .time-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .time-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .time-label {
        font-size: 0.7rem;
    }
}

.time-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    font-family: "Kanit", monospace;
}

@media (max-width: 900px) {
    .time-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .time-value {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .time-value {
        font-size: 0.8rem;
    }
}

.current-forecast-content {
    display: grid;
    grid-template-columns: 0.85fr 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
    height: 450px;
}

.subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    text-align: center;
    font-family: "Kanit", sans-serif;
}

/* Black panel subsection titles */
.aia-304-panel .subsection-title,
.current-prediction-panel .subsection-title {
    color: #f1f5f9;
}

/* Unified Panel Styling */
.panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem 1rem 1rem 1rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.5rem 0;
    text-align: center;
    font-family: "Kanit", sans-serif;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.2rem;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific styling for long forecast title */
.forecast-panel .panel-title {
    font-size: 0.95rem;
}

.panel-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
    margin: 0 0 1rem 0;
    text-align: center;
    font-family: "Kanit", sans-serif;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Solar Surface Panel */
.solar-surface-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.solar-surface-panel .aia-304-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: calc(100% - 6rem);
}

/* Status and Forecast Panels */
.current-status-panel,
.forecast-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.current-status-panel .status-level-blocks,
.forecast-panel .forecast-level-blocks {
    flex: 0 1 auto;
    max-height: 220px;
    overflow: hidden;
}

.status-level-blocks,
.forecast-level-blocks {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0.5rem;
}

.status-level-blocks .level-block,
.forecast-level-blocks .level-block {
    width: 100%;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    border-radius: 4px;
    border: 2px solid;
    padding: 0.4rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
    flex: 0 0 55px;
}

.panel-status {
    text-align: center;
    padding: 0.3rem 0.5rem;
    margin-top: auto;
    flex: 0 0 auto;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-status .status-text {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    font-family: "Kanit", sans-serif;
}

.panel-status .level-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    font-family: "Kanit", sans-serif;
}

/* Keep original AIA panel for backwards compatibility */
.aia-304-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem 1rem 2rem 1rem; /* Add extra bottom padding */
    height: 420px; /* Increase height to accommodate extra padding */
    display: flex;
    flex-direction: column;
}

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

.loaded-times {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.loaded-times-label {
    color: #6c757d;
    font-weight: 500;
}

.loaded-times-value {
    color: #333;
    font-weight: 600;
    font-family: "Kanit", monospace;
}

.aia-304-container {
    position: relative;
    background: #110000;
    border-radius: 4px;
    width: 100%;
    height: auto;
    max-width: 300px;
    max-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
    flex-shrink: 0;
    aspect-ratio: 1;
}

/* Image wrapper for relative positioning */
.channel-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AIA 304 image wrapper no longer needed - using direct container positioning */

.aia-304-canvas {
    width: 100%;
    height: 100%;
    max-width: 320px;
    max-height: 320px;
    display: none;
    object-fit: contain;
}

.aia-304-canvas.active {
    display: block;
}

.aia-304-copyright {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: transparent;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0;
    font-family: "Kanit", sans-serif;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Current Prediction Panel */
.current-prediction-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem 1rem 2rem 1rem; /* Add extra bottom padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 420px; /* Increase height to accommodate extra padding */
    overflow: hidden;
    box-sizing: border-box;
}

/* Current Forecast Title */
.current-forecast-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    text-align: center;
    font-family: "Kanit", sans-serif;
}

/* Single column layout for forecast */
.forecast-single-column {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    flex: 1;
}

/* Current Forecast specific styling - unified with probability boxes */
.current-prediction-panel .prediction-display {
    padding: 0;
    height: 100%;
    justify-content: space-between;
}

.current-prediction-panel .flare-level-blocks {
    gap: 0.4rem;
    flex: 1;
    justify-content: space-between;
    padding: 0.5rem;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}

.current-prediction-panel .level-block {
    width: 100%;
    height: 35px;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border: 2px solid;
}

.current-prediction-panel .status-text {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.current-prediction-panel .level-text {
    font-size: 1.1rem;
    color: #fff;
}

.current-prediction-panel .flare-status {
    padding: 0.5rem;
    margin-top: 0;
}



.prediction-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* Flare Level Blocks */
.flare-level-blocks {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    align-items: stretch;
    padding: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.level-block {
    width: 100%;
    border-radius: 4px;
    border: 2px solid;
    transition: all 0.3s ease;
    height: 35px;
    box-sizing: border-box;
    padding: 0.3rem 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-width: 0;
    flex-shrink: 0;
}

.level-block span {
    font-size: 1.2rem;
}

.level-block span:first-child {
    font-size: 1.1rem;
}

.level-block span:last-child {
    font-size: 1.3rem;
}



/* Flare Level Colors and Classes */
.level-block:not(.filled) {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

.level-1 .level-block.filled {
    background: rgba(76, 175, 80, 0.8);
    border-color: #4caf50;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.level-2 .level-block.filled {
    background: rgba(129, 199, 132, 0.8);
    border-color: #81c784;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.level-3 .level-block.filled {
    background: rgba(255, 167, 38, 0.8);
    border-color: #ffa726;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.level-4 .level-block.filled {
    background: rgba(255, 107, 107, 0.8);
    border-color: #ff6b6b;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Flare Status */
.flare-status {
    text-align: center;
    padding: 0.5rem;
    margin-top: auto;
}

.status-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
    font-family: "Kanit", sans-serif;
}

.level-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    font-family: "Kanit", sans-serif;
}

/* Status Colors */
.status-quiet .status-text {
    color: #4caf50;
}

.status-eruptive .status-text {
    color: #81c784;
}

.status-active .status-text {
    color: #ffa726;
}

.status-major .status-text {
    color: #ff6b6b;
}

/* Past Forecasts Section */
.past-forecasts-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.5rem;
}

/* Past Prediction Panel */
.past-prediction-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 130px;
}

/* Dark Theme for New Sections */
.dark-theme .current-forecast-section,
.dark-theme .past-forecasts-section {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}

.dark-theme .section-main-title {
    color: #f1f5f9;
}

.dark-theme .subsection-title {
    color: #cbd5e1;
}

.dark-theme .aia-304-panel,
.dark-theme .current-prediction-panel,
.dark-theme .past-prediction-panel {
    background: #0a0a0a;
    border-color: rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(10px);
}

.dark-theme .aia-304-container {
    background: #0E0000;
}

.dark-theme .current-time {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
}

.dark-theme .time-label {
    color: #94a3b8;
}

.dark-theme .time-value {
    color: #f1f5f9;
}

.dark-theme .loaded-times-label {
    color: #94a3b8;
}

.dark-theme .loaded-times-value {
    color: #f1f5f9;
}

.dark-theme .aia-304-copyright {
    color: #f1f5f9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}



.dark-theme .status-text {
    color: #f1f5f9;
}

.dark-theme .level-text {
    color: #94a3b8;
}

/* ライトモードでのlevel-block内のテキスト色調整 */
.level-block span {
    color: #495057 !important;
}

.level-block:not(.filled) span {
    color: #6c757d !important;
}

/* ライトモードでfilled状態のバーは白文字 */
.level-block.filled span {
    color: #fff !important;
}

/* ダークモードでのlevel-block内のテキスト色調整 */
.dark-theme .level-block span {
    color: #fff !important;
}

.dark-theme .level-block:not(.filled) span {
    color: #94a3b8 !important;
}

/* Responsive Design for Panels */
@media (max-width: 1400px) {
    .current-forecast-content {
        grid-template-columns: 1fr 1fr 1fr;
        height: auto;
        gap: 0.75rem;
    }
    
    .panel {
        height: 380px;
    }
    
    .panel-title {
        font-size: 1rem;
        min-height: 2rem;
    }
    
    .panel-subtitle {
        font-size: 0.85rem;
        min-height: 1.3rem;
    }
}

@media (max-width: 1200px) {
    .current-forecast-content {
        grid-template-columns: 1fr 1fr;
        height: auto;
        gap: 0.75rem;
    }
    
    .solar-surface-panel {
        grid-column: 1 / -1;
        height: 320px;
        order: -1;
    }
    
    .current-status-panel,
    .forecast-panel {
        height: 350px;
    }
    
    .panel-title {
        font-size: 0.95rem;
        min-height: 1.8rem;
    }
    
    .forecast-panel .panel-title {
        font-size: 0.85rem;
    }
    
    .panel-subtitle {
        font-size: 0.8rem;
        min-height: 1.2rem;
    }
    
    .status-level-blocks .level-block,
    .forecast-level-blocks .level-block {
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        padding: 0.25rem 0.4rem;
        font-size: 0.85rem;
    }
    
    .panel-status .status-text {
        font-size: 1.2rem;
    }
    
    .panel-status .level-text {
        font-size: 1rem;
    }
    
    .aia-304-container {
        max-width: 320px;
        max-height: 320px;
    }
}

@media (max-width: 900px) {
    .current-forecast-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .panel {
        height: 300px;
    }
    
    .solar-surface-panel {
        grid-column: 1;
        height: 280px;
        order: -1;
    }
    
    .current-status-panel,
    .forecast-panel {
        height: 280px;
    }
    
    .panel-title {
        font-size: 0.9rem;
        min-height: 1.6rem;
    }
    
    .forecast-panel .panel-title {
        font-size: 0.8rem;
    }
    
    .panel-subtitle {
        font-size: 0.75rem;
        min-height: 1.1rem;
    }
    
    .status-level-blocks .level-block,
    .forecast-level-blocks .level-block {
        height: 35px;
        min-height: 35px;
        max-height: 35px;
        padding: 0.2rem 0.35rem;
        font-size: 0.8rem;
    }
    
    .panel-status {
        padding: 0.25rem 0.4rem;
    }
    
    .panel-status .status-text {
        font-size: 1.1rem;
    }
    
    .panel-status .level-text {
        font-size: 0.9rem;
    }
    
    .aia-304-container {
        max-width: 300px;
        max-height: 300px;
    }
}

/* Responsive Design for Info Sections */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-body {
        padding: 1rem;
    }
    
    .video-container {
        max-width: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .video-container video {
        max-height: 280px;
        object-fit: cover;
        width: 100%;
        display: block;
    }
    
    .link-chips {
        justify-content: center;
    }
    
    .info-section.expanded .info-content {
        max-height: 2000px;
    }
    
    .current-forecast-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        height: auto;
    }
    
    .panel {
        height: 320px;
    }
    
    .solar-surface-panel {
        height: 280px;
        order: -1;
    }
    
    .current-status-panel,
    .forecast-panel {
        height: 300px;
    }
    
    .solar-surface-panel .aia-304-container {
        max-width: 240px;
        max-height: 240px;
        margin: 0 auto;
    }
    
    .solar-surface-panel .aia-304-canvas {
        max-width: 240px;
        max-height: 240px;
    }
    
    .status-level-blocks .level-block,
    .forecast-level-blocks .level-block {
        height: 32px;
        min-height: 32px;
        max-height: 32px;
        padding: 0.1rem 0.2rem;
        font-size: 0.85rem;
    }
    
    .level-block span {
        font-size: 0.85rem !important;
    }
    
    .level-block span:first-child {
        font-size: 0.85rem !important;
    }
    
    .level-block span:last-child {
        font-size: 0.85rem !important;
    }
    
    .panel-title {
        font-size: 0.85rem;
        min-height: 1.5rem;
    }
    
    .forecast-panel .panel-title {
        font-size: 0.75rem;
    }
    
    .panel-subtitle {
        font-size: 0.7rem;
        min-height: 1rem;
    }
    
    .panel-status {
        padding: 0.2rem 0.3rem;
    }
    
    .panel-status .status-text {
        font-size: 1rem;
    }
    
    .panel-status .level-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .current-forecast-content {
        gap: 0.4rem;
    }
    
    .panel {
        height: 280px;
        padding: 0.75rem 0.5rem;
    }
    
    .solar-surface-panel {
        height: 240px;
    }
    
    .current-status-panel,
    .forecast-panel {
        height: 260px;
    }
    
    .panel-title {
        font-size: 0.8rem;
        min-height: 1.4rem;
        padding: 0 0.1rem;
    }
    
    .forecast-panel .panel-title {
        font-size: 0.7rem;
    }
    
    .panel-subtitle {
        font-size: 0.65rem;
        min-height: 0.9rem;
    }
    
    .solar-surface-panel .aia-304-container {
        max-width: 200px;
        max-height: 200px;
    }
    
    .solar-surface-panel .aia-304-canvas {
        max-width: 200px;
        max-height: 200px;
    }
    
    .status-level-blocks,
    .forecast-level-blocks {
        padding: 0.3rem 0.3rem;
        gap: 0.1rem;
    }
    
    .status-level-blocks .level-block,
    .forecast-level-blocks .level-block {
        height: 28px;
        min-height: 28px;
        max-height: 28px;
        padding: 0.08rem 0.15rem;
        font-size: 0.8rem;
    }
    
    .level-block span {
        font-size: 0.8rem !important;
    }
    
    .level-block span:first-child {
        font-size: 0.8rem !important;
    }
    
    .level-block span:last-child {
        font-size: 0.8rem !important;
    }
    
    .panel-status {
        padding: 0.15rem 0.25rem;
    }
    
    .panel-status .status-text {
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
    }
    
    .panel-status .level-text {
        font-size: 0.8rem;
    }
}

/* GOES X-ray Flux Chart Section */
.goes-chart-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.goes-chart-container {
    width: 100%;
    height: 300px;
    position: relative;
    margin-top: 0.5rem;
}

.goes-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 1200px) {
    .goes-chart-section {
        padding: 0.8rem;
    }
    
    .goes-chart-container {
        height: 280px;
    }
}

@media (max-width: 900px) {
    .goes-chart-section {
        padding: 0.6rem;
    }
    
    .goes-chart-container {
        height: 260px;
    }
}

@media (max-width: 768px) {
    .goes-chart-section {
        padding: 0.5rem;
        border-radius: 3px;
    }
    
    .goes-chart-container {
        height: 240px;
        margin-top: 0.4rem;
    }
}

@media (max-width: 480px) {
    .goes-chart-section {
        padding: 0.4rem;
        border-radius: 2px;
    }
    
    .goes-chart-container {
        height: 200px;
        margin-top: 0.3rem;
    }
}

/* Dark Theme for GOES Chart */
.dark-theme .goes-chart-section {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
}



/* Remove old prediction display rules - using new structure */

/* Single column forecast styling */
.forecast-single-column .flare-level-blocks {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
    width: 100% !important;
    height: 100% !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    padding: 0.5rem !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex: 1 !important;
}

/* Level blocks with percentage display */
.forecast-single-column .level-block {
    height: 45px !important;
    width: 100% !important;
    border-radius: 4px !important;
    border: 2px solid !important;
    padding: 0.4rem 0.6rem !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
    min-height: 45px !important;
    max-height: 45px !important;
    flex: none !important;
}

/* Responsive adjustments for current forecast */
@media (max-width: 1400px) {
    .forecast-single-column .level-block {
        height: 40px !important;
        padding: 0.35rem 0.55rem !important;
        font-size: 0.9rem !important;
    }
    
    .forecast-single-column .level-block span:first-child {
        font-size: 0.85rem !important;
    }
    
    .forecast-single-column .level-block span:last-child {
        font-size: 1.05rem !important;
    }
}

@media (max-width: 1200px) {
    .forecast-single-column .level-block {
        height: 35px !important;
        padding: 0.3rem 0.5rem !important;
        font-size: 0.85rem !important;
    }
    
    .forecast-single-column .level-block span:first-child {
        font-size: 0.8rem !important;
    }
    
    .forecast-single-column .level-block span:last-child {
        font-size: 1rem !important;
    }
}

@media (max-width: 900px) {
    .forecast-single-column {
        height: auto;
        min-height: 180px;
    }
    
    .forecast-single-column .level-block {
        height: 32px !important;
        padding: 0.25rem 0.4rem !important;
        font-size: 0.8rem !important;
    }
    
    .forecast-single-column .level-block span:first-child {
        font-size: 0.75rem !important;
    }
    
    .forecast-single-column .level-block span:last-child {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .forecast-single-column .level-block {
        height: 30px !important;
        padding: 0.2rem 0.35rem !important;
        font-size: 0.75rem !important;
    }
    
    .forecast-single-column .level-block span:first-child {
        font-size: 0.6rem !important;
    }
    
    .forecast-single-column .level-block span:last-child {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .forecast-single-column .level-block {
        height: 28px !important;
        padding: 0.15rem 0.3rem !important;
        font-size: 0.7rem !important;
    }
    
    .forecast-single-column .level-block span:first-child {
        font-size: 0.75rem !important;
    }
    
    .forecast-single-column .level-block span:last-child {
        font-size: 0.75rem !important;
    }
}

/* Disclaimer Section */
.disclaimer-section {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 2rem 0;
    margin-top: 2rem;
}

.disclaimer-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1rem;
}

.disclaimer-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    text-align: center;
    font-family: "Kanit", sans-serif;
}

.disclaimer-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6c757d;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.disclaimer-text p {
    margin-bottom: 0;
}

/* Dark theme for disclaimer */
.dark-theme .disclaimer-section {
    background: rgba(15, 23, 42, 0.9);
    border-top-color: rgba(148, 163, 184, 0.3);
}

.dark-theme .disclaimer-title {
    color: #f1f5f9;
}

.dark-theme .disclaimer-text {
    color: #94a3b8;
}

/* Dark theme for flare classification table */
.dark-theme .flare-classification-table table {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

.dark-theme .flare-classification-table thead tr {
    background-color: rgba(51, 65, 85, 0.8) !important;
    border-bottom: 2px solid rgba(148, 163, 184, 0.3) !important;
}

.dark-theme .flare-classification-table th {
    background-color: rgba(51, 65, 85, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #f1f5f9 !important;
}

.dark-theme .flare-classification-table td {
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #e2e8f0 !important;
    background-color: transparent !important;
}

.dark-theme .flare-classification-table tbody tr:nth-child(even) {
    background-color: rgba(51, 65, 85, 0.3) !important;
}

.dark-theme .flare-classification-table tbody tr:nth-child(even) td {
    background-color: rgba(51, 65, 85, 0.3) !important;
}

.dark-theme .flare-classification-table strong {
    color: #f1f5f9 !important;
}

/* Dark theme for source citation box */
.dark-theme .text-content div[style*="background-color: #f8f9fa"] {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #e2e8f0 !important;
}

.dark-theme .text-content div[style*="background-color: #f8f9fa"] strong {
    color: #f1f5f9 !important;
}

.dark-theme .text-content div[style*="background-color: #f8f9fa"] a {
    color: #60a5fa !important;
}

.dark-theme .text-content div[style*="background-color: #f8f9fa"] a:hover {
    color: #93c5fd !important;
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: modalFadeIn 0.3s ease-out;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10001;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-image {
    max-width: 100%;
    max-height: calc(90vh - 4rem);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.modal-caption {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    font-family: "Kanit", sans-serif;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Dark Theme for Modals */
.dark-theme .modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(20px);
}

.dark-theme .modal-close {
    color: #cbd5e1;
}

.dark-theme .modal-close:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #f1f5f9;
}

.dark-theme .modal-caption {
    color: #f1f5f9;
}

.dark-theme .modal-image {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
    }
    
    .modal-image {
        max-height: calc(95vh - 3rem);
    }
    
    .modal-caption {
        font-size: 1rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .modal-image {
        max-height: calc(95vh - 2.5rem);
        border-radius: 6px;
    }
    
    .modal-caption {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
}