:root {
    --iot-primary: linear-gradient(135deg, #4f46e5, #06b6d4);
    --iot-success: #10b981;
    --iot-danger: #ef4444;
    --iot-bg-dark: #0f172a;
    --iot-panel-dark: #1e293b;
    --iot-text-main: #f8fafc;
    --iot-text-muted: #94a3b8;
    --iot-border: #334155;
}

.iot-wrapper {
    background-color: var(--iot-bg-dark);
    color: var(--iot-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    max-width: 1200px;
    margin: 20px auto;
}

.iot-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--iot-border);
    padding-bottom: 20px;
}

.iot-header h2 {
    color: #fff;
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    background: var(--iot-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.iot-header p {
    color: var(--iot-text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.iot-dashboard {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.iot-panel {
    background: var(--iot-panel-dark);
    border: 1px solid var(--iot-border);
    border-radius: 10px;
    padding: 20px;
}

.iot-config-sidebar {
    flex: 1;
    min-width: 280px;
}

.iot-main-workspace {
    flex: 3;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.iot-config-sidebar h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 1px solid var(--iot-border);
    padding-bottom: 10px;
}

.iot-control-group {
    margin-bottom: 20px;
}

.iot-control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--iot-text-main);
    font-size: 0.95rem;
}

.iot-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iot-control-group select,
.iot-control-group input[type="range"] {
    width: 100%;
    padding: 10px;
    background: #0f172a;
    border: 1px solid var(--iot-border);
    border-radius: 6px;
    color: #fff;
    box-sizing: border-box;
}

.iot-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 12px;
}

/* UI Buttons styling */
.iot-btn {
    background: var(--iot-primary);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease-in-out;
}

.iot-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.iot-btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.iot-btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.iot-btn-success { background: linear-gradient(135deg, #10b981, #047857); }
.iot-btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.iot-btn:disabled {
    background: #475569 !important;
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* Drag and Drop Box layout styling */
.iot-dropzone {
    border: 2px dashed #4f46e5;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: background 0.3s, border-color 0.3s;
    cursor: pointer;
}

.iot-dropzone.dragover {
    background: rgba(6, 182, 212, 0.15);
    border-color: #06b6d4;
}

.iot-upload-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    background: var(--iot-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.iot-dz-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.iot-dz-subtitle {
    color: var(--iot-text-muted);
    font-size: 0.9rem;
    margin: 0 0 20px 0;
}

/* Bulk actions strip */
.iot-bulk-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    background: #0f172a;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--iot-border);
}

/* Progress Bar indicator markup */
.iot-progress-container {
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--iot-border);
}

.iot-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.iot-progress-bar-bg {
    background: #334155;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.iot-progress-bar-fill {
    background: var(--iot-primary);
    width: 0%;
    height: 100%;
    transition: width 0.2s ease;
}

/* UI Row Processing Items */
.iot-queue-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.iot-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f172a;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid var(--iot-border);
    gap: 15px;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.iot-qi-preview-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 2;
    min-width: 200px;
}

.iot-qi-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background: #334155;
    border: 1px solid var(--iot-border);
}

.iot-qi-details h5 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iot-qi-details p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--iot-text-muted);
}

.iot-qi-meta-stats {
    flex: 2;
    font-size: 0.85rem;
    color: var(--iot-text-muted);
    text-align: right;
    min-width: 150px;
}

.iot-qi-meta-stats .saved-highlight {
    color: var(--iot-success);
    font-weight: bold;
    display: block;
}

.iot-qi-actions {
    display: flex;
    gap: 8px;
}

/* Window Modal Framework Container Rules */
.iot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.iot-modal-content {
    background: var(--iot-bg-dark);
    border: 1px solid var(--iot-border);
    border-radius: 12px;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.iot-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid var(--iot-border);
    background: var(--iot-panel-dark);
}

.iot-modal-header h3 { margin: 0; font-size: 1.3rem; }
.iot-modal-close { font-size: 2rem; cursor: pointer; color: var(--iot-text-muted); }
.iot-modal-close:hover { color: #fff; }

.iot-modal-body { padding: 25px; }

/* Dashboard Cards setup definitions */
.iot-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.iot-stat-card {
    background: var(--iot-panel-dark);
    border: 1px solid var(--iot-border);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.iot-stat-card .iot-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--iot-text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.iot-stat-card .iot-stat-value {
    font-size: 1.4rem;
    font-weight: bold;
}

.iot-stat-highlight {
    border-color: var(--iot-success);
    background: rgba(16, 185, 129, 0.05);
}
.iot-stat-highlight .iot-stat-value { color: var(--iot-success); }

/* Double Panel Image Compare Engine Workspace Setup */
.iot-analysis-row {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.iot-preview-comparison-box {
    flex: 2;
    min-width: 320px;
}

.iot-seo-panel {
    flex: 1;
    min-width: 280px;
    background: var(--iot-panel-dark);
    border: 1px solid var(--iot-border);
    padding: 20px;
    border-radius: 8px;
}

/* Image Comparison Slider Engine Style Sheets */
.iot-split-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid var(--iot-border);
    user-select: none;
}

.iot-split-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#iot-split-resizable {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    overflow: hidden;
}

#iot-split-resizable img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: none;
}

#iot-split-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #06b6d4;
    left: 50%;
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
}

#iot-split-handle::after {
    content: "\f337";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: #06b6d4;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.iot-preview-controls-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

/* SEO Indicator Engine Circles styles */
.iot-seo-score-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.iot-seo-radial {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 5px solid var(--iot-success);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
}

#iot-seo-score-num { font-size: 1.7rem; font-weight: bold; color: var(--iot-success); }
.iot-seo-label { font-size: 0.65rem; text-transform: uppercase; color: var(--iot-text-muted); }

.iot-seo-metrics p {
    margin: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 6px;
}

.iot-seo-suggestions h5 { margin: 15px 0 8px 0; font-size: 0.95rem; }
.iot-seo-suggestions ul { margin: 0; padding-left: 20px; font-size: 0.85rem; color: var(--iot-text-muted); }
.iot-seo-suggestions li { margin-bottom: 6px; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .iot-dashboard { flex-direction: column; }
    .iot-config-sidebar, .iot-main-workspace { width: 100%; }
    .iot-analysis-row { flex-direction: column; }
    .iot-split-wrapper { height: 260px; }
}