/* src/public/css/image-convert.css */

/* 💡 このページは表示・非表示を hidden 属性で切り替えていますが、
       下のほうで箱に display: flex などを指定しているため、そのままだと
       「hidden を付けたのに消えない」状態になります（author の display 指定が
       ブラウザ既定の display:none に勝つためです）。ここで打ち消しておきます。 */
[hidden] {
    display: none !important;
}

#imgconv-app {
    max-width: 720px;
    margin: 24px auto 0;
}

/* ---------- ① アップロード欄 ---------- */

.imgconv-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 44px 20px;
    text-align: center;
    background: #f8fafc;
    transition: border-color 0.2s, background-color 0.2s;
}

.imgconv-upload-box.is-dragover {
    border-color: #f39c12;
    background: #fdf6e2;
}

.btn-upload {
    background: #1e3c72;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(30, 60, 114, 0.2);
    border: none;
}

.imgconv-upload-tip {
    font-size: 0.8rem;
    color: #64748b;
    margin: 16px 0 0;
}

/* ---------- ② 変換の設定 ---------- */

.imgconv-editor {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.imgconv-source {
    text-align: center;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px;
}

.imgconv-source img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.imgconv-source-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: #475569;
}

.imgconv-source-meta span:last-child {
    font-weight: bold;
}

.imgconv-reselect-btn {
    margin-top: 12px;
    background: none;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.imgconv-settings {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.imgconv-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.imgconv-label {
    font-weight: bold;
    color: #1e3c72;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.imgconv-quality-value {
    background: #e8f0fe;
    color: #1e3c72;
    border-radius: 50px;
    padding: 2px 10px;
    font-size: 0.85rem;
}

.imgconv-select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #e1e5ea;
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    color: #1e293b;
}

.imgconv-range {
    width: 100%;
    accent-color: #1e3c72;
}

.imgconv-field-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.imgconv-convert-btn {
    width: 100%;
    background: #f39c12;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.25);
}

.imgconv-convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- 進捗表示 ---------- */

.imgconv-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
    font-size: 0.9rem;
}

.imgconv-progress p {
    margin: 0;
}

.imgconv-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e1e5ea;
    border-top-color: #1e3c72;
    border-radius: 50%;
    animation: imgconv-spin 0.8s linear infinite;
}

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

/* ---------- ③ 変換結果 ---------- */

.imgconv-result {
    margin-top: 28px;
    border: 1px solid #e1e5ea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.imgconv-result-head {
    padding: 14px 18px;
    background: #f4f7fb;
}

.imgconv-result-label {
    font-weight: bold;
    color: #1e3c72;
}

.imgconv-result-body {
    padding: 18px;
    text-align: center;
}

.imgconv-result-body img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.imgconv-size-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
}

.imgconv-size-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.imgconv-size-caption {
    font-size: 0.75rem;
    color: #64748b;
}

.imgconv-size-item strong {
    font-size: 1.05rem;
    color: #1e293b;
}

.imgconv-size-arrow {
    color: #94a3b8;
}

.imgconv-size-diff {
    margin: 10px 0 0;
    font-size: 0.9rem;
    font-weight: bold;
    color: #64748b;
}

.imgconv-size-diff.is-smaller { color: #15803d; }
.imgconv-size-diff.is-larger  { color: #b45309; }

.imgconv-download-btn {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1e3c72;
    color: #fff;
    border-radius: 50px;
    padding: 13px 32px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(30, 60, 114, 0.2);
}

/* ---------- トースト（お知らせ表示） ---------- */

.toast-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast-msg {
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}
