:root {
    --gold-primary: #D4AF37;
    --gold-light: #F9E596;
    --gold-dark: #AA7C11;
    --dark-bg: #0B0E14;
    --glass-bg: rgba(15, 20, 25, 0.7);
    --glass-border: rgba(212, 175, 55, 0.2);
    --text-main: #FFFFFF;
    --text-muted: #A0AEC0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--dark-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
    position: relative;
    background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, var(--dark-bg) 70%);
}

/* Background Animations */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: drift 25s infinite alternate ease-in-out;
}

.circle-1 {
    width: 600px;
    height: 600px;
    background: rgba(212, 175, 55, 0.15);
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: rgba(255, 140, 0, 0.1);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.circle-3 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes drift {
    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Layout */
.container {
    width: 96%;
    max-width: 1240px; /* Nhích nhẹ không gian ngang */
    padding: 15px 25px; /* Ép dọc */
    margin: 10px auto;
}

/* Glassmorphism Premium Gold */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 3px;
    color: #fff;
}

.highlight-gold {
    background: linear-gradient(to right, var(--gold-light), var(--gold-primary), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 5px 20px rgba(212, 175, 55, 0.3);
}

.subtitle {
    color: var(--gold-light);
    font-weight: 300;
    opacity: 0.8;
    font-size: 13px;
}

/* Dashboard Grid */
.dashboard {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 15px 20px;
    transition: transform 0.3s ease;
    min-width: 0; 
}

.result-panel {
    display: flex;
    flex-direction: column;
}

.result-panel h2 {
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--gold-light);
    text-transform: uppercase;
}

/* Inputs Splitting */
.input-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 12px;
}

.input-block h2 {
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.block-loan h2 {
    color: #FC8181;
}
.block-lc h2 {
    color: #63B3ED;
}

/* Form Styles */
.input-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.flex-group {
    flex-direction: row;
    gap: 15px;
}

.half {
    width: 50%;
    display: flex;
    flex-direction: column;
}

label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #cbd5e1;
}

.premium-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    width: 100%;
}

select.premium-input {
    font-size: 10px;
    padding: 8px 4px;
}

.premium-input option {
    background-color: #1a1a1a;
    color: #fff;
    font-size: 13px;
    padding: 8px;
}

.gold-glow:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.loan-glow:focus {
    border-color: #FC8181;
    box-shadow: 0 0 15px rgba(252, 129, 129, 0.2);
}

.text-center {
    text-align: center;
}

/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -7px;
}

input[type=range].gold-slider::-webkit-slider-thumb {
    background: radial-gradient(circle, var(--gold-light) 0%, var(--gold-primary) 100%);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

input[type=range].loan-slider::-webkit-slider-thumb {
    background: #FC8181;
    box-shadow: 0 0 10px rgba(252, 129, 129, 0.6);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* Fee Detailed Table */
.fee-table-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 12px 15px;
    border: 1px dashed rgba(212, 175, 55, 0.2);
}

.fee-table-container h3 {
    font-size: 11px;
    color: var(--gold-light);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-align: center;
}

.fee-table {
    display: flex;
    flex-direction: column;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 11px;
    color: var(--text-muted);
}

.fee-row:last-child {
    border-bottom: none;
}

.fee-table .total-row {
    border-top: 1px solid rgba(212, 175, 55, 0.4);
    margin-top: 6px;
    padding-top: 8px;
    font-weight: 800;
    color: var(--gold-primary);
    font-size: 13px;
}

.fee-row.highlight-row {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 6px;
}

.fee-val {
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Results */
.result-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.result-card {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.8) 0%, rgba(10, 10, 15, 0.9) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 15px 20px;
    transition: all 0.3s;
    overflow: hidden;
}

.main-loan {
    border-left: 4px solid #F56565;
}

.main-lc {
    border-left: 4px solid #4299E1;
}

.main-saving {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
    border: 1px solid var(--gold-primary);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
    padding: 20px 20px;
    border-left: 4px solid var(--gold-primary);
}

.saving-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: var(--gold-primary);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.result-card .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.result-card .value {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
    white-space: nowrap;
}

.loan-text { color: #FC8181; }
.lc-text { color: #63B3ED; }

.grand-saving {
    font-size: 32px !important;
    background: linear-gradient(to right, #FFF, var(--gold-light), var(--gold-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 5px 20px rgba(212, 175, 55, 0.4);
}

/* Actions */
.action-area {
    display: flex;
    gap: 15px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.primary-gold-btn {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
    color: #000;
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

.primary-gold-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.5);
}

.secondary-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.05);
}

/* Personal Watermark */
.watermark {
    position: absolute;
    top: 15px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.4;
    transition: all 0.4s ease;
    z-index: 1000;
    pointer-events: none; /* Tránh cản trở thao tác click nếu lỡ đè lên thẻ khác */
}

.watermark:hover {
    opacity: 0.9;
    pointer-events: auto;
}

.watermark span {
    font-size: 9px;
    color: var(--gold-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 400;
    text-align: right;
}

.watermark strong {
    color: var(--gold-primary);
    font-weight: 800;
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.watermark img {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

