/**
 * HighRezIO Compare Lightbox Styles
 * 比較ブロック専用のライトボックス
 */

/* ============================================
   ライトボックス コンテナ
   ============================================ */
.hrz-clb {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hrz-clb.hrz-clb-active {
    display: block;
    opacity: 1;
}

/* 背景 */
.hrz-clb-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

/* コンテナ */
.hrz-clb-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 比較ラッパー */
.hrz-clb-compare-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 内部ラッパー */
.hrz-clb-inner {
    position: relative;
    cursor: grab;
    flex-shrink: 0;
}

.hrz-clb-inner:active {
    cursor: grabbing;
}

/* ============================================
   比較画像
   ============================================ */
.hrz-clb-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hrz-clb-image img {
    position: absolute;
    top: 0;
    left: 0;
    user-select: none;
    -webkit-user-drag: none;
}

/* 右画像（背景） */
.hrz-clb-right {
    z-index: 1;
}

/* 左画像（クリップ） */
.hrz-clb-left {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

/* ============================================
   スライダー
   ============================================ */
.hrz-clb-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    z-index: 10;
    transform: translateX(-50%);
}

.hrz-clb-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hrz-clb-handle-line {
    flex: 1;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.hrz-clb-handle-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: ew-resize;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.hrz-clb-handle-grip:hover {
    transform: scale(1.1);
}

.hrz-clb-handle-grip svg {
    width: 20px;
    height: 20px;
    color: #333;
}

/* ============================================
   ラベル
   ============================================ */
.hrz-clb-label {
    position: absolute;
    bottom: 12px;
    padding: 4px 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
}

.hrz-clb-label-left {
    left: 12px;
}

.hrz-clb-label-right {
    right: 12px;
}

/* ============================================
   メニュー
   ============================================ */
.hrz-clb-menu {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.hrz-clb-menu.hrz-clb-menu-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* メニューボタン */
.hrz-clb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.hrz-clb-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.hrz-clb-btn:disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

.hrz-clb-btn svg {
    width: 20px;
    height: 20px;
}

/* フルスクリーンアイコン切り替え */
.hrz-clb-btn .hrz-clb-icon-compress {
    display: none;
}

.hrz-clb-fullscreen .hrz-clb-btn .hrz-clb-icon-expand {
    display: none;
}

.hrz-clb-fullscreen .hrz-clb-btn .hrz-clb-icon-compress {
    display: block;
}

/* fitボタンアイコン切り替え（はみ出し時） */
.hrz-clb-btn .hrz-clb-icon-fit-contract {
    display: none;
}

.hrz-clb-btn.hrz-clb-overflow .hrz-clb-icon-fit-expand {
    display: none;
}

.hrz-clb-btn.hrz-clb-overflow .hrz-clb-icon-fit-contract {
    display: block;
}

/* ズームコントロール */
.hrz-clb-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.hrz-clb-zoom-bar {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.hrz-clb-zoom-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.hrz-clb-zoom-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.hrz-clb-zoom-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.hrz-clb-zoom-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 45px;
    text-align: center;
}

/* ============================================
   モバイル対応
   ============================================ */
@media (max-width: 768px) {
    .hrz-clb-menu {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        gap: 4px;
    }

    .hrz-clb-btn {
        width: 32px;
        height: 32px;
    }

    .hrz-clb-btn svg {
        width: 18px;
        height: 18px;
    }

    .hrz-clb-zoom-control {
        display: none;
    }

    .hrz-clb-handle-grip {
        width: 36px;
        height: 36px;
    }

    .hrz-clb-handle-grip svg {
        width: 18px;
        height: 18px;
    }

    .hrz-clb-label {
        font-size: 11px;
        padding: 3px 8px;
        bottom: 8px;
    }

    .hrz-clb-label-left {
        left: 8px;
    }

    .hrz-clb-label-right {
        right: 8px;
    }
}
