/* 圖片格式轉換器專屬樣式 */

/* Hero 區塊 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
}

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

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

.upload-container:hover,
.upload-container.dragover {
    border-color: var(--primary-color);
    background: rgba(247, 147, 26, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.upload-content h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.upload-hint {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-top: 1rem;
}

/* 設定區塊 */
.settings-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 3px 15px var(--shadow-color);
}

.settings-section h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.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: 1rem;
    transition: var(--transition);
    background: white;
}

.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: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

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

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

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

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

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

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

.images-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.images-stats {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.images-stats span {
    color: var(--text-color);
}

.images-stats strong {
    color: var(--primary-color);
    font-size: 1.2rem;
}

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

/* 圖片卡片 */
.image-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 3px 15px var(--shadow-color);
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.image-card:hover {
    box-shadow: 0 5px 25px var(--shadow-color);
    transform: translateY(-3px);
}

.image-preview-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.image-preview {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--light-gray);
    border-radius: 8px;
}

.image-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-status.pending {
    color: #856404;
    border: 2px solid #ffc107;
}

.image-status.converting {
    color: #004085;
    border: 2px solid #007bff;
}

.image-status.completed {
    color: #155724;
    border: 2px solid #28a745;
}

.image-status.error {
    color: #721c24;
    border: 2px solid #dc3545;
}

.image-info {
    margin-bottom: 1rem;
}

.image-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    word-break: break-all;
    font-size: 0.95rem;
}

.image-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.comparison-item {
    text-align: center;
}

.comparison-label {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    display: block;
    margin-bottom: 0.25rem;
}

.comparison-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.size-saved {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-top: 0.5rem;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.image-actions .btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

/* 按鈕樣式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: var(--light-gray);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(247, 147, 26, 0.4);
}

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

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

/* 功能特色 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 15px var(--shadow-color);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px var(--shadow-color);
}

.feature-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

/* 使用教學 */
.tutorial {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 3rem 0;
    box-shadow: 0 3px 15px var(--shadow-color);
}

.tutorial h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.tutorial h3 {
    color: var(--text-color);
    margin: 2rem 0 1rem;
    font-size: 1.3rem;
}

.tutorial ol,
.tutorial ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.tutorial li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-color);
}

.format-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.format-item {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.format-item h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.format-item ul {
    list-style: none;
    margin: 0;
}

.format-item li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* FAQ */
.faq {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 3rem 0;
    box-shadow: 0 3px 15px var(--shadow-color);
}

.faq h2 {
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-color);
    opacity: 0.85;
    line-height: 1.7;
}

/* 工具資訊 */
.tool-info {
    text-align: center;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    margin: 3rem 0;
}

.tool-info p {
    color: var(--text-color);
    line-height: 1.8;
}

.tool-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.tool-info a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

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

    .batch-actions .btn {
        width: 100%;
    }

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

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

    .format-guide {
        grid-template-columns: 1fr;
    }

    .image-comparison {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* 載入動畫 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* =============================================================================
   暗色主題支援
   ============================================================================= */

[data-theme="dark"] .settings-section,
[data-theme="dark"] .image-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .tutorial,
[data-theme="dark"] .faq {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .upload-container {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .upload-container:hover,
[data-theme="dark"] .upload-container.dragover {
    background: rgba(247, 147, 26, 0.1);
    border-color: var(--primary-color);
}

[data-theme="dark"] .setting-select,
[data-theme="dark"] .setting-input {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .setting-select:focus,
[data-theme="dark"] .setting-input:focus {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

[data-theme="dark"] .images-stats {
    background: #1a1a1a;
    border: 1px solid #333;
}

[data-theme="dark"] .image-preview {
    background: #2a2a2a;
}

[data-theme="dark"] .image-comparison {
    background: #2a2a2a;
}

[data-theme="dark"] .btn {
    background: #2a2a2a;
    color: #fff;
    border-color: #444;
}

[data-theme="dark"] .btn:hover {
    background: #333;
}

[data-theme="dark"] .format-item {
    background: #1a1a1a;
    border-left-color: var(--primary-color);
}

[data-theme="dark"] .tool-info {
    background: #1a1a1a;
}
