/* ================================================
   HOANG GIANG SOLAR — PUBLIC TOOLS CSS
   Modern calculator & tools design system
   ================================================ */

/* ===== Tools Landing Page ===== */
.tools-hero {
    background: linear-gradient(135deg, #0f2a4a 0%, #1e6de8 100%);
    padding: 2.5rem 0 2rem;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.tools-hero::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(245,179,1,.08);
}
.tools-hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.tools-hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: .75rem;
    position: relative;
    z-index: 1;
}
.tools-hero h1 span { color: #f5b301; }
.tools-hero p {
    font-size: 1rem;
    opacity: .8;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== Tool Cards Grid ===== */
.tool-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid #e8ecf1;
    transition: all .35s cubic-bezier(.4,0,.2,1);
    height: 100%;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    color: inherit;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tc-color, #1e6de8), var(--tc-color2, #3b82f6));
    opacity: 0;
    transition: opacity .3s;
}
.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0,0,0,.08);
    border-color: transparent;
    color: inherit;
    text-decoration: none;
}
.tool-card:hover::before { opacity: 1; }

.tool-card-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    transition: transform .3s;
}
.tool-card:hover .tool-card-icon { transform: scale(1.1) rotate(-5deg); }

.tool-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .5rem;
}
.tool-card p {
    font-size: .85rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.tool-card .tool-link {
    font-size: .82rem;
    font-weight: 700;
    color: var(--tc-color, #1e6de8);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap .2s;
}
.tool-card:hover .tool-link { gap: 10px; }
.tool-card .tool-badge {
    position: absolute;
    top: 16px; right: 16px;
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Card color variants */
.tc-vat { --tc-color: #1e6de8; --tc-color2: #60a5fa; }
.tc-vat .tool-card-icon { background: rgba(30,109,232,.08); color: #1e6de8; }

.tc-pit { --tc-color: #7c3aed; --tc-color2: #a78bfa; }
.tc-pit .tool-card-icon { background: rgba(124,58,237,.08); color: #7c3aed; }

.tc-salary { --tc-color: #059669; --tc-color2: #34d399; }
.tc-salary .tool-card-icon { background: rgba(5,150,105,.08); color: #059669; }

.tc-solar { --tc-color: #d97706; --tc-color2: #fbbf24; }
.tc-solar .tool-card-icon { background: rgba(217,119,6,.08); color: #d97706; }

/* ===== Calculator Page Layout ===== */
.calc-page {
    padding: 1.5rem 0 3rem;
    background: #f6f8fb;
    min-height: 80vh;
}
.calc-container {
    max-width: 860px;
    margin: 0 auto;
}

/* Calculator header */
.calc-header {
    background: linear-gradient(135deg, var(--calc-bg1, #0f2a4a) 0%, var(--calc-bg2, #1e6de8) 100%);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem 1.75rem 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.calc-header::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.calc-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: .2rem;
    position: relative;
    z-index: 1;
}
.calc-header p {
    font-size: .82rem;
    opacity: .75;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Calculator body */
.calc-body {
    background: #fff;
    border-radius: 0 0 16px 16px;
    padding: 1.5rem;
    border: 1px solid #e8ecf1;
    border-top: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
}

/* Input groups */
.calc-input-group {
    margin-bottom: 1rem;
}
.calc-input-group label {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .4rem;
    display: block;
}
.calc-input-group .form-control,
.calc-input-group .form-select {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: .65rem 1rem;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.calc-input-group .form-control:focus,
.calc-input-group .form-select:focus {
    border-color: var(--calc-accent, #1e6de8);
    box-shadow: 0 0 0 3px rgba(30,109,232,.1);
}
.calc-input-group .input-hint {
    font-size: .75rem;
    color: #9ca3af;
    margin-top: .25rem;
}

/* Preset buttons */
.calc-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: .5rem;
}
.calc-preset {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    transition: all .2s;
}
.calc-preset:hover,
.calc-preset.active {
    background: var(--calc-accent, #1e6de8);
    color: #fff;
    border-color: var(--calc-accent, #1e6de8);
}

/* Result section */
.calc-result {
    background: linear-gradient(145deg, #f0f7ff 0%, #eef4ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}
.calc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: .88rem;
    border-bottom: 1px solid rgba(30,109,232,.08);
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-row .cr-label {
    color: #64748b;
    font-weight: 500;
}
.calc-result-row .cr-value {
    font-weight: 700;
    color: #1e293b;
    font-size: .95rem;
}
.calc-result-row.total {
    border-top: 2px solid #1e6de8;
    border-bottom: none;
    margin-top: 8px;
    padding-top: 14px;
}
.calc-result-row.total .cr-label,
.calc-result-row.total .cr-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e6de8;
}
.calc-result-row .cr-value.text-danger { color: #ef4444 !important; }
.calc-result-row .cr-value.text-success { color: #22c55e !important; }

.calc-words {
    font-size: .82rem;
    color: #64748b;
    font-style: italic;
    margin-top: .5rem;
    text-align: right;
}

/* Tax breakdown table */
.tax-breakdown {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: .85rem;
}
.tax-breakdown th {
    background: #f1f5f9;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: #374151;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.tax-breakdown td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.tax-breakdown tr:last-child td { border-bottom: none; }
.tax-breakdown .text-right { text-align: right; }
.tax-breakdown .fw-bold { font-weight: 700; color: #1e293b; }
.tax-breakdown .highlight { background: #fffbeb; }

/* CTA box for solar calc */
.calc-cta {
    background: linear-gradient(135deg, #0f2a4a 0%, #1e3a5f 100%);
    border-radius: 16px;
    padding: 2rem;
    color: #fff;
    text-align: center;
    margin-top: 2rem;
}
.calc-cta h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.calc-cta p {
    font-size: .88rem;
    opacity: .75;
    margin-bottom: 1.25rem;
}
.calc-cta .btn-cta {
    background: linear-gradient(135deg, #f5b301, #e6a200);
    color: #0f2a4a;
    font-weight: 700;
    padding: .75rem 2rem;
    border-radius: 12px;
    border: none;
    font-size: .95rem;
    transition: all .3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.calc-cta .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245,179,1,.35);
}

/* Info box / Reference */
.calc-info {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}
.calc-info h5 {
    font-size: .9rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: .5rem;
}
.calc-info ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: .82rem;
    color: #78350f;
    line-height: 1.8;
}

/* Other tools sidebar */
.calc-other-tools {
    position: sticky;
    top: 80px;
    margin-top: 0;
}
.calc-other-tools h5 {
    font-size: .9rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
}
.calc-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all .2s;
}
.calc-mini-card:hover {
    border-color: #1e6de8;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
    color: inherit;
    text-decoration: none;
}
.calc-mini-card .mini-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.calc-mini-card h6 {
    margin: 0;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
}
.calc-mini-card small {
    color: #9ca3af;
    font-size: .72rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .tools-hero { padding: 2rem 0 1.5rem; }
    .tools-hero h1 { font-size: 1.4rem; }
    .calc-page { padding: 1rem 0 2rem; }
    .calc-header { padding: 1.25rem; border-radius: 14px 14px 0 0; }
    .calc-header h1 { font-size: 1.1rem; }
    .calc-body { padding: 1rem; border-radius: 0 0 14px 14px; }
    .calc-result { padding: .85rem 1rem; }
    .calc-result-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 0; }
    .calc-result-row.total { flex-direction: row; align-items: center; }
    .calc-cta { padding: 1.25rem; }
    .calc-other-tools { position: static; margin-top: 1.5rem; }
    .calc-info { padding: .85rem 1rem; }
}

/* ===== Print ===== */
@media print {
    .tools-hero, .calc-other-tools, .calc-cta, .calc-presets, .no-print { display: none !important; }
    .calc-page { background: #fff; padding: 0; }
    .calc-header { border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .calc-body { border: 1px solid #ccc; border-radius: 0; box-shadow: none; }
    .calc-result { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
