/* =========================================
   Universal Theme Station
   全テーマ共通のデザインスイッチャー
   ========================================= */

.universal-theme-station {
    position: fixed;
    top: 50%;
    right: 3rem;
    transform: translateY(-50%);
    z-index: 99999;
    /* 最前面 */
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    font-family: 'Outfit', sans-serif;
}

/* モバイル対応 */
@media (max-width: 900px) {
    .universal-theme-station {
        right: 1rem;
        top: auto;
        bottom: 2rem;
        transform: none;
    }
}

/* ヘッダー部分 (Status / Label) */
.uni-station-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.uni-station-header:hover {
    transform: scale(1.05);
    background: #fff;
}

.uni-status-dot {
    width: 8px;
    height: 8px;
    background: #00ff9d;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff9d;
    animation: uni-pulse 2s infinite;
}

@keyframes uni-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* オプションコンテナ */
.uni-theme-options {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    padding: 12px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    position: absolute;
    right: 0;
    top: 50px;
    /* ヘッダーの下 */
}

/* モバイルでは上に展開 */
@media (max-width: 900px) {
    .uni-theme-options {
        top: auto;
        bottom: 50px;
    }
}

/* Open状態 */
.universal-theme-station.open .uni-theme-options {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
}

/* 個別テーマボタン */
.uni-theme-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    min-width: 140px;
}

.uni-theme-opt:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(-5px);
}

/* プレビューアイコン (共通定義) */
.uni-opt-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.uni-opt-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #444;
    letter-spacing: 0.5px;
}

/* --- テーマ別アイコンカラー --- */

/* Note Grid: Cyan / Dark Blue Gradient (区別用) */
.uni-preview-note-grid {
    background: linear-gradient(135deg, #00f2ff, #005f73);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Noir Rain: Monochrome Black */
.uni-preview-noir-rain {
    background: linear-gradient(180deg, #333, #000);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Water World: Pastel Aqua */
.uni-preview-water-world {
    background: linear-gradient(135deg, #FF9EAA, #B5EAD7);
}

/* Professional Story: Minimal White/Black */
.uni-preview-professional-story {
    background: #1a1a1a;
    border: 1px solid #fff;
}

/* Bead Family: Vivid Red/Blue */
.uni-preview-bead-family {
    background: linear-gradient(135deg, #FF3B30, #007AFF);
}

/* Vitality: Green/Pink */
.uni-preview-vitality {
    background: linear-gradient(135deg, #34d399, #f472b6);
}

/* Campus Note: Paper White */
.uni-preview-campus-note {
    background: linear-gradient(135deg, #fdfdfd, #e0e0e0);
    border: 1px solid #ccc;
}

/* Blue: Deep Blue Gradient */
.uni-preview-blue {
    background: linear-gradient(135deg, #001f3f, #0074D9);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* =========================================
   Global Site Info Modal
   ========================================= */
.site-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.site-info-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    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;
    width: 90%;
    max-width: 500px;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2;
}

.site-info-modal.active .modal-content {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

.modal-body {
    font-family: 'Outfit', sans-serif;
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    /* Preserve newlines */
}

/* Dark Theme Overrides (Auto apply if body has noir/ dark classes,
   but for now we base it on body dataset or generic dark style) */
/* Moved specific theme overrides to their distinct css files to avoid pollution */
body[data-theme="shibo-ink"] .modal-content {
    background: #111;
    border: 1px solid #333;
    color: #eee;
}

body[data-theme="shibo-ink"] .modal-close-btn {
    color: #fff;
}

/* Mobile Optimization for Modal (Fullscreen) */
@media (max-width: 900px) {
    .modal-content {
        padding: 2rem;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: none;
        /* Fullscreen doesn't need shadow */
        transform: none !important;
        /* Disable transform animation for simple fade */
    }

    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        text-align: center;
    }

    .modal-body {
        font-size: 0.9rem;
        line-height: 1.8;
        width: 100%;
        text-align: left;
        /* Keep text left aligned for readability, or center if preferred */
        /* Center alignment often looks better for short text in fullscreen */
        text-align: center;
    }

    .modal-close-btn {
        top: 20px;
        right: 20px;
        font-size: 2rem;
        padding: 1rem;
        /* Easier to tap */
    }
}