/* ==========================================================================
   tools.css — Standardized Calculator Tool Styles
   Color Scheme: #332353 (Deep Purple) | #84BD5A (Vibrant Green)
   Aesthetics: Premium, Modern, Responsive
   ========================================================================== */

:root {
    --primary-color: #332353;
    --primary-light: #4a3475;
    --secondary-color: #84BD5A;
    --secondary-hover: #72a64c;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --bg-light: #f8f9fa;
    --border-color: #dfe6e9;
    --shadow-sm: 0 2px 8px rgba(51, 35, 83, 0.05);
    --shadow-md: 0 10px 25px rgba(51, 35, 83, 0.08);
    --shadow-lg: 0 15px 35px rgba(51, 35, 83, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* ---- Section & Layout ---- */
.tool-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-page-header h2 {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.tool-page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ---- Tool Card ---- */
.tool-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: none;
    padding: 35px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
}

/* ---- Form Styling ---- */
.tool-field {
    margin-bottom: 20px;
}

.tool-label {
    display: block;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.tool-input, .tool-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-main);
    background-color: #fff;
    transition: all 0.2s ease;
    outline: none;
}

.input-group .tool-input, 
.input-group .tool-select,
.input-group .tool-textarea {
    width: 1%;
    flex: 1 1 auto;
}

.input-group-text {
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    font-weight: 600;
    padding: 0 15px;
    display: flex;
    align-items: center;
}

.input-group .tool-input + .input-group-text,
.input-group .tool-select + .input-group-text {
    border-left: none;
}

.input-group .input-group-text + .tool-input,
.input-group .input-group-text + .tool-select {
    border-left: none;
}

/* Border Radius Fixes for Input Group */
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.tool-input:focus, .tool-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(132, 189, 90, 0.15);
}

/* ---- Buttons ---- */
.btn-tool-calc {
    background: var(--secondary-color);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(132, 189, 90, 0.3);
    margin-right: 10px;
}

.btn-tool-calc:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(132, 189, 90, 0.4);
    color: #fff;
}

.btn-tool-reset {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 10px;
}

.btn-tool-reset:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ---- Tabs (Nav Pills) ---- */
.tool-nav-tabs {
    display: inline-flex;
    background: #f1f3f5;
    padding: 5px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    gap: 5px;
}

.tool-nav-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.tool-nav-tabs .nav-link.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tool-nav-tabs .nav-link:hover:not(.active) {
    color: var(--primary-color);
    background: rgba(51, 35, 83, 0.05);
}

/* ---- Result Panel ---- */
.tool-result-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 35px;
    border-top: 5px solid var(--secondary-color);
    height: 100%;
}

.tool-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.tool-result-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
}

.tool-result-header i {
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.tool-result-sidebar {
    animation-delay: 0.1s;
    background: #fff;
    padding: 20px;
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.result-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.result-value {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.2rem;
}

.result-highlight {
    background: rgba(132, 189, 90, 0.1);
    border: 1px solid rgba(132, 189, 90, 0.2);
}

.result-highlight .result-value {
    color: var(--secondary-color);
    font-size: 1.5rem;
}

/* ---- Content Section ---- */
/* .tool-content-wrap {
    margin-top: 60px;
    padding: 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
} */

.tool-content-wrap h2, .tool-content-wrap h3 {
    color: var(--primary-color);
    margin-top: 30px;
}

/* ---- Custom Radio Buttons ---- */
.tool-radio-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    user-select: none;
    gap: 10px;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    background: #fff;
}

.tool-radio-label input[type="radio"] {
    display: none;
}

.tool-radio-dot {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tool-radio-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-radio-label:hover {
    border-color: var(--primary-light);
    background: rgba(51, 35, 83, 0.02);
}

.tool-radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(51, 35, 83, 0.05);
    color: var(--primary-color);
    margin-left: 5px;
    margin-right: 5px;
}

.tool-radio-label input[type="radio"]:checked + .tool-radio-dot {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.tool-radio-label input[type="radio"]:checked + .tool-radio-dot::after {
    transform: translate(-50%, -50%) scale(1);
}

.tool-radio-btn {
    flex: 1;
    min-width: 80px;
}

.tool-radio-btn input[type="radio"] {
    display: none;
}

.tool-radio-btn label {
    display: block;
    text-align: center;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s;
    margin: 0;
    user-select: none;
    background: #fff;
}

.tool-radio-btn input[type="radio"]:checked + label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(51, 35, 83, 0.15);
}

.tool-radio-btn label:hover {
    border-color: var(--secondary-color);
    color: var(--primary-color);
    background: rgba(132, 189, 90, 0.05);
}
.sidebar-title {
    color: #365292;
    font-size: 20px;
    margin-bottom: 10px;
}
/* ---- Animations ---- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: slideUp 0.5s ease forwards;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .tool-page-header h2 {
        font-size: 1.8rem;
    }
    .tool-card, .tool-result-card {
        padding: 20px;
    }
    .btn-tool-calc, .btn-tool-reset {
        width: 100%;
        margin-bottom: 10px;
    }
}
