/*
 * File CSS: URL Encoder/Decoder Tool Styles
 * Tham chiếu từ crop-tool.css và bổ sung các quy tắc cho công cụ URL
 * Wrapper: .crop-tool-wrap để tránh xung đột với Theme
 */

/* 1. Các biến CSS (Sử dụng màu nền ấn tượng) */
: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;
}

.post-thumbnail {
  display: none;
}

/* === WRAPPER CHÍNH === */
.crop-tool-wrap {
    /* Đặ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;
}

.crop-tool-wrap .wrap {
 /* max-width: 1200px;*/
  margin:0 auto;
  padding:20px 15px;
}

/* === HEADER/TIÊU ĐỀ === */
.crop-tool-wrap header{
  margin-bottom:12px;
  text-align: center;
}
.crop-tool-wrap h1{
  font-size:28px;
  margin:0;
  color: var(--primary);
  font-weight: 700;
}
.crop-tool-wrap p.lead{
  font-size:16px;
  margin:4px 0 20px;
  color: var(--muted);
}

/* === PANEL CHÍNH (Chứa Text và Buttons) === */
.crop-tool-wrap .panel {
    display: flex; 
    flex-direction: column; /* Mặc định là DỌC (cho mobile) */
    gap: 20px; 
    padding: 5px;
}

/* CỘT CHỨA INPUT VÀ OUTPUT */
.crop-tool-wrap .text-area-column {
    display: flex;
    flex-direction: column;
    gap: 20px; 
    flex: 1;
}

.crop-tool-wrap .input-section,
.crop-tool-wrap .output-section {
    display: flex;
    flex-direction: column;
}

.crop-tool-wrap label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.crop-tool-wrap textarea {
    width: 100%;
    min-height: 150px; 
    height: 100%; 
    padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-sizing: border-box;
    font-family: monospace;
    font-size: 15px;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--card);
    color: var(--text);
    line-height: 1.6;
}

.crop-tool-wrap textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25); 
}


/* CỘT CHỨA BUTTONS */
.crop-tool-wrap .button-column {
    display: flex;
    flex-direction: row; /* NGANG trên mobile */
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
}

.crop-tool-wrap .button-spacer {
    display: none; /* Ẩn spacer trên mobile */
}

/* === BUTTON STYLING (Tương phản cao) === */

/* Nút chính */
.crop-tool-wrap .btn{
  background: var(--primary); 
  color: #fff; 
  padding:12px 20px; 
  border-radius:10px;
  border:none;
  cursor:pointer;
  font-size:16px; 
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  width: 100%; /* Full width trên mobile */
  max-width: 250px; /* Giới hạn width trên mobile để không quá to */
}
.crop-tool-wrap .btn:hover{
  background: #047857; 
  transform: translateY(-1px);
}
.crop-tool-wrap .btn:active{
    transform: translateY(0);
}

/* Nút thứ cấp (Copy/Clear) */
.crop-tool-wrap .btn.secondary{
  background: var(--secondary); 
  color: #fff; 
}
.crop-tool-wrap .btn.secondary:hover{
  background: #475569; 
}

/* === FOOTER === */
.crop-tool-wrap footer{
  margin-top:20px;
  font-size:13px;
  color: var(--muted);
  text-align:center;
}


/* === MEDIA QUERIES (Bố cục 2 Cột trên Desktop) === */

@media(min-width:800px){
  .crop-tool-wrap .panel{
    flex-direction: row; /* CHUYỂN sang NGANG (2 cột) */
    align-items: stretch;
  }

  .crop-tool-wrap .text-area-column{
    flex: 4; /* Cột văn bản chiếm 3 phần */
    height: 450px; 
  }
  
  .crop-tool-wrap .input-section,
  .crop-tool-wrap .output-section {
      flex: 1; /* Chia đều chiều cao 450px cho 2 textarea */
  }

  .crop-tool-wrap .button-column{
    flex: 1; /* Cột nút chiếm 1 phần */
    flex-direction: column; /* Chuyển các nút sang chiều DỌC */
    justify-content: flex-start;
    padding-top: 50px; /* Căn chỉnh nút mã hóa/giải mã ngang hàng với textarea đầu tiên */
    min-width: 200px; 
  }
  
  .crop-tool-wrap .button-spacer {
      display: block; /* Hiển thị spacer */
      width: 100%;
      height: 20px; 
  }

  /* Đảm bảo các nút chiếm hết chiều rộng của cột trên desktop */
  .crop-tool-wrap .button-column .btn {
      width: 100%;
      max-width: none;
  }

}