/* 圖片壓縮工具專用樣式 */

/* 上傳區塊 */
.upload-section {
    margin-bottom: 2rem;
}

.upload-container {
    padding: 3rem 2rem;
    background: var(--light-gray);
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-container.drag-over {
    border-color: var(--primary-color);
    background: rgba(247, 147, 26, 0.05);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 4rem;
    opacity: 0.7;
}

.upload-container h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.upload-container p {
    margin: 0.5rem 0;
    color: var(--text-color);
    opacity: 0.7;
}

.upload-hint {
    font-size: 0.9rem;
    opacity: 0.6 !important;
}

/* 設定區塊 */
.settings-section {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--card-bg, white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.setting-select,
.setting-input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--card-bg, white);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.setting-select:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
}

.setting-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

.setting-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.setting-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

.setting-hint {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* 批次操作按鈕 */
.batch-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 圖片列表區塊 */
.images-section {
    margin-bottom: 2rem;
}

.images-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* 圖片卡片 */
.image-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.image-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.image-preview {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--card-bg, white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.image-status.processing {
    background: #ffc107;
    color: #856404;
}

.image-status.completed {
    background: #28a745;
    color: white;
}

.image-status.error {
    background: #dc3545;
    color: white;
}

.image-info {
    padding: 1rem 1.5rem;
}

.image-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-color);
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    opacity: 0.7;
    font-size: 0.8rem;
}

.detail-value {
    font-weight: 600;
    color: var(--primary-color);
}

.detail-value.success {
    color: #28a745;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem 1rem 1.5rem;
}

.btn-small {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    background: var(--card-bg, white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

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

/* 比較區塊 */
.comparison-section {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 12px;
}

.comparison-section h2 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg, white);
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.comparison-table thead th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
}

.comparison-table tbody tr:nth-child(even) {
    background: var(--light-gray);
}

.comparison-table tbody tr:hover {
    background: rgba(247, 147, 26, 0.05);
}

/* 按鈕樣式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 147, 26, 0.4);
}

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

.btn:not(.btn-primary) {
    background: var(--card-bg, white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn:not(.btn-primary):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    font-size: 1.1rem;
}

/* 處理動畫 */
@keyframes processing {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.processing {
    animation: processing 1.5s ease-in-out infinite;
}

/* 響應式設計 */
@media (max-width: 968px) {
    .images-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .upload-container {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-container h3 {
        font-size: 1.25rem;
    }

    .settings-section {
        padding: 1.5rem;
    }

    .images-container {
        grid-template-columns: 1fr;
    }

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

    .btn {
        width: 100%;
        justify-content: center;
    }

    .comparison-table {
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .upload-container {
        padding: 1.5rem 1rem;
    }

    .settings-section,
    .comparison-section {
        padding: 1rem;
    }

    .image-info {
        padding: 0.75rem 1rem;
    }

    .image-actions {
        padding: 0 1rem 0.75rem 1rem;
        flex-direction: column;
    }

    .btn-small {
        width: 100%;
    }

    .comparison-table {
        font-size: 0.8rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
}