/**
 * Gratus Investments - Custom Styles
 * Modern, corporate design for investment platform
 */

:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --secondary-gray: #6b7280;
    --light-gray: #f9fafb;
    --border-gray: #e5e7eb;
    --text-dark: #111827;
    --success-green: #10b981;
    --danger-red: #ef4444;
}

body, html {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--border-gray);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gray);
}

/* Card styles matching the calculator design */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-gray);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Stock card styles */
.stock-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-gray);
    transition: all 0.2s ease;
    cursor: pointer;
}

.stock-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Price movement indicators */
.price-up {
    color: var(--success-green);
}

.price-down {
    color: var(--danger-red);
}

.price-neutral {
    color: var(--secondary-gray);
}

/* Button styles */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: white;
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid var(--border-gray);
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--light-gray);
}

/* Input styles */
.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    outline: none;
    -moz-appearance: textfield;
}

.input-field:focus {
    border-color: var(--primary-blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.input-field::placeholder {
    color: #c4c9d4;
    font-size: 13px;
}

/* Remove number spinner arrows */
.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Label styles */
.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* ── Calculator-specific label override — tighter, uppercase ── */
.calc-inputs-grid .input-label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

/* Input group: wraps an input to host a prefix or suffix decorator */
.input-group {
    position: relative;
}

.input-group .input-field {
    width: 100%;
}

.input-prefix,
.input-suffix {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    pointer-events: none;
    user-select: none;
    transition: color 0.18s ease;
    line-height: 1;
}

.input-prefix { left: 13px; }
.input-suffix { right: 13px; }

/* Shift input text to make room for decorator */
.input-field.has-prefix { padding-left: 28px; }
.input-field.has-suffix { padding-right: 32px; }

/* Highlight decorator when the input is active */
.input-group:focus-within .input-prefix,
.input-group:focus-within .input-suffix {
    color: var(--primary-blue);
}

/* Sidebar styles */
.sidebar {
    background: white;
    border-right: 1px solid var(--border-gray);
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    width: 260px;
    top: 0;
    left: 0;
    z-index: 90;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-item i {
    width: 20px;
    text-align: center;
}

.sidebar-item:hover {
    background-color: #eff6ff;
    color: var(--primary-blue);
    border-left-color: #93c5fd;
}

.sidebar-item.active {
    background-color: #eff6ff;
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
}

/* Navbar styles */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border-gray);
    height: 64px;
    position: fixed;
    width: calc(100vw - 260px);
    max-width: calc(100vw - 260px);
    top: 0;
    left: 260px;
    right: 0;
    z-index: 100;
    overflow: visible !important;
    box-sizing: border-box;
}

.navbar > div {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Modal overlays must sit above sidebar (z:90) and navbar (z:100) */
.fixed.inset-0.z-50 {
    z-index: 200 !important;
}

#user-dropdown {
    z-index: 99999 !important;
    right: 0 !important;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    display: none;
    min-width: 224px;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    padding: 8px 0 !important;
}

#user-dropdown.hidden {
    display: none !important;
}

#user-dropdown:not(.hidden) {
    display: block !important;
}

#user-menu-container {
    position: relative !important;
    z-index: 1001 !important;
    overflow: visible !important;
}

#user-menu-button {
    cursor: pointer !important;
}

/* Ensure dropdown items are visible and clickable */
#user-dropdown a {
    display: flex !important;
    align-items: center !important;
    padding: 8px 16px !important;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: background-color 0.2s !important;
}

#user-dropdown a:hover {
    background-color: #f9fafb !important;
}

#user-dropdown a:last-child {
    color: #dc2626 !important;
}

#user-dropdown a:last-child:hover {
    background-color: #fef2f2 !important;
}

/* Main content area */
.main-content {
    margin-left: 260px;
    margin-top: 64px;
    padding: 24px;
    min-height: calc(100vh - 64px);
    background-color: var(--light-gray);
}

/* Market status badge */
.market-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.market-status.open {
    background-color: #d1fae5;
    color: #065f46;
}

.market-status.closed {
    background-color: #fee2e2;
    color: #991b1b;
}

.market-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-gray);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table styles */
.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-gray);
}

.data-table thead {
    background-color: var(--light-gray);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-gray);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gray);
    font-size: 14px;
}


.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 110;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .navbar {
        width: 100vw;
        max-width: 100vw;
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Toggle Checkbox Styles */
.toggle-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 48px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
    outline: none;
}

.toggle-checkbox:checked {
    background-color: var(--primary-blue);
}

.toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked::before {
    transform: translateX(24px);
}

.toggle-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Calculator Navigation Sidebar */
.calculator-nav {
    position: fixed;
    right: 24px;
    top: 180px;
    width: 220px;
    max-height: calc(100vh - 208px);
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-gray);
    z-index: 50;
    transition: all 0.3s ease;
    overflow: hidden;
}

.calculator-nav-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    color: var(--primary-blue);
    font-size: 14px;
    flex-shrink: 0;
}

.calculator-nav-links {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    flex: 1;
}

/* Nav group labels (Core / Portfolio / Advanced) */
.calc-nav-group {
    padding: 10px 8px 4px;
    margin-top: 4px;
}

.calc-nav-group:first-child {
    margin-top: 0;
    padding-top: 4px;
}

.calc-nav-group-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
}

.calc-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--secondary-gray);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    position: relative;
}

.calc-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.calc-nav-link:hover {
    background-color: var(--light-gray);
    color: var(--text-dark);
}

.calc-nav-link:hover i {
    color: var(--primary-blue);
}

.calc-nav-link.active {
    background-color: #eff6ff;
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    font-weight: 600;
}

.calc-nav-link.active i {
    color: var(--primary-blue);
}

.calc-nav-link.active::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-blue);
    opacity: 0.5;
}

/* Calculator Sections */
.calculator-sections {
    max-width: calc(100% - 260px);
    margin-right: 260px;
}

.calculator-section {
    display: none;
}

.calculator-section.active {
    display: block;
    animation: calcSectionIn 0.35s ease forwards;
}

@keyframes calcSectionIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    padding: 20px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #f8faff 0%, #f4f7ff 100%);
    border-radius: 12px;
    border: 1px solid #e8edf8;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .calculator-nav {
        width: 200px;
        right: 16px;
        top: 180px;
        max-height: calc(100vh - 208px);
    }

    .calculator-sections {
        margin-right: 220px;
    }
}

@media (max-width: 1200px) {
    .calculator-nav {
        display: none;
    }

    .calculator-sections {
        max-width: 100%;
        margin-right: 0;
    }

    .calculator-section {
        scroll-margin-top: 88px;
    }
}

/* ============================================================
   Calculator Card — corporate single-card layout
   ============================================================ */
.calc-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px 32px 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    margin-top: 20px;
    transition: box-shadow 0.3s ease;
}

.calc-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.calc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calc-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-card-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4b5563;
}

.calc-card-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--primary-blue);
    border-radius: 2px;
    flex-shrink: 0;
}

.calc-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    line-height: 1;
}

.calc-reset-btn .fa-undo {
    transition: transform 0.45s ease;
    color: #9ca3af;
}

.calc-reset-btn:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
    box-shadow: 0 1px 4px rgba(220,38,38,0.1);
}

.calc-reset-btn:hover .fa-undo {
    transform: rotate(-360deg);
    color: #dc2626;
}

.calc-reset-btn:active {
    transform: scale(0.95);
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Inputs Grid */
.calc-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
}

.calc-input-full {
    grid-column: 1 / -1;
    max-width: calc(50% - 12px);
}

@media (min-width: 1024px) {
    .calc-inputs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .calc-input-full {
        grid-column: span 2;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .calc-inputs-grid {
        grid-template-columns: 1fr;
    }
    .calc-input-full {
        max-width: 100%;
        grid-column: 1 / -1;
    }
    .calc-card {
        padding: 20px 16px 24px;
    }
}

/* ============================================================
   Results Section
   ============================================================ */
.calc-results {
    display: none;
    opacity: 0;
}

.calc-results.visible {
    display: block;
    animation: calcResultsReveal 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes calcResultsReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Divider with "Results" label */
.calc-results-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0 24px;
}

.calc-results-divider::before,
.calc-results-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.calc-results-divider span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-blue);
    white-space: nowrap;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Primary Result — large prominent metric */
.calc-primary-result {
    text-align: center;
    padding: 28px 24px;
    background: linear-gradient(135deg, #eef4ff 0%, #e8f0fe 100%);
    border-radius: 12px;
    border: 1px solid #c7d9f8;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(37,99,235,0.07);
}

.calc-primary-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1d4ed8, #60a5fa, #818cf8);
    border-radius: 12px 12px 0 0;
}

.calc-primary-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 10px;
}

.calc-primary-value {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.025em;
    color: #111827;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Secondary Results Grid */
.calc-secondary-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.calc-secondary-item {
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    border-left: 3px solid #e5e7eb;
    transition: background 0.2s ease, border-color 0.2s ease, border-left-color 0.2s ease;
}

.calc-secondary-item:hover {
    background: #f3f6fb;
    border-color: #e0e7ef;
    border-left-color: var(--primary-blue);
}

.calc-secondary-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    margin-bottom: 6px;
}

.calc-secondary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

/* Chart Container */
.calc-chart-container {
    margin-top: 4px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    height: 220px;
    position: relative;
}

/* Info / Warning Notes */
.calc-note {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.calc-note-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.calc-note-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Inline hint text below individual input fields */
.input-hint {
    font-size: 11px;
    color: var(--primary-blue);
    margin-top: 5px;
    opacity: 0.75;
}

/* ============================================================
   Calculator Page Header Bar
   ============================================================ */
.calc-header-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 14px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.calc-header-divider {
    width: 1px;
    height: 32px;
    background: var(--border-gray);
    flex-shrink: 0;
}

.calc-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calc-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.calc-header-badge em {
    font-style: normal;
    font-weight: 700;
    opacity: 0.8;
}

.calc-header-badge.badge-blue {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.calc-header-badge.badge-emerald {
    background: #ecfdf5;
    color: #059669;
    border-color: #d1fae5;
}

.calc-header-badge.badge-purple {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ede9fe;
}

.calc-header-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.calc-header-print-btn:hover {
    background: #eff6ff;
    color: var(--primary-blue);
    border-color: #bfdbfe;
}

/* ============================================================
   Export / Print Button
   ============================================================ */
.calc-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 13px;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-export-btn:hover {
    color: #ffffff;
    background: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
}

/* ============================================================
   Mobile Calculator Navigation (below 1200px)
   ============================================================ */
.calc-mobile-nav {
    display: none;
}

@media (max-width: 1200px) {
    .calc-mobile-nav {
        display: block;
    }
}

.calc-mobile-nav-inner {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-gray);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.calc-mobile-nav-group {
    margin-bottom: 12px;
}

.calc-mobile-nav-group:last-child {
    margin-bottom: 0;
}

.calc-mobile-group-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-bottom: 8px;
    padding-left: 4px;
}

.calc-mobile-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.calc-mobile-pills::-webkit-scrollbar {
    display: none;
}

.calc-mobile-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: var(--light-gray);
    border: 1px solid var(--border-gray);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.calc-mobile-pill i {
    font-size: 11px;
}

.calc-mobile-pill:hover {
    background: #eff6ff;
    color: var(--primary-blue);
    border-color: #bfdbfe;
}

.calc-mobile-pill.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    font-weight: 600;
}

/* ============================================================
   Micro-interactions
   ============================================================ */

/* Shimmer sweep across calc-card on recalculate */
.calc-card.calculating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(37, 99, 235, 0.03) 50%, transparent 100%);
    animation: calcShimmer 0.8s ease;
    pointer-events: none;
    border-radius: 12px;
}

.calc-card {
    position: relative;
}

@keyframes calcShimmer {
    0%   { left: -100%; }
    100% { left: 100%; }
}

/* Value pulse on result update */
.calc-primary-value.result-updated,
.calc-secondary-value.result-updated {
    animation: resultPulse 0.4s ease;
}

@keyframes resultPulse {
    0%   { opacity: 0.5; transform: scale(0.97); }
    60%  { opacity: 1;   transform: scale(1.01); }
    100% { opacity: 1;   transform: scale(1); }
}

/* Reset button spin */
.calc-reset-btn.resetting .fa-undo {
    animation: resetSpin 0.5s ease;
}

@keyframes resetSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .sidebar,
    .navbar,
    .calculator-nav,
    .calc-mobile-nav,
    .calc-reset-btn,
    .calc-export-btn,
    #calc-export-all-btn,
    .calc-results-divider {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 20px !important;
    }

    .calculator-sections {
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    .calc-card {
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ============================================================
   Small-screen responsive overrides
   ============================================================ */
@media (max-width: 768px) {
    .calc-header-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .calc-header-divider {
        display: none;
    }

    .calc-header-badges {
        order: 3;
        width: 100%;
    }

    .calc-header-print-btn {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .calc-inputs-grid {
        grid-template-columns: 1fr;
    }

    .calc-input-full {
        max-width: 100%;
        grid-column: 1 / -1;
    }

    .calc-card {
        padding: 20px 16px 24px;
    }

    .calc-primary-value {
        font-size: 2rem;
    }

    .calc-secondary-grid {
        grid-template-columns: 1fr !important;
    }

    .section-header .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
