/* Custom styles for Retirement Strategy Backtester */

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Glass morphism effect for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Animated gradient background for header */
.header-gradient {
    background: linear-gradient(-45deg, #ffffff, #f8fafc, #e2e8f0, #ffffff);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	margin-bottom: 1rem;
	color: white;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced tooltip styles */
.tooltip {
    position: absolute;
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(12px);
    max-width: 300px;
    z-index: 1000;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(-4px);
}

/* Strategy card enhancements */
.strategy-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    border: 2px solid transparent;
    padding: 16px 20px;
    margin: 8px 0;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.strategy-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(79, 70, 229, 0.3);
}

.strategy-card.selected {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(139, 92, 246, 0.1));
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.strategy-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.strategy-main {
    display: flex;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    gap: 12px;
}

.strategy-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 6px;
}

.strategy-title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

.strategy-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
    word-break: break-word;
}

.strategy-badge {
    flex-shrink: 0;
    white-space: nowrap;
    align-self: flex-start;
}

.strategy-description {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    padding: 0 12px;
}

.strategy-card.expanded .strategy-description {
    max-height: 200px;
    opacity: 1;
    padding: 12px 12px 4px 12px;
}

.strategy-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.strategy-toggle:hover {
    background: rgba(79, 70, 229, 0.2);
    transform: scale(1.1);
}

.strategy-toggle svg {
    width: 14px;
    height: 14px;
    fill: #4f46e5;
    transition: transform 0.3s ease;
}

.strategy-card.expanded .strategy-toggle svg {
    transform: rotate(180deg);
}

/* Bootstrap slider - enhanced track and thumb styling */
.form-range::-webkit-slider-thumb {
    background: linear-gradient(135deg, #a855f7, #c084fc) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 .2rem .5rem rgba(168, 85, 247, 0.4) !important;
}

.form-range::-moz-range-thumb {
    background: linear-gradient(135deg, #a855f7, #c084fc) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 .2rem .5rem rgba(168, 85, 247, 0.4) !important;
}

.form-range {
	&::-webkit-slider-runnable-track {
		background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
		height: 8px;
		border-radius: 4px;
	}
	&::-moz-range-track {
		background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
		height: 8px;
		border-radius: 4px;
	}
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem rgba(79, 70, 229, .25) !important;
}

.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem rgba(79, 70, 229, .25) !important;
}

/* Enhanced number input styles */
.slider-number-input {
    width: 130px;
    padding: 8px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    text-align: center;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slider-number-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.slider-number-input:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Control group styling */
.control-group {
    background: rgba(249, 250, 251, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-group:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Results card enhancements */
.results-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Metric cards */
.metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(249, 250, 251, 0.9));
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Enhanced loader styles */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-container {
    width: 90%;
    max-width: 480px;
    text-align: center;
    padding: 32px;
}

.progress-bar {
    width: 100%;
    background: linear-gradient(90deg, #e5e7eb, #f3f4f6);
    border-radius: 12px;
    overflow: hidden;
    height: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-inner {
    height: 16px;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #c084fc);
    background-size: 200% 100%;
    border-radius: 12px;
    transition: width 0.3s ease-out;
    animation: shimmer 2s infinite linear;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

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

/* Loading text enhancement */
#loader-text {
    color: #4b5563;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 16px;
    animation: pulse 2s infinite ease-in-out;
}

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

/* Responsive design improvements */
@media (max-width: 1280px) {
    .container {
        max-width: 6xl;
    }
}

@media (max-width: 1024px) {
    .strategy-card {
        padding: 14px 16px;
    }
    
    .strategy-toggle {
        width: 26px;
        height: 26px;
    }
    
    .strategy-toggle svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 768px) {
    .header-gradient {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .control-group {
        padding: 16px;
    }
    
    .slider-number-input {
        width: 100px;
        font-size: 12px;
    }
    
    .strategy-card {
        padding: 12px 16px;
        margin: 6px 0;
    }
    
    .strategy-name {
        font-size: 14px;
    }
    
    .strategy-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .strategy-toggle {
        width: 24px;
        height: 24px;
    }
    
    .strategy-toggle svg {
        width: 10px;
        height: 10px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .glass-card {
        padding: 20px;
    }
    
    .progress-container {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .metric-card .text-2xl {
        font-size: 1.5rem;
    }
    
    .strategy-main {
        gap: 8px;
    }
    
    .strategy-header {
        gap: 8px;
    }
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
input:focus,
button:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3730a3, #5b21b6);
}
