/* ============================================================
   PUTE Image Optimizer Enhanced Styles
   Used by optimizer tools (JPG, PNG, WEBP Optimizer).
   Extends image-converter-styles.css design system.
   ============================================================ */

/* --- Preset Buttons --- */
.putopt-presets {
    margin-bottom: 20px;
}

.putopt-presets-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.putopt-presets-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.putopt-preset-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 14px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.putopt-preset-btn:hover {
    border-color: #ff4d00;
    background: #fff5f0;
}

.putopt-preset-btn.active {
    border-color: #ff4d00;
    background: linear-gradient(135deg, #fff5f0 0%, #ffecd8 100%);
    box-shadow: 0 4px 16px rgba(255, 77, 0, 0.15);
}

.putopt-preset-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.putopt-preset-name {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1a1a2e;
    display: block;
}

.putopt-preset-desc {
    font-size: 0.66rem;
    font-weight: 600;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

.putopt-preset-btn.active .putopt-preset-name {
    color: #ff4d00;
}

.putopt-preset-btn.active .putopt-preset-desc {
    color: #c2410c;
}

/* --- Estimated Savings --- */
.putopt-estimated {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #d1fae5;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #059669;
    text-align: center;
    transition: all 0.3s ease;
}

.putopt-estimated .dashicons {
    font-size: 1rem;
    width: 18px;
    height: 18px;
}

.putopt-estimated.negative {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-color: #fde68a;
    color: #d97706;
}

.putopt-estimated.neutral {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #6b7280;
}

/* --- File Info Panel --- */
.putopt-file-info {
    margin-bottom: 20px;
}

.putopt-file-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: border-color 0.3s ease;
}

.putopt-file-info-card:hover {
    border-color: #ff4d00;
}

.putopt-file-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #fff5f0 0%, #ffecd8 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.putopt-file-info-icon .dashicons {
    font-size: 1.3rem;
    width: 24px;
    height: 24px;
    color: #ff4d00;
}

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

.putopt-file-info-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.putopt-file-info-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.putopt-file-info-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 6px;
}

.putopt-file-info-tag .dashicons {
    font-size: 0.85rem;
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.putopt-file-info-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.putopt-file-info-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* --- Optimization Summary --- */
.putopt-summary {
    margin-bottom: 28px;
    padding: 24px;
    background: linear-gradient(135deg, #f0f4ff 0%, #eef2ff 100%);
    border: 1.5px solid #dbeafe;
    border-radius: 14px;
}

.putopt-summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 16px;
}

.putopt-summary-title .dashicons {
    color: #4f46e5;
    font-size: 1.1rem;
}

.putopt-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.putopt-summary-stat {
    text-align: center;
    padding: 16px 12px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e0e7ff;
}

.putopt-summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #4f46e5;
    margin-bottom: 4px;
}

.putopt-summary-value.green {
    color: #059669;
}

.putopt-summary-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Comparison Bars --- */
.putopt-comparison {
    margin-bottom: 28px;
}

.putopt-comparison-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 16px;
}

.putopt-comparison-title .dashicons {
    color: #ff4d00;
    font-size: 1.1rem;
}

.putopt-comparison-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.putopt-comparison-item {
    padding: 14px 18px;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color 0.3s ease;
}

.putopt-comparison-item:hover {
    border-color: #ff4d00;
}

.putopt-comparison-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.putopt-comparison-bar-wrap {
    position: relative;
    height: 32px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.putopt-comparison-bar-original {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #e5e7eb;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.putopt-comparison-bar-optimized {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #34d399, #10b981);
    border-radius: 8px;
    transition: width 0.5s ease;
    z-index: 1;
}

.putopt-comparison-bar-labels {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 2;
}

.putopt-comparison-bar-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #374151;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.putopt-comparison-sizes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
}

.putopt-comparison-original-size {
    color: #6b7280;
}

.putopt-comparison-arrow {
    color: #9ca3af;
}

.putopt-comparison-optimized-size {
    color: #059669;
}

.putopt-comparison-reduction {
    display: inline-block;
    padding: 2px 10px;
    background: #d1fae5;
    color: #059669;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
}

.putopt-comparison-reduction.negative {
    background: #fef3c7;
    color: #d97706;
}

/* --- Re-optimize Button --- */
.putopt-reoptimize-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #ff4d00;
    background: #fff5f0;
    border: 1.5px solid #ffe0cc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-left: 8px;
}

.putopt-reoptimize-btn:hover {
    background: #ff4d00;
    color: #ffffff;
    border-color: #ff4d00;
}

.putopt-reoptimize-btn .dashicons {
    font-size: 0.9rem;
    width: 16px;
    height: 16px;
}

/* --- File Detail Enhanced --- */
.putopt-file-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px;
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .putopt-presets-row {
        flex-direction: column;
    }

    .putopt-preset-btn {
        min-width: auto;
    }

    .putopt-summary-grid {
        grid-template-columns: 1fr;
    }

    .putopt-file-info-meta {
        flex-direction: column;
        gap: 4px;
    }

    .putopt-comparison-sizes {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .putopt-file-detail-actions {
        flex-direction: column;
    }
}
