/**
 * LineToMars Investment Calculator Styles
 */

/* Reset and base styles for calculator */
.ltm-calculator-container * {
    box-sizing: border-box;
}

/* Enhanced animations and transitions */
.ltm-calculator-container {
    animation: ltm-fadeIn 0.6s ease-out;
    transition: all 0.3s ease;
}

@keyframes ltm-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improved focus states */
.ltm-number-input:focus,
.ltm-range-slider:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--ltm-accent-color-light);
}

/* Enhanced slider styling for better cross-browser compatibility */
.ltm-range-slider {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ltm-range-slider:hover {
    opacity: 0.8;
}

/* Firefox specific slider styles */
.ltm-range-slider::-moz-range-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    border: none;
}

.ltm-range-slider::-moz-range-progress {
    height: 8px;
    background: var(--ltm-accent-color);
    border-radius: 4px;
}

/* Enhanced result cards with better visual hierarchy */
.ltm-result-card {
    position: relative;
    overflow: hidden;
}

.ltm-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ltm-accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ltm-result-card:hover::before {
    transform: scaleX(1);
}

/* Loading states for dynamic updates */
.ltm-calculating {
    position: relative;
}

.ltm-calculating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--ltm-accent-color-light);
    border-top: 2px solid var(--ltm-accent-color);
    border-radius: 50%;
    animation: ltm-spin 1s linear infinite;
}

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

/* Validation message styling */
.ltm-validation-message {
    animation: ltm-slideIn 0.3s ease-out;
}

@keyframes ltm-slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced CTA button with pulse effect */
.ltm-cta-button {
    position: relative;
    overflow: hidden;
}

.ltm-cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ltm-cta-button:hover::before {
    width: 300px;
    height: 300px;
}

/* Accessibility improvements */
.ltm-calculator-container:focus-within {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ltm-calculator-container {
        border: 2px solid #000;
    }
    
    .ltm-result-card {
        border: 2px solid #000;
    }
    
    .ltm-number-input {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ltm-calculator-container,
    .ltm-result-card,
    .ltm-cta-button,
    .ltm-range-slider {
        animation: none;
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ltm-calculator-container {
        background: #1f2937;
        color: #f9fafb;
        border: 1px solid #374151;
    }
    
    .ltm-calculator-title {
        color: #f9fafb;
    }
    
    .ltm-calculator-subtitle {
        color: #d1d5db;
    }
    
    .ltm-input-label {
        color: #f3f4f6;
    }
    
    .ltm-number-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .ltm-number-input:focus {
        background: #4b5563;
        border-color: var(--ltm-accent-color);
    }
    
    .ltm-result-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .ltm-result-card:hover {
        background: #4b5563;
    }
    
    .ltm-result-title {
        color: #d1d5db;
    }
    
    .ltm-result-value {
        color: #f9fafb;
    }
    
    .ltm-range-slider {
        background: #4b5563;
    }
}

/* Print styles */
@media print {
    .ltm-calculator-container {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .ltm-range-slider,
    .ltm-cta-button {
        display: none;
    }
    
    .ltm-result-card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Small mobile devices */
@media (max-width: 320px) {
    .ltm-calculator-container {
        padding: 0.75rem;
        margin: 0.5rem;
    }
    
    .ltm-calculator-title {
        font-size: 1.25rem;
    }
    
    .ltm-calculator-subtitle {
        font-size: 1rem;
    }
    
    .ltm-results-grid {
        gap: 0.75rem;
    }
    
    .ltm-result-card {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .ltm-result-icon {
        margin: 0 auto 0.5rem auto;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .ltm-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .ltm-calculator-container {
        max-width: 900px;
        padding: 2.5rem;
    }
    
    .ltm-results-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .ltm-range-slider {
        height: 12px;
    }
    
    .ltm-range-slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
    }
    
    .ltm-range-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }
    
    .ltm-cta-button {
        padding: 1.25rem 2rem;
        font-size: 1.125rem;
    }
    

}

/* RTL language support */
[dir="rtl"] .ltm-currency-symbol {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .ltm-number-input {
    padding: 1rem 2.5rem 1rem 1rem;
}

[dir="rtl"] .ltm-result-card {
    direction: rtl;
}

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

.ltm-calculator-container *::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ltm-calculator-container *::-webkit-scrollbar-thumb {
    background: var(--ltm-accent-color);
    border-radius: 4px;
}

.ltm-calculator-container *::-webkit-scrollbar-thumb:hover {
    background: var(--ltm-accent-color-dark);
}

/* Error state styling */
.ltm-field-error-state {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Success state styling */
.ltm-field-success-state {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Loading overlay */
.ltm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ltm-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Tooltip styling */
.ltm-tooltip {
    position: relative;
    cursor: help;
}

.ltm-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.ltm-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
} 