/* =================================
   STYLES.CSS - Hydro Structure AI
   ================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

/* --- HEADER --- */
.tool-header {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
    padding: 2rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.tool-header .container { max-width: 1400px; margin: 0 auto; }
.tool-title { font-size: 2rem; font-weight: 600; margin-bottom: 0.5rem; }
.tool-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.9rem; opacity: 0.95; }
.tool-meta span { display: inline-flex; align-items: center; gap: 0.5rem; }

/* --- MAIN LAYOUT --- */
.tool-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    display: flex;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

/* Cột Trái: Canvas */
.canvas-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.canvas-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 1rem;
    display: flex;
    justify-content: center;
    border: 1px solid #eee;
}
canvas { border-radius: 4px; max-width: 100%; height: auto; }

/* Khu vực hiển thị kết quả nổi bật */
.area-display-section {
    background: white;
    border-left: 5px solid #198754;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.area-display-section h3 { color: #495057; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }
.area-display-section .result-number { font-size: 2rem; font-weight: 700; color: #198754; font-family: 'Courier New', monospace; }

/* Cột Phải: Controls */
.controls-section {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
    min-width: 300px;
}
.controls-section h3 {
    color: #198754;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #198754;
}

/* --- COMPONENTS --- */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 1rem;
}
.btn-primary { background: #198754; color: white; }
.btn-primary:hover { background: #146c43; transform: translateY(-2px); }
.btn-primary:disabled { background: #6c757d; cursor: not-allowed; transform: none; }

.info-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.info-box h4 { color: #198754; margin-bottom: 0.5rem; font-size: 1rem; }

.toc { background: #e9ecef; padding: 1rem; border-radius: 6px; margin-bottom: 1.5rem; }
.toc h4 { font-size: 0.85rem; color: #6c757d; text-transform: uppercase; margin-bottom: 0.5rem; }
.toc ul { list-style: none; }
.toc a { text-decoration: none; color: #198754; font-weight: 500; display: block; padding: 2px 0; }
.toc a:hover { color: #146c43; transform: translateX(5px); transition: transform 0.2s; }

/* Responsive */
@media (max-width: 992px) {
    .tool-container { flex-direction: column; }
    .controls-section { position: static; }
}