/**
 * Base64画像変換ツール スタイル
 * Base64 <-> 画像 双方向変換
 *
 * @package Zipper
 */

/* タブナビゲーション */
.b64img-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e8e4dc;
}

.b64img-tab {
    flex: 1;
    padding: 14px 20px;
    background: #fff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.b64img-tab:not(:last-child) {
    border-right: 2px solid #e8e4dc;
}

.b64img-tab:hover {
    background: #f5f3f0;
}

.b64img-tab.active {
    background: #d4af37;
    color: #fff;
}

.b64img-tab i {
    font-size: 16px;
}

/* タブパネル */
.b64img-panel {
    display: none;
}

.b64img-panel.active {
    display: block;
}

/* 入力エリア */
.b64img-input-section {
    margin-bottom: 24px;
}

.b64img-input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
}

.b64img-textarea {
    width: 100%;
    min-height: 150px;
    padding: 14px 16px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 2px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    color: #2d2a26;
    resize: vertical;
    transition: border-color 0.2s ease;
    line-height: 1.5;
}

.b64img-textarea:focus {
    outline: none;
    border-color: #d4af37;
}

.b64img-textarea::placeholder {
    color: #a19d98;
}

/* 入力統計 */
.b64img-input-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: #5f5a56;
}

.b64img-input-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ドロップゾーン */
.b64img-dropzone {
    border: 2px dashed #d4af37;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    background: #faf9f7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b64img-dropzone:hover,
.b64img-dropzone.dragover {
    background: #f5f0e6;
    border-color: #c9a22e;
}

.b64img-dropzone-icon {
    font-size: 48px;
    color: #d4af37;
    margin-bottom: 16px;
}

.b64img-dropzone-text {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
}

.b64img-dropzone-hint {
    font-size: 14px;
    color: #5f5a56;
}

.b64img-dropzone-formats {
    font-size: 12px;
    color: #8b8783;
    margin-top: 12px;
}

.b64img-dropzone input[type="file"] {
    display: none;
}

/* プレビューエリア */
.b64img-preview-section {
    margin-top: 24px;
    padding: 24px;
    background: #faf9f7;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
}

.b64img-preview-section.hidden {
    display: none;
}

.b64img-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.b64img-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 8px;
}

.b64img-preview-title i {
    color: #d4af37;
}

/* 画像プレビューコンテナ */
.b64img-preview-container {
    background: repeating-conic-gradient(#e8e4dc 0% 25%, #fff 0% 50%) 50% / 20px 20px;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
}

.b64img-preview-container img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 画像情報グリッド */
.b64img-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.b64img-info-item {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e8e4dc;
}

.b64img-info-label {
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 4px;
}

.b64img-info-value {
    font-size: 16px;
    font-weight: 700;
    color: #d4af37;
}

/* Base64出力エリア */
.b64img-output-section {
    margin-top: 24px;
    padding: 24px;
    background: #faf9f7;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
}

.b64img-output-section.hidden {
    display: none;
}

.b64img-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.b64img-output-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
}

.b64img-output-options {
    display: flex;
    gap: 16px;
    align-items: center;
}

.b64img-output-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #5f5a56;
    cursor: pointer;
}

.b64img-output-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
}

.b64img-output-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px 16px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 2px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    color: #2d2a26;
    resize: vertical;
    line-height: 1.5;
    word-break: break-all;
}

.b64img-output-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: #5f5a56;
}

/* アクションボタン */
.b64img-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* エラーメッセージ */
.b64img-error {
    display: none;
    padding: 14px 16px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-left: 4px solid #c53030;
    border-radius: 8px;
    color: #c53030;
    font-size: 14px;
    margin-top: 16px;
}

.b64img-error.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.b64img-error i {
    font-size: 18px;
}

/* 選択されたファイル情報 */
.b64img-selected-file {
    display: none;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    color: #166534;
}

.b64img-selected-file.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.b64img-selected-file i {
    font-size: 18px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .b64img-tabs {
        flex-direction: column;
    }

    .b64img-tab:not(:last-child) {
        border-right: none;
        border-bottom: 2px solid #e8e4dc;
    }

    .b64img-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .b64img-dropzone {
        padding: 32px 16px;
    }

    .b64img-dropzone-icon {
        font-size: 36px;
    }

    .b64img-actions {
        flex-direction: column;
    }

    .b64img-actions .tool-btn {
        width: 100%;
    }

    .b64img-output-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .b64img-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .b64img-info-value {
        font-size: 14px;
    }

    .b64img-preview-container {
        min-height: 150px;
    }
}
