/* --- Luxury Tools specific styles --- */

/* Tối đa hóa không gian: Bỏ max-width, cho phép tool-body mở rộng toàn bộ */
.tool-body {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Các công cụ cần căn giữa hoàn toàn (Đồng hồ, Pomodoro, Password) */
#home-tool .tool-body,
#pomodoro-tool .tool-body,
#password-tool .tool-body {
    align-items: center;
    justify-content: center;
}

/* --- Mật Khẩu (Password Generator) --- */
#password-tool .tool-body {
    max-width: 1200px; /* Giới hạn cho đẹp, không bị quá dài trên màn 4K */
    margin: 0 auto;
}
.password-display {
    display: flex; margin-bottom: 40px; width: 100%;
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 32px; box-shadow: inset 0 2px 20px rgba(0,0,0,0.2);
    overflow: hidden;
}
body.light-mode .password-display {
    background: #fff; border-color: transparent; box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}

#password-result {
    flex: 1; padding: 30px 40px; border-radius: 0; border: none;
    font-size: clamp(30px, 4vw, 48px); letter-spacing: 4px; text-align: center;
    background: transparent; box-shadow: none; font-weight: 300;
}
body.light-mode #password-result { background: transparent; box-shadow: none; }

.password-display .btn-icon {
    position: static; transform: none; flex-shrink: 0;
    background: rgba(255,255,255,0.05); border: none; border-left: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted); font-size: 36px; cursor: pointer; transition: all 0.3s ease;
    border-radius: 0; width: 120px; display: flex; align-items: center; justify-content: center;
    box-shadow: none; backdrop-filter: none;
}
body.light-mode .password-display .btn-icon { background: rgba(0,0,0,0.03); border: none; border-left: 1px solid rgba(0,0,0,0.05); box-shadow: none; }
.password-display .btn-icon:hover { color: var(--primary-color); background: rgba(255,255,255,0.1); transform: none; }
body.light-mode .password-display .btn-icon:hover { background: rgba(0,0,0,0.06); }

.options-group {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 40px;
    padding: 40px; backdrop-filter: blur(20px); box-shadow: var(--glass-shadow); margin-bottom: 30px; width: 100%;
}
body.light-mode .options-group { background: rgba(255,255,255,0.7); box-shadow: 0 10px 50px rgba(15, 23, 42, 0.05); }

.length-slider { margin-bottom: 40px; }
.length-slider label { display: flex; justify-content: space-between; font-weight: 500; font-size: 20px; margin-bottom: 24px; color: var(--text-main);}
.length-slider input[type="range"] {
    width: 100%; accent-color: var(--primary-color); height: 8px; border-radius: 10px; cursor: pointer;
}

.checkbox-group {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.custom-checkbox {
    display: flex; align-items: center; gap: 16px; cursor: pointer; font-size: 16px; color: var(--text-main);
    padding: 20px 24px; border-radius: 24px; background: var(--input-bg); border: 1px solid var(--glass-border); transition: all 0.2s;
}
.custom-checkbox:hover { background: rgba(255,255,255,0.05); transform: translateY(-2px); }
body.light-mode .custom-checkbox:hover { background: #fff; }
.custom-checkbox input[type="checkbox"] { accent-color: var(--primary-color); width: 24px; height: 24px; border-radius: 8px; }
.custom-checkbox .checkmark { display: none; }

#btn-generate-password { font-size: 20px; padding: 20px; border-radius: 100px; width: 100%; margin-top: 40px; }


/* --- Đếm Từ (Word Counter) --- */
#counter-tool .tool-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.stats-container {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; margin-bottom: 30px;
}
.stat-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 32px; padding: 40px 20px; text-align: center;
    backdrop-filter: blur(20px) saturate(180%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--glass-shadow);
    display: flex; flex-direction: column; justify-content: center;
}
.stat-card:hover { transform: translateY(-8px); }
body.light-mode .stat-card { background: rgba(255,255,255,0.7); box-shadow: 0 10px 40px rgba(15, 23, 42, 0.05); border: 1px solid #fff; }

.stat-value { font-size: clamp(40px, 4vw, 64px); font-weight: 300; color: var(--text-main); margin-bottom: 12px; font-variant-numeric: tabular-nums; display: block; line-height: 1;}
.stat-label { color: var(--text-muted); font-size: 16px; font-weight: 500; }

.custom-textarea { flex: 1; min-height: 0; resize: none; border-radius: 32px; padding: 40px; width: 100%; font-size: 18px; line-height: 1.6;}
#btn-clear-text { margin-top: 24px; font-size: 18px; padding: 18px; border-radius: 100px; width: 100%; }

/* --- JSON Formatter --- */
#json-tool .tool-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.json-actions { display: flex; gap: 16px; margin-bottom: 24px; align-items: center;}
.status-msg { margin-left: auto; font-size: 16px; color: var(--warning-color); font-family: var(--font-code); }
.json-editors { flex: 1; display: flex; gap: 24px; min-height: 0; width: 100%;}
.json-editors textarea { flex: 1; resize: none; border-radius: 32px; padding: 30px; font-family: var(--font-code); background: var(--input-bg); color: var(--primary-color); font-size: 16px;}
body.light-mode .json-editors textarea { color: #0f172a; }


/* --- Pomodoro Timer --- */
#pomodoro-tool .tool-header {
    display: none; /* Ẩn header để tối đa hóa không gian hiển thị cho Timer */
}
.timer-modes {
    display: flex; gap: 12px; background: var(--input-bg); padding: 12px; border-radius: 100px; margin-bottom: 60px;
    border: 1px solid var(--glass-border);
}
.mode-btn {
    padding: 16px 32px; border: none; border-radius: 100px; background: transparent; color: var(--text-muted);
    font-size: 18px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; font-family: var(--font-main);
}
.mode-btn:hover { color: var(--text-main); }
.mode-btn.active {
    background: var(--primary-color); color: #fff; box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.timer-display { text-align: center; margin-bottom: 60px;}
#time-left {
    font-size: clamp(150px, 35cqw, 450px); font-weight: 200; font-family: var(--font-main); color: var(--text-main);
    line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -6px; text-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.timer-controls { display: flex; gap: 32px; justify-content: center; }
.timer-btn { padding: 24px 60px; font-size: 24px; border-radius: 100px; }


/* --- Đồng Hồ (Clock) --- */
.clock-display { margin: auto; text-align: center; position: relative; z-index: 10; width: 100%;}
.time-text {
    font-size: clamp(80px, 16cqw, 350px); font-weight: 200; line-height: 0.9; margin-bottom: 20px; color: var(--text-main);
    letter-spacing: -4px; font-variant-numeric: tabular-nums; text-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.time-text span {
    font-size: 0.4em; opacity: 0.5; margin-left: 5px;
}
body.light-mode .time-text { text-shadow: 0 20px 50px rgba(0,0,0,0.05); }

.date-text { font-size: clamp(48px, 6vw, 84px); color: var(--text-muted); font-weight: 400; letter-spacing: 4px; margin-bottom: 20px; }

.lunar-badge {
    margin-top: 40px; padding: 12px 32px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 100px;
    font-size: clamp(24px, 3vw, 40px); color: var(--text-main); font-weight: 400; backdrop-filter: blur(20px); box-shadow: var(--glass-shadow);
    display: inline-block; transition: all 0.3s ease;
}
body.light-mode .lunar-badge { background: #fff; box-shadow: 0 10px 40px rgba(15, 23, 42, 0.05); border: 1px solid #fff; }


/* Responsive adjustments */
@media (max-width: 1200px) {
    .stats-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    #password-result { padding: 20px; font-size: 24px; }
    .password-display .btn-icon { width: 80px; font-size: 24px; }
    .checkbox-group { grid-template-columns: 1fr; }
    #time-left { font-size: 120px; }
    .timer-modes { flex-direction: column; border-radius: 24px; }
    .timer-btn { padding: 16px 40px; font-size: 18px; }
    .json-editors { flex-direction: column; }
    .stat-value { font-size: 40px; }
}
