/* =========================================================
   IRS 6621 Interest Calculator - Premium Theme
   Style: Modern SaaS / Glassmorphism
   ========================================================= */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #0ea5e9;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(255, 255, 255, 0.3);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --input-bg: #ffffff;
    --accent: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Global improvements for this page */
body {
    font-family: 'Inter', -apple-system, sans-serif !important;
    background: var(--bg-gradient);
    min-height: 100vh;
}

/* Glassmorphism Card */
.calc-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 2rem auto;
    transition: transform 0.3s ease;
}

/* Grid Layout */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-end;
}

/* Interactive Labels */
.calc-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    opacity: 0.9;
}

/* Premium Inputs */
.calc-input,
.calc-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 1rem;
    height: 52px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.calc-input:hover,
.calc-select:hover {
    border-color: var(--secondary);
}

.calc-input:focus,
.calc-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

/* Custom Select Wrapper for better arrow */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.7rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Output Styling */
.calc-output-field {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
    color: #0369a1 !important;
    font-weight: 800;
}

/* Modern Results Summary */
.result-summary {
    display: flex;
    justify-content: space-around;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 2px dashed #e2e8f0;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-summary>div {
    flex: 1;
    text-align: center;
}

.result-item-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-item-value {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

/* Sophisticated Table */
.details-table-container {
    margin-top: 3rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.details-table th {
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 700;
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.details-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 0.925rem;
}

.details-table tr:hover td {
    background-color: #f1f5f9;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .calc-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .calc-card {
        padding: 1.5rem;
        margin: 1rem;
    }

    .result-summary {
        flex-direction: column;
        align-items: center;
    }

    .result-item-value {
        font-size: 1.75rem;
    }
}

/* Tooltip/Info Note */
.pfic-note {
    background: #eff6ff;
    border-left: 4px solid var(--secondary);
    padding: 1.25rem;
    border-radius: 0 12px 12px 0;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #1e40af;
}