/* 画像変換・圧縮ツール - スタイル */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0b10;
    color: #e0e0e8;
    min-height: 100vh;
}

#app {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ナビバー */
.tool-nav {
    margin-bottom: 1rem;
}

.back-link {
    color: #7c7ff2;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

.back-link:hover {
    color: #a78bfa;
}

/* ヘッダー */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #7c7ff2, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tool-subtitle {
    color: #6b6f80;
    font-size: 0.85rem;
}

/* ドロップゾーン */
.drop-zone {
    border: 2px dashed rgba(124, 127, 242, 0.3);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: rgba(30, 32, 48, 0.4);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #7c7ff2;
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 30px rgba(124, 127, 242, 0.1);
}

.drop-zone.drag-over {
    transform: scale(1.01);
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a0a4b8;
    margin-bottom: 0.5rem;
}

.drop-sub {
    color: #6b6f80;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.file-label {
    color: #7c7ff2;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.file-label:hover {
    color: #a78bfa;
}

.drop-hint {
    color: #4a4d5e;
    font-size: 0.75rem;
}

/* 設定パネル */
.settings-panel {
    background: rgba(30, 32, 48, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.settings-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 180px;
}

.setting-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b8fa0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-group select,
.setting-group input[type="number"] {
    background: #12131a;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #e0e0e8;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-group select:focus,
.setting-group input:focus {
    border-color: #7c7ff2;
    box-shadow: 0 0 0 3px rgba(124, 127, 242, 0.1);
}

/* スライダー */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 3px;
    outline: none;
    margin: 0.3rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #7c7ff2;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(124, 127, 242, 0.4);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #7c7ff2;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.quality-hints {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #4a4d5e;
}

/* ボタン */
.settings-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #7c7ff2, #6366f1);
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    color: #f87171;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(239, 68, 68, 0.18);
}

.btn-download {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: #4ade80;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: rgba(34, 197, 94, 0.2);
}

/* ファイルリスト */
.file-list {
    margin: 1rem 0;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.file-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #a78bfa;
}

.total-size {
    font-size: 0.78rem;
    color: #6b6f80;
}

.file-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(30, 32, 48, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    transition: all 0.2s;
}

.file-item:hover {
    border-color: rgba(99, 102, 241, 0.25);
}

.file-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #12131a;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.72rem;
    color: #6b6f80;
    margin-top: 0.15rem;
}

.file-remove {
    background: none;
    border: none;
    color: #4a4d5e;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.file-remove:hover {
    color: #f87171;
}

/* プログレスバー */
.file-progress {
    width: 100%;
    height: 3px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7c7ff2, #a78bfa);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s;
}

/* 結果 */
.results {
    margin: 1.5rem 0;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.results-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4ade80;
}

.results-summary {
    flex: 1;
    font-size: 0.78rem;
    color: #6b6f80;
}

.result-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(30, 32, 48, 0.6);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
}

.result-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #12131a;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    font-size: 0.72rem;
    margin-top: 0.15rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.result-savings {
    color: #4ade80;
    font-weight: 600;
}

.result-size {
    color: #6b6f80;
}

/* フッター */
.tool-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    margin-top: 2rem;
}

.tool-footer p {
    color: #4a4d5e;
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.footer-link a {
    color: #7c7ff2;
    text-decoration: none;
}

.footer-link a:hover {
    color: #a78bfa;
}

/* 非表示ユーティリティ */
.hidden {
    display: none !important;
}

/* レスポンシブ */
@media (max-width: 640px) {
    .tool-title {
        font-size: 1.4rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }
    
    .drop-icon {
        font-size: 2.5rem;
    }

    .settings-row {
        flex-direction: column;
        gap: 1rem;
    }

    .setting-group {
        min-width: unset;
    }

    .file-item, .result-item {
        flex-wrap: wrap;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
