/* =========================================
   UNIT CONVERTER MODULE (Modern SaaS)
   ========================================= */

/* Container Layout */
.converter {
    background: var(--bg-body); /* Matches global background */
    padding: 20px 0;
}

.unit-converter-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}

/* --- MAIN TOOL CARD --- */
.converter-tool {
    flex: 2; /* Takes up 2/3 space */
    min-width: 320px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-card);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.converter-tool:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.converter-header h2 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
}

/* Tabs (Area, Length, etc.) */
.converter-tabs {
    display: flex;
    gap: 5px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: var(--radius-btn); /* Pill Shape Container */
    margin-bottom: 25px;
}

.tab-button {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-btn);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tab-button:hover:not(.active) {
    color: var(--primary);
}

/* Input / Output Fields */
.input-section label, .output-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.input-row, .output-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr; /* Number input larger than unit select */
    gap: 10px;
    margin-bottom: 15px;
}

.value-input, .unit-select {
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-input);
    font-size: 1rem;
    transition: all 0.2s;
    background: #fff;
}

.value-input:focus, .unit-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Result Box (Output) */
.value-output {
    padding: 12px 15px;
    border: 1px solid #e0f2fe; /* Very light blue border */
    border-radius: var(--radius-input);
    font-size: 1.1rem;
    background: #f0f9ff; /* Lightest Blue */
    color: var(--primary);
    font-weight: 700;
    cursor: not-allowed;
}

/* Equals Sign Circle */
.equals-sign {
    text-align: center;
    margin: -10px 0; /* Slight overlap */
    position: relative;
    z-index: 5;
}

.equals-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-swap, .btn-clear {
    flex: 1;
    padding: 12px 0;
    border-radius: var(--radius-btn);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-swap {
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-swap:hover {
    background: #eff6ff;
}

.btn-clear {
    background: white;
    border: 1px solid #cbd5e1;
    color: var(--text-light);
}

.btn-clear:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--text-main);
}

/* Results List (All Conversions) */
.all-conversions {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.all-conversions h4 {
    margin-bottom: 15px;
    color: var(--secondary);
    font-size: 0.95rem;
}

.conversion-list {
    max-height: 160px;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: var(--radius-input);
    padding: 5px;
    border: 1px solid #f1f5f9;
}

/* Custom Scrollbar */
.conversion-list::-webkit-scrollbar { width: 6px; }
.conversion-list::-webkit-scrollbar-track { background: transparent; }
.conversion-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.conversion-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 5px;
    border: 1px solid transparent;
    transition: transform 0.1s;
    cursor: default;
}

.conversion-item:hover {
    border-color: #e2e8f0;
    transform: translateX(2px);
}

.conversion-item span:first-child { color: var(--text-light); font-size: 0.9rem; }
.conversion-item span:last-child { color: var(--secondary); font-weight: 700; }

.placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-style: italic;
    font-size: 0.9rem;
}

/* --- RIGHT SIDE: QUICK REFERENCE CARD --- */
.quick-reference {
    flex: 1; /* Takes up 1/3 space */
    min-width: 280px;
    /* Updated Gradient: Slate/Blue */
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    border-radius: var(--radius-card);
    padding: 25px;
    color: white;
    box-shadow: var(--shadow-md);
}

.quick-reference h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.reference-section {
    background: rgba(255,255,255,0.05); /* Glass effect */
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.reference-section h4 {
    color: var(--accent); /* Light Blue */
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ref-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

.ref-item:last-child { border-bottom: none; }
.ref-item span:last-child { font-weight: 600; color: white; }

/* Pro Tip Box */
.pro-tip {
    margin-top: 15px;
    padding: 12px;
    background: rgba(56, 189, 248, 0.1); /* Light Blue bg */
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 0.85rem;
}

.pro-tip strong {
    display: block;
    color: var(--accent);
    margin-bottom: 4px;
}

.pro-tip p {
    color: rgba(255,255,255,0.8);
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .unit-converter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .converter-tool, .quick-reference {
        width: 100%;
    }
}