:root {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    color: var(--dark-color);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

h1 {
    font-weight: 700;
}

.display-5 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Enhanced Navigation */
.navbar {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-color) !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-fast);
    transform: translateX(-50%);
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color) !important;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--light-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Modern Hero Section */
.bg-hero {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.bg-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(180deg);
    }
}

/* Enhanced Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    background: var(--gradient-card);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 2rem;
}

/* Modern Calculator Container */
.calculator-container {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Enhanced Calculator Tabs */
.calc-tab {
    cursor: pointer;
    transition: var(--transition-base);
    border: 2px solid var(--border-color);
    background: white;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.calc-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #3b82f6;
    transition: left 0.3s ease;
    z-index: 0;
}

.calc-tab:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #3b82f6;
}

.calc-tab.active {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.calc-tab.active::before {
    left: 0;
}

.calc-tab-content {
    position: relative;
    z-index: 1;
}

/* Mobile Tabbar Styles */
.mobile-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-tabs {
    padding: 0.75rem 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 70px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.mobile-tab i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-tab.active {
    background: #3b82f6 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.mobile-tab:hover:not(.active) {
    background: var(--light-color);
    color: #3b82f6;
}

/* Enhanced Form Controls */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition-base);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: white;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.input-group-text {
    border: 2px solid var(--border-color);
    border-radius: 12px 0 0 12px;
    background: var(--light-color);
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* Range Slider Styling */
.form-range {
    height: 8px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--value, 50%), var(--border-color) var(--value, 50%), var(--border-color) 100%);
    border-radius: 5px;
}

.form-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    cursor: grab;
}

.form-range::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

/* Enhanced Monthly Payment Display */
.monthly-payment-display {
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.monthly-payment-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.payment-amount {
    font-size: 3rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced Breakdown Items */
.breakdown-item {
    transition: var(--transition-base);
    border-left: 4px solid transparent;
    border-radius: 0 12px 12px 0;
    padding: 1rem 1.5rem;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.breakdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
    transition: var(--transition-base);
    z-index: 0;
}

.breakdown-item:hover {
    background: var(--light-color);
    border-left-color: var(--primary-color);
    transform: translateX(6px);
    box-shadow: var(--shadow-sm);
}

.breakdown-item:hover::before {
    width: 100%;
}

.breakdown-item span {
    position: relative;
    z-index: 1;
}

.list-group-item.bg-primary {
    background: var(--gradient-success) !important;
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Ad Space */
.ad-space {
    background: linear-gradient(45deg, #f8f8f8 25%, #f0f0f0 25%, #f0f0f0 50%, #f8f8f8 50%, #f8f8f8 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: #999;
    font-size: 0.875rem;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

.ad-space::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
    color: #aaa;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Amortization Table */
.amortization-table {
    max-height: 400px;
    overflow-y: auto;
}

.amortization-table::-webkit-scrollbar {
    width: 8px;
}

.amortization-table::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 4px;
}

.amortization-table::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Enhanced Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-base);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Enhanced Feature Cards */
.feature-card {
    transition: var(--transition-base);
    border: 2px solid transparent;
    height: 100%;
    background: var(--gradient-card);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.05), transparent);
    opacity: 0;
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

/* Loading Animation */
.loading-spinner {
    display: none;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
    }

    .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .payment-amount {
        font-size: 2rem;
    }

    .display-5 {
        font-size: 2.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .monthly-payment-display {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .calc-tab {
        padding: 1rem;
        border-radius: 10px;
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem !important;
        margin: 0.125rem;
    }

    .bg-hero {
        min-height: 50vh;
        padding: 3rem 0;
    }

    .feature-card {
        margin-bottom: 1.5rem;
    }

    .breakdown-item {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .calc-tab {
        padding: 0.75rem;
    }

    .calc-tab-icon {
        font-size: 1.5rem;
    }

    .calc-tab-title {
        font-size: 0.875rem;
    }

    .mobile-tab {
        min-width: 65px;
        padding: 0.4rem 0.6rem;
    }

    .mobile-tab i {
        font-size: 1.1rem;
    }

    .mobile-tab span {
        font-size: 0.7rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Smooth Scroll and Base Animations */
html {
    scroll-behavior: smooth;
}

/* Page Load Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animations to elements */
.card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.calc-tab {
    animation: scaleIn 0.4s ease-out forwards;
}

.feature-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.hero h1 {
    animation: slideInFromTop 0.8s ease-out forwards;
}

.hero p {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.monthly-payment-display {
    animation: scaleIn 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

/* Stagger animations for multiple items */
.calc-tab:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.calc-tab:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.calc-tab:nth-child(3) { animation-delay: 0.3s; opacity: 0; }
.calc-tab:nth-child(4) { animation-delay: 0.4s; opacity: 0; }

.feature-card:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.feature-card:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.feature-card:nth-child(3) { animation-delay: 0.3s; opacity: 0; }

/* Hover Animations */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    80% {
        transform: translateY(-2px);
    }
}

.feature-icon:hover {
    animation: bounce 0.6s ease;
}

/* Number Counter Animation */
@keyframes countUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.payment-amount {
    animation: countUp 0.8s ease-out;
}

/* Floating Action Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.calc-tab.active {
    animation: float 3s ease-in-out infinite;
}

/* Loading Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);
    background-size: 400% 400%;
    animation: gradientShift 6s ease infinite;
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: ripple 0.6s ease-out;
}

.btn-ripple:active::after {
    opacity: 1;
    animation: ripple 0.6s ease-out;
}

/* Enhanced Visual Effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.neumorph {
    background: #f0f0f0;
    border-radius: 20px;
    box-shadow: 20px 20px 60px #bebebe, -20px -20px 60px #ffffff;
}

.glow-effect {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transition: box-shadow 0.3s ease;
}

.glow-effect:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

/* Progress Indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
}

/* Micro Interactions */
.micro-bounce:hover {
    animation: micro-bounce 0.3s ease;
}

@keyframes micro-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.shake-on-error {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Focus States */
.focus-outline:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Scroll Indicators */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Tooltip Enhancements */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-custom::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip-custom:hover::before,
.tooltip-custom:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Table Styles */
.table-modern {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-modern thead th {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table-modern tbody tr {
    transition: var(--transition-base);
}

.table-modern tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(2px);
}

/* Advanced Gradients */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.gradient-border {
    position: relative;
    background: white;
    border-radius: 12px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: var(--gradient-primary);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
}

/* Status Indicators */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    animation: pulse-dot 2s infinite;
}

.status-dot.online {
    background: var(--success-color);
}

.status-dot.offline {
    background: var(--danger-color);
}

.status-dot.pending {
    background: var(--warning-color);
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-skeleton 1.5s infinite;
}

@keyframes loading-skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Animation Classes for JavaScript */
.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-in.calc-tab {
    animation: scaleIn 0.4s ease-out forwards;
}

.animate-in.feature-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Ripple Effect Styles */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Enhanced Focus States */
.focus-outline:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Dark Theme Support */
.dark-theme {
    --primary-color: #60a5fa;
    --dark-color: #f1f5f9;
    --light-color: #1e293b;
    --border-color: #374151;
    --text-muted: #94a3b8;
}

.dark-theme body {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: var(--dark-color);
}

.dark-theme .card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
}

.dark-theme .navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid var(--border-color);
}

.dark-theme .form-control,
.dark-theme .form-select {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-color);
    color: var(--dark-color);
}

.dark-theme .form-control:focus,
.dark-theme .form-select:focus {
    background: rgba(30, 41, 59, 1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .calc-tab.active {
        animation: none;
    }

    .bg-hero::before {
        animation: none;
    }

    .monthly-payment-display::before {
        animation: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --border-color: #000000;
        --text-muted: #000000;
    }

    .card {
        border: 2px solid #000000;
    }

    .btn-primary {
        background: #0000ff;
        border: 2px solid #000000;
    }
}

/* Print Styles Enhancement */
@media print {
    .no-print,
    .btn,
    .navbar,
    .hero,
    .scroll-indicator {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .monthly-payment-display {
        background: #f8f9fa !important;
        color: #000 !important;
        border: 2px solid #dee2e6 !important;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}




/* 添加到现有的 <style> 标签中 */

/* 利率表格动画 */
#rates-tbody tr {
    transition: all 0.3s ease;
}

#rates-tbody tr:hover {
    background-color: var(--light-color);
    transform: translateX(2px);
}

/* 刷新按钮样式 */
.btn-outline-primary:hover {
    transform: translateY(-1px);
}

/* 数据源标签样式 */
#rates-tbody small {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#rates-tbody tr:hover small {
    opacity: 1;
}

/* 加载状态动画 */
@keyframes pulse-loading {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading-rates {
    animation: pulse-loading 1.5s ease-in-out infinite;
}

/* 利率变化指示器 */
.text-danger,
.text-success {
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #rates .table-responsive {
        font-size: 0.9rem;
    }

    #rates-tbody small {
        font-size: 0.65rem !important;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 数据新鲜度指示器 */
.data-fresh {
    color: var(--secondary-color) !important;
}

.data-stale {
    color: var(--text-muted) !important;
}

.data-cached {
    color: var(--danger-color) !important;
}


/* 加载状态动画 */
@keyframes pulse-loading {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading-rates {
    animation: pulse-loading 1.5s ease-in-out infinite;
}

/* 数据源样式优化 */
#rates-tbody small {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#rates-tbody tr:hover small {
    opacity: 1;
}


/* 贷款方案比较工具样式 */

/* 比较表格样式 */
.comparison-table {
    font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

.comparison-table .scenario-header {
    text-align: center;
}

.comparison-table .scenario-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.comparison-table .scenario-meta {
    margin-top: 0.5rem;
}

.comparison-table .scenario-meta small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.comparison-table .btn-outline-light {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-color: rgba(255, 255, 255, 0.3);
}

.comparison-table .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 最佳选项卡片 */
.best-option-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.best-option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.best-option-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.best-option-card h6 {
    color: var(--bs-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.best-option-card p {
    color: var(--bs-secondary);
    font-size: 0.85rem;
    line-height: 1.3;
}

/* 保存方案按钮动画 */
#save-scenario-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#save-scenario-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

#save-scenario-btn:active {
    transform: translateY(0);
}

/* 导航栏比较按钮 */
.nav-link .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* 比较模态框样式 */
.modal-xl {
    max-width: 95%;
}

/* 图表容器 */
.card .card-header h6 {
    color: var(--bs-dark);
    font-weight: 600;
}

/* Toast 容器确保在最上层 */
.toast-container {
    z-index: 1060;
}

.toast {
    min-width: 300px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .comparison-table {
        font-size: 0.8rem;
    }

    .comparison-table .scenario-name {
        font-size: 0.75rem;
    }

    .comparison-table .scenario-meta small {
        font-size: 0.65rem;
    }

    .best-option-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .best-option-icon {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .modal-xl {
        max-width: 98%;
        margin: 0.5rem;
    }

    /* 移动端表格滚动 */
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
}

/* 表格突出显示 */
.table-warning {
    background-color: rgba(255, 193, 7, 0.1);
}

.table-warning td {
    font-weight: 600;
}

/* 空状态样式 */
.display-1 {
    font-size: 4rem;
    opacity: 0.3;
}

/* 场景数量徽章动画 */
.badge {
    transition: all 0.3s ease;
}

.nav-link:hover .badge {
    transform: scale(1.1);
}

/* 图表卡片样式 */
.card .card-body canvas {
    max-height: 250px;
}

/* 比较表格固定宽度确保对齐 */
.comparison-table th:first-child,
.comparison-table td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    border-right: 2px solid #dee2e6;
    font-weight: 600;
    z-index: 1;
}

.comparison-table thead th:first-child {
    background-color: var(--bs-dark);
    color: white;
}

/* 加载状态 */
.loading-comparison {
    opacity: 0.6;
    pointer-events: none;
}

/* 成功状态动画 */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

/* 方案卡片悬停效果 */
.scenario-header {
    transition: all 0.2s ease;
}

.scenario-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* 确保图标正确显示 */
.ri-scales-line,
.ri-bookmark-line,
.ri-close-line,
.ri-download-line,
.ri-delete-bin-line,
.ri-trophy-line,
.ri-check-line,
.ri-error-warning-line,
.ri-information-line {
    font-style: normal;
    vertical-align: middle;
}

/* 导出按钮样式 */
.modal-footer .btn {
    min-width: 120px;
}

/* 比较内容区域 */
#comparison-content {
    min-height: 400px;
}

/* 表格头部样式增强 */
.table-dark th {
    border-color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 数值突出显示 */
.comparison-table td:not(:first-child) {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
    font-weight: 500;
}

/* 比较分析卡片 */
.card.border-success .card-header {
    background: linear-gradient(135deg, #198754, #20c997);
}

/* 工具提示样式 */
[title] {
    cursor: help;
}

/* 平滑过渡 */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}



/* 财务健康评估样式 */

/* 评估步骤样式 */
.assessment-step {
    min-height: 400px;
}

.step-content {
    padding: 1rem 0;
}

.step-content h6 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* 健康评分圆圈 */
.health-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #28a745 0deg calc(var(--score, 75) * 3.6deg), #e9ecef calc(var(--score, 75) * 3.6deg) 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.health-score-circle::before {
    content: '';
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    z-index: 1;
    position: relative;
}

.score-label {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 0.25rem;
    z-index: 1;
    position: relative;
}

/* 小版本的评分圆圈 */
.score-circle.small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #007bff 0deg calc(var(--score, 75) * 3.6deg), #e9ecef calc(var(--score, 75) * 3.6deg) 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle.small::before {
    content: '';
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.score-circle.small span {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    z-index: 1;
    position: relative;
}

/* 分类卡片样式 */
.category-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.good {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9, #ffffff);
}

.category-card.fair {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffbf0, #ffffff);
}

.category-card.poor {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5, #ffffff);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.category-header h6 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.category-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.category-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.category-status {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.category-card.good .category-status {
    color: #28a745;
}

.category-card.fair .category-status {
    color: #ffc107;
}

.category-card.poor .category-status {
    color: #dc3545;
}

.category-status i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* 推荐建议样式 */
.recommendations {
    margin-top: 2rem;
}

.recommendation-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

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

.recommendation-card.priority-high {
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #fff5f5, #ffffff);
}

.recommendation-card.priority-medium {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffbf0, #ffffff);
}

.recommendation-card.priority-low {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff9, #ffffff);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rec-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rec-priority {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.rec-priority.priority-high {
    background: #dc3545;
    color: white;
}

.rec-priority.priority-medium {
    background: #ffc107;
    color: #212529;
}

.rec-priority.priority-low {
    background: #28a745;
    color: white;
}

.recommendation-card h6 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.recommendation-card p {
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.rec-actions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rec-actions li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
    line-height: 1.4;
}

.rec-actions li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* 准备度评分 */
.readiness-score {
    text-align: center;
}

/* 进度条样式增强 */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* 表单样式增强 */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #17a2b8;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    font-weight: 500;
}

/* 健康小部件样式 */
.card.border-info .card-body {
    background: linear-gradient(135deg, #f0f9ff, #ffffff);
}

.card.border-info .card-title {
    color: #0dcaf0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .health-score-circle {
        width: 100px;
        height: 100px;
    }

    .health-score-circle::before {
        width: 75px;
        height: 75px;
    }

    .score-value {
        font-size: 1.5rem;
    }

    .score-label {
        font-size: 0.7rem;
    }

    .category-card {
        margin-bottom: 1rem;
    }

    .recommendation-card {
        padding: 1rem;
    }

    .rec-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .score-circle.small {
        width: 60px;
        height: 60px;
    }

    .score-circle.small::before {
        width: 45px;
        height: 45px;
    }

    .score-circle.small span {
        font-size: 1rem;
    }
}

/* 模态框样式增强 */
#healthAssessmentModal .modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#healthAssessmentModal .modal-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

#healthAssessmentModal .modal-body {
    padding: 1.5rem;
}

#healthAssessmentModal .modal-footer {
    border-top: 1px solid #e9ecef;
    align-items: center;
    gap: 1rem;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.assessment-step:not(.d-none) {
    animation: fadeInUp 0.4s ease-out;
}

.recommendation-card,
.category-card {
    animation: fadeInUp 0.4s ease-out;
}

/* 健康状态指示器 */
.health-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.health-indicator.good {
    background-color: #28a745;
}

.health-indicator.fair {
    background-color: #ffc107;
}

.health-indicator.poor {
    background-color: #dc3545;
}

/* 工具提示增强 */
[data-bs-toggle="tooltip"] {
    cursor: help;
    border-bottom: 1px dotted #6c757d;
}

/* 分数动态颜色 */
.health-score-circle {
    --score: 75;
}

.health-score-circle[data-score="100"] {
    --score: 100;
}

.health-score-circle[data-score="90"] {
    --score: 90;
}

.health-score-circle[data-score="80"] {
    --score: 80;
}

.health-score-circle[data-score="70"] {
    --score: 70;
}

.health-score-circle[data-score="60"] {
    --score: 60;
}

.health-score-circle[data-score="50"] {
    --score: 50;
}

.health-score-circle[data-score="40"] {
    --score: 40;
}

.health-score-circle[data-score="30"] {
    --score: 30;
}

.health-score-circle[data-score="20"] {
    --score: 20;
}

.health-score-circle[data-score="10"] {
    --score: 10;
}

/* 成功状态 */
.success-message {
    background: linear-gradient(135deg, #d1edff, #ffffff);
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
}

.success-message .icon {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 0.5rem;
}

/* 加载状态 */
.loading-assessment {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}