:root {
    --ict-primary: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    --ict-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --ict-danger: #ef4444;
    --ict-dark-bg: #1e293b;
    --ict-card-bg: #ffffff;
    --ict-text-main: #334155;
    --ict-text-muted: #64748b;
    --ict-border: #e2e8f0;
    --ict-radius: 12px;
    --ict-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.ict-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ict-text-main);
    max-width: 1100px;
    margin: 20px auto;
    padding: 15px;
}

/* Settings Bar */
.ict-settings-card {
    background: var(--ict-card-bg);
    border: 1px solid var(--ict-border);
    border-radius: var(--ict-radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--ict-shadow);
}

.ict-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: flex-end;
}

.ict-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ict-control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ict-text-main);
}

.ict-control-group label i {
    margin-right: 5px;
    color: #4f46e5;
}

.ict-control-group input[type="number"],
.ict-control-group select {
    padding: 10px;
    border: 1px solid var(--ict-border);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #f8fafc;
    outline: none;
    transition: border 0.2s ease;
}

.ict-control-group input:focus,
.ict-control-group select:focus {
    border-color: #3b82f6;
}

.ict-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ict-slider-wrapper input[type="range"] {
    flex: 1;
    accent-color: #4f46e5;
}

.ict-slider-wrapper span {
    font-weight: bold;
    min-width: 45px;
    text-align: right;
}

.ict-global-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

/* Drag & Drop Zone */
.ict-dropzone {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: var(--ict-radius);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.ict-dropzone:hover, .ict-dropzone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ict-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ict-upload-icon {
    font-size: 3.5rem;
    background: var(--ict-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.ict-dropzone h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #1e293b;
}

.ict-dropzone p {
    margin: 0 0 20px 0;
    color: var(--ict-text-muted);
    font-size: 0.9rem;
}

/* Buttons */
.ict-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s ease, opacity 0.2s ease;
    font-size: 0.9rem;
}

.ict-btn:active {
    transform: scale(0.98);
}

.ict-btn-primary {
    background: var(--ict-primary);
    color: white;
}

.ict-btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.ict-btn-secondary:hover {
    background: #cbd5e1;
}

.ict-btn-success {
    background: var(--ict-success);
    color: white;
}

.ict-btn-danger {
    background: var(--ict-danger);
    color: white;
}

/* Progress Bar */
.ict-progress-wrapper {
    background: var(--ict-card-bg);
    border: 1px solid var(--ict-border);
    padding: 15px;
    border-radius: var(--ict-radius);
    margin-bottom: 25px;
}

.ict-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.ict-progress-bar-bg {
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.ict-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--ict-primary);
    transition: width 0.2s ease;
}

/* Bulk Processing Info */
.ict-bulk-actions {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 15px 20px;
    border-radius: var(--ict-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.ict-bulk-actions h4 {
    margin: 0;
    color: #065f46;
}

/* Error Box */
.ict-error-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

/* Preview Cards Matrix Layout */
.ict-preview-queue {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ict-card {
    background: var(--ict-card-bg);
    border: 1px solid var(--ict-border);
    border-radius: var(--ict-radius);
    padding: 20px;
    box-shadow: var(--ict-shadow);
    display: grid;
    grid-template-columns: minmax(150px, 320px) 1fr;
    gap: 25px;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Visual Comparison Side by Side & Splitting Layer layout */
.ict-comparison-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ict-stage {
    position: relative;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 300px;
    border: 1px solid #e2e8f0;
}

.ict-stage img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

/* Meta Data Context Rows styling */
.ict-details-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ict-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--ict-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.ict-meta-header h4 {
    margin: 0;
    font-size: 1.1rem;
    word-break: break-all;
    max-width: 80%;
}

.ict-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.ict-stat-pill {
    background: #f8fafc;
    border: 1px solid var(--ict-border);
    padding: 10px;
    border-radius: 8px;
}

.ict-stat-pill.savings {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ict-stat-pill label {
    display: block;
    font-size: 0.75rem;
    color: var(--ict-text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
}

.ict-stat-pill span {
    font-size: 1rem;
    font-weight: bold;
}

.ict-stat-pill.savings span {
    color: #16a34a;
}

.ict-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Spinner Styles */
.ict-card-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: var(--ict-text-muted);
}

.ict-spinner {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
    color: #3b82f6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Custom Adjustments */
@media (max-width: 768px) {
    .ict-card {
        grid-template-columns: 1fr;
    }
    .ict-meta-header h4 {
        max-width: 100%;
    }
}

/* Dark Mode support layout enhancements */
@media (prefers-color-scheme: dark) {
    .ict-container-dark-preview { 
        /* Fallback layer references if user page framework forces layout rules */
    }
}