/* 1. Các biến CSS (Tham khảo từ crop-tool.css) */
:root {
  --bg: #f0f4ff;
  --card: #fff;
  --primary: #059669; /* Xanh lá đậm (Success/Action) */
  --secondary: #64748b; /* Xám xanh (Reset/Neutral) */
  --thirst: #0e7490; /* Xanh đậm hơn (Alternative/WEBP) */
  --muted: #6b7280;
  --accent: #f59e0b; /* Màu nhấn phụ */
  --text: #111827;
}

/* Base Style cho Container nhúng (đã thêm prefix) */
.resize-tool-container {
  /* Đặt font và màu nền cho container chính */
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}
.post-thumbnail {
  display: none;
}
.resize-tool-container .wrap {
  max-width: 1550px; /* Giữ lại max-width 1000px của code cũ */
  margin:0 auto;
  padding:0px; /* Giữ lại padding 14px của code cũ */
}

/* Đã loại bỏ style cho header, h1, p.lead của phần tool chính vì đã xóa khỏi HTML nhúng */

/* Panel Layout */
.resize-tool-container .panel{
 /* background: var(--card); /* Giữ lại màu nền thẻ card */
 /* border-radius:16px; /* Giữ lại bo góc */
  padding:0px; /* Giữ lại padding */
  /*box-shadow: 0 6px 20px rgba(16,24,40,0.08); /* Giữ lại box-shadow */
  display: flex;
  flex-direction: column; 
  gap: 16px;
}

.resize-tool-container .controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:12px;
  align-items:center;
}

/* === BUTTON STYLING (Theo mẫu crop-tool.css) === */

/* Nút chính (Resize / Tải PNG) - Màu Xanh lá đậm */
.resize-tool-container .btn{
  background: var(--primary); /* #059669 */
  color: #fff; 
  padding:10px 16px; /* Kích thước lớn hơn */
  border-radius:10px;
  border:none;
  cursor:pointer;
  font-size:16px; /* Kích thước chữ chuẩn SEO cho button */
  font-weight: 600;
  transition: background 0.2s;
  text-decoration: none;
}
.resize-tool-container .btn:hover{
  background: #047857; /* Hơi tối hơn khi hover */
}

/* Nút thứ cấp (Reset / Tải JPG / Kích thước định sẵn) - Màu Xám Xanh */
.resize-tool-container .btn.secondary{
  background: var(--secondary); /* #64748b */
  color: #fff; 
  padding:10px 16px; /* Giữ kích thước lớn */
}
.resize-tool-container .btn.secondary:hover{
  background: #475569; /* Hơi tối hơn khi hover */
}

/* Nút thứ ba (Tải WEBP) - Màu Xanh đậm */
.resize-tool-container .btn.thirst{
  background: var(--thirst); /* #0e7490 */
  color: #fff; 
  padding:10px 16px; /* Giữ kích thước lớn */
}
.resize-tool-container .btn.thirst:hover{
  background: #0f7690; 
}

/* Nút chọn file (Chọn ảnh) - Theo mẫu crop-tool.css */
.resize-tool-container .file-label{
  background: #fff; /* Nền trắng */
  border: 1px solid var(--primary); /* Border xanh lá để nổi bật */
  padding:10px 16px;
  border-radius:10px;
  cursor:pointer;
  font-size:16px;
  font-weight: 600;
  color: var(--primary); /* Chữ xanh lá */
  margin: 0;
  transition: background 0.2s, color 0.2s;
}
.resize-tool-container .file-label:hover{
    background: var(--primary); 
    color: #fff; /* Đảo ngược màu khi hover */
}
/* === KẾT THÚC BUTTON STYLING === */

.resize-tool-container input[type="file"]{display:none;}

.resize-tool-container select.small, 
.resize-tool-container input[type="number"], 
.resize-tool-container input[type="text"]{
  /* Điều chỉnh theo mẫu mới */
  padding:8px 10px; 
  border-radius:8px; 
  border: 1px solid #d1d5db;
  font-size:15px; /* Tăng kích thước font input */
  background: #fff;
}
.resize-tool-container input[type="number"]{width:100px;} /* Giữ lại width */


.resize-tool-container select.small{
  appearance: none;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat right 8px center;
  background-size: 12px;
  padding-right: 28px;
}

/* CSS cho Resize Options */
.resize-tool-container .resize-options {
  /* Thay đổi màu border và background theo theme mới */
  border: 0px solid var(--secondary);
  padding: 12px; /* Tăng padding */
  border-radius: 8px;
 /* background: #f9faff; /* Giữ lại background nhạt */
}
.resize-tool-container .resize-options h3 {
  font-size: 18px; /* Tăng kích thước h3 */
  margin: 0 0 8px 0;
  color: var(--primary);
}
.resize-tool-container .resize-options .group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px; /* Tăng gap */
  margin-bottom: 8px;
}
.resize-tool-container .resize-options label {
  font-size: 15px; /* Tăng kích thước font label */
  font-weight: 600;
}
.resize-tool-container .aspect-lock {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: normal !important;
}
.resize-tool-container .aspect-lock input[type="checkbox"] {
  margin-right: 5px;
}
.resize-tool-container .preset-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px; /* Tăng gap */
}
.resize-tool-container .preset-sizes .btn {
  padding: 6px 12px; /* Điều chỉnh padding cho button preset */
  font-size: 14px; /* Điều chỉnh font size cho button preset */
}


/* ẢNH GỐC: MAX HEIGHT 400px */
.resize-tool-container .canvas-wrap{
  width:100%;
  max-width:100%;
  background:#000;
  border-radius:12px;
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  max-height: 400px !important;
}

.resize-tool-container canvas{
  display:block;
  width:100%; 
  height:100%; 
}

.resize-tool-container .hint{
  position:absolute;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  background:rgba(0,0,0,0.6);
  color:#fff;
  padding:8px 16px;
  border-radius:8px;
  font-size:15px; /* Tăng font size hint */
  white-space: nowrap;
}

/* PREVIEW: MAX HEIGHT 400px và ẩn cuộn */
.resize-tool-container .preview{
  display:flex;
  flex-direction:column;
  gap:10px;
  width:100%;
  max-height: 400px;
  height: 400px; /* Thêm height cố định theo mẫu */
  overflow: hidden; 
  border-radius:12px;
  /*background:#fff;*/
  padding:0px;
  /* border: 0px solid #f3f4f6; */ /* Bỏ border ngoài theo mẫu */
  align-items: center; 
  justify-content: center; 
/*  box-shadow:0 4px 18px rgba(0,0,0,0.05); /* Giữ lại box-shadow nhẹ */
}

/* Đảm bảo ảnh preview không vượt quá width/height và giữ tỷ lệ */
.resize-tool-container .preview img{
  max-width: 100%;
  max-height: 100%; 
  width: auto; 
  height: auto; 
  border-radius:8px; 
  border: 1px solid #e5e7eb;
}

.resize-tool-container .info{
  font-size:15px; /* Tăng font size info */
  color: var(--muted);
}

.resize-tool-container footer{
  margin-top:16px;
  font-size:14px; /* Tăng font size footer */
  color: var(--muted);
  text-align:center;
}

.resize-tool-container .action-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
  justify-content:center;
}

@media(min-width:800px){
  .resize-tool-container .panel{
    flex-direction: row; 
    gap: 20px;
    padding: 16px; /* Điều chỉnh lại padding panel cho desktop */
  }
  .resize-tool-container .left-panel{
    flex:1;
  }
  .resize-tool-container .right-panel{
    flex:1;
  }
  .resize-tool-container .preview{
    margin-top:0;
  }
}

/* Minimal, SEO-friendly article styling */

.resize-tool-container .container{
  max-width:900px;
  padding:28px;
  margin:0 auto;
}
.resize-tool-container .container header{
  margin-bottom:18px;
}
.resize-tool-container .container h2{
  font-size:24px; /* Tăng kích thước H2 article */
  margin:12px 0;
  color: var(--primary); /* Áp dụng primary color */
}
.resize-tool-container .container .lead{
  color:var(--muted);
  font-size:16px;
  margin:0 0 18px;
}
.resize-tool-container .container article img{
  max-width:100%;
  height:auto;
  border-radius:6px;
}
.resize-tool-container .container .section{
  margin-bottom:18px;
}
.resize-tool-container .container ul{
  margin-left:20px;
}
.resize-tool-container .container pre, 
.resize-tool-container .container code{
  background:#f3f4f6;
  padding:8px;
  border-radius:6px;
  overflow:auto;
}
.resize-tool-container .container .cta{
  display:inline-block;
  background:var(--accent);
  color:#fff;
  padding:10px 14px;
  border-radius:8px;
  text-decoration:none;
  font-size:16px; /* Tăng font size CTA */
}