/* --- VARIABLES & RESET --- */
:root {
    --dil-primary: #4F46E5; /* Màu tím xanh hiện đại */
    --dil-primary-hover: #4338CA;
    --dil-accent: #0EA5E9; /* Màu xanh dương nhạt */
    --dil-text-dark: #1E293B;
    --dil-text-gray: #64748B;
    --dil-bg-light: #F8FAFC;
    --dil-border: #E2E8F0;
    --dil-success-bg: #ECFDF5;
    --dil-success-text: #065F46;
    --dil-error-bg: #FEF2F2;
    --dil-error-text: #991B1B;
    --dil-radius: 16px;
}

#kth-dilution-app {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    color: var(--dil-text-dark);
    max-width: 1100px;
    margin: 40px auto;
}

[v-cloak] { display: none; }
*, *::before, *::after { box-sizing: border-box; }

/* --- MAIN CARD --- */
.dilution-card {
    display: flex;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

/* --- LEFT SIDE (FORM) --- */
.dil-form-side {
    flex: 1.2; /* Chiếm 60% */
    padding: 48px;
}

.tool-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--dil-accent);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
}

.dil-header h2 {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: var(--dil-text-dark);
    letter-spacing: -0.5px;
}

.dil-header p {
    font-size: 16px;
    color: var(--dil-text-gray);
    margin-bottom: 40px;
}

/* --- INPUTS --- */
.dil-group {
    margin-bottom: 24px;
}

.dil-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dil-text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    display: flex;
    border: 2px solid var(--dil-border);
    border-radius: var(--dil-radius);
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    background: var(--dil-bg-light);
}

.input-wrapper:focus-within {
    border-color: var(--dil-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: #fff;
}

.input-wrapper input {
    flex: 1;
    border: none;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--dil-text-dark);
    background: transparent;
    outline: none;
    width: 100%;
}

.input-wrapper input::placeholder {
    color: #CBD5E1;
    font-weight: 500;
}

.select-wrapper {
    position: relative;
    border-left: 2px solid var(--dil-border);
    background: #fff;
}

.select-wrapper select {
    appearance: none;
    border: none;
    padding: 0 40px 0 20px;
    height: 100%;
    font-size: 16px;
    font-weight: 700;
    color: var(--dil-text-dark);
    background: transparent;
    cursor: pointer;
    outline: none;
}

/* Mũi tên dropdown custom */
.select-wrapper::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-color: var(--dil-text-gray);
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
    pointer-events: none;
}

/* --- ACTIONS --- */
.dil-actions {
    display: flex;
    gap: 15px;
    margin-top: 32px;
    margin-bottom: 32px;
}

.btn-calculate {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--dil-primary), #8B5CF6);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.5);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(79, 70, 229, 0.6);
}
.btn-calculate svg { transition: transform 0.3s ease; }
.btn-calculate:hover svg { transform: translateX(5px); }

.btn-reset {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--dil-border);
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--dil-text-gray);
}
.btn-reset:hover {
    border-color: var(--dil-primary);
    color: var(--dil-primary);
    transform: rotate(90deg);
}

/* --- RESULTS --- */
.dil-result-box {
    border-radius: var(--dil-radius);
    padding: 24px;
    animation: slideUp 0.4s ease-out;
}

.dil-result-box h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dil-result-box h4 .icon { font-size: 24px; }

.dil-result-box ul {
    margin: 0;
    padding-left: 24px;
    list-style-type: disc;
}
.dil-result-box li {
    margin-bottom: 8px;
    font-size: 16px;
}
.dil-result-box .summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed currentColor;
    font-weight: 600;
    font-size: 17px;
}

.dil-result-box.success {
    background: var(--dil-success-bg);
    color: var(--dil-success-text);
    border: 1px solid #A7F3D0;
}

.dil-result-box.error {
    background: var(--dil-error-bg);
    color: var(--dil-error-text);
    border: 1px solid #FECACA;
}


/* --- RIGHT SIDE (VISUAL) --- */
.dil-visual-side {
    flex: 0.8; /* Chiếm 40% */
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Tạo hiệu ứng nền pattern nhẹ */
.dil-visual-side::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--dil-border) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

.dil-visual-side img {
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    /* Hiệu ứng trôi nhẹ cho ảnh */
    animation: float 6s ease-in-out infinite;
}


/* --- ANIMATIONS --- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
.fade-enter-active, .fade-leave-active { transition: opacity 0.3s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }


/* --- RESPONSIVE MOBILE (< 768px) --- */
@media (max-width: 900px) {
    .dilution-card {
        flex-direction: column; /* Chuyển thành 1 cột */
        border-radius: 16px;
        margin: 20px;
    }

    .dil-form-side {
        padding: 32px 24px;
        order: 2; /* Đưa form xuống dưới ảnh trên mobile */
    }

    .dil-visual-side {
        order: 1; /* Đưa ảnh lên đầu */
        padding: 30px 20px;
        min-height: 250px;
    }
    .dil-visual-side img {
        max-height: 200px;
    }

    .dil-header h2 { font-size: 28px; }
    .btn-calculate { font-size: 15px; padding: 16px 24px; }
    .input-wrapper input { font-size: 16px; padding: 14px 16px; }
    .select-wrapper select { font-size: 14px; padding-right: 30px; }
}