/* ===== Image Converter - Modern Styles ===== */
.icvt-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.icvt-main { min-width: 0; }
.icvt-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 18px; padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.icvt-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Upload area */
.icvt-upload {
  padding: 60px 20px; text-align: center; border: 2px dashed var(--border);
  border-radius: 16px; background: var(--bg-soft); cursor: pointer; transition: all 0.2s;
}
.icvt-upload:hover, .icvt-upload.dragover { border-color: var(--primary); background: var(--primary-50); transform: translateY(-2px); }
.icvt-upload-icon { font-size: 52px; color: var(--primary); margin-bottom: 16px; }
.icvt-upload h3 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.icvt-upload p { font-size: 13px; color: var(--text-muted); }
body[data-theme="dark"] .icvt-upload { background: var(--bg-muted); border-color: var(--border); }
body[data-theme="dark"] .icvt-upload:hover, body[data-theme="dark"] .icvt-upload.dragover { background: rgba(99,102,241,0.12); }

/* Preview + info row */
.icvt-preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.icvt-preview-box {
  background: var(--bg-muted); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.icvt-preview-box img { max-width: 100%; max-height: 280px; border-radius: 8px; object-fit: contain; }
.icvt-remove-btn {
  padding: 8px 14px; background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border-light); border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.icvt-remove-btn:hover { color: var(--danger); border-color: var(--danger); }
body[data-theme="dark"] .icvt-preview-box { background: var(--bg-soft); }

.icvt-info-box {
  background: var(--bg-soft); border-radius: 14px; padding: 18px 20px;
  border: 1px solid var(--border-light);
}
.icvt-info-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.icvt-info-title::before { content: ''; width: 4px; height: 16px; background: linear-gradient(180deg,var(--primary),#8b5cf6); border-radius: 4px; display: inline-block; }
.icvt-info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.icvt-info-row:last-child { border-bottom: none; }
.icvt-info-label { font-weight: 600; color: var(--text-secondary); }
.icvt-info-value { font-weight: 500; color: var(--text); }
body[data-theme="dark"] .icvt-info-box { background: var(--bg-muted); border-color: var(--border); }

/* Format selector */
.icvt-format-section { margin-bottom: 16px; }
.icvt-section-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.icvt-format-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.icvt-format-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; background: var(--bg-soft); border: 2px solid var(--border-light);
  border-radius: 12px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-secondary); transition: all 0.2s;
}
.icvt-format-option:hover { border-color: var(--primary-100); background: var(--primary-50); }
.icvt-format-option.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,0.08); }
.icvt-format-option i { font-size: 20px; color: var(--text-muted); }
.icvt-format-option.active i { color: var(--primary); }
body[data-theme="dark"] .icvt-format-option { background: var(--bg-muted); border-color: var(--border); }
body[data-theme="dark"] .icvt-format-option.active { background: rgba(99,102,241,0.15); }

/* Convert button */
.icvt-convert-btn {
  width: 100%; padding: 16px; background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.25s; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 14px rgba(79,70,229,0.3); margin-bottom: 16px;
}
.icvt-convert-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,70,229,0.4); }

/* Result */
.icvt-result {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: #ecfdf5; border: 1px solid #a7f3d0;
  border-radius: 12px; margin-bottom: 16px;
}
.icvt-result-icon { font-size: 28px; color: #10b981; flex-shrink: 0; }
.icvt-result-text { flex: 1; font-size: 14px; color: var(--text-secondary); }
.icvt-result-text strong { display: block; color: #065f46; margin-bottom: 2px; }
.icvt-download-btn {
  padding: 10px 20px; background: #10b981; color: #fff; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.icvt-download-btn:hover { background: #059669; transform: translateY(-1px); }
body[data-theme="dark"] .icvt-result { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); }
body[data-theme="dark"] .icvt-result-text strong { color: #6ee7b7; }

/* Error */
.icvt-error { padding: 14px 18px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; color: #dc2626; font-size: 14px; font-weight: 500; margin-top: 16px; }
body[data-theme="dark"] .icvt-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

/* SEO */
.icvt-seo { margin-top: 24px; padding: 20px 24px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.icvt-seo p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* Sidebar (shared) */
.sidebar-section { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.sidebar-header { text-align: center; padding: 28px 20px !important; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%) !important; border-color: transparent !important; }
.sidebar-header h1 { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.sidebar-header p { font-size: 0.82rem; color: rgba(255,255,255,0.85); }
body[data-theme="dark"] .sidebar-header { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%) !important; }
.sidebar-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.sidebar-title i { color: var(--primary); font-size: 0.9rem; }
.sidebar-tools { display: flex; flex-direction: column; gap: 8px; }
.sidebar-tool { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: all 0.2s; text-decoration: none; background: var(--bg-soft); }
.sidebar-tool:hover { background: var(--primary-50); transform: translateX(3px); }
.sidebar-tool-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 16px; flex-shrink: 0; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; }
.sidebar-tool-info { flex: 1; min-width: 0; }
.sidebar-tool-name { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sidebar-tool-desc { font-size: 0.78rem; color: var(--text-muted); }
.ad-placeholder { width: 300px; height: 250px; flex-shrink: 0; margin: 0 auto; background: var(--bg-card); border: 2px dashed var(--border); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }
.ad-placeholder .ad-icon { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 10px; opacity: 0.4; }
.ad-placeholder .ad-label { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.ad-placeholder .ad-size { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }

/* Dark mode */
body[data-theme="dark"] .sidebar-section { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .sidebar-tool { background: var(--bg-muted); }
body[data-theme="dark"] .sidebar-tool:hover { background: var(--primary-50); }
body[data-theme="dark"] .ad-placeholder { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .icvt-seo { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .icvt-card { background: var(--bg-card); border-color: var(--border); }

/* Responsive */
@media (max-width: 1024px) { .icvt-layout { grid-template-columns: 1fr 280px; gap: 20px; } }
@media (max-width: 860px) { .icvt-layout { grid-template-columns: 1fr; } .icvt-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (max-width: 768px) {
  .icvt-preview-row { grid-template-columns: 1fr; }
  .icvt-format-options { grid-template-columns: repeat(2, 1fr); }
  .icvt-card { padding: 20px; }
  .icvt-upload { padding: 40px 16px; }
}
@media (max-width: 640px) { .icvt-sidebar { grid-template-columns: 1fr; } }