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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0d1421;
    color: #e8eaed;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.calculator-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2d3748;
}

.calculator-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #e8eaed;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calculator-header h1 i {
    color: #00d4aa;
    font-size: 1.25rem;
}

.calculator-header p {
    font-size: 0.9rem;
    color: #a0aec0;
    margin: 0;
}

.calculator-card, .summary-card, .chart-card, .table-controls {
    background: #1a202c;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: 1px solid #2d3748;
    transition: all 0.3s ease;
}

.calculator-card:hover, .summary-card:hover, .chart-card:hover, .table-controls:hover {
    border-color: #00d4aa;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.1);
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #e8eaed;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #4a5568;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #2d3748;
    color: #e8eaed;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d4aa;
    background: #1a202c;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.btn-primary {
    background: #00d4aa;
    color: #1a202c;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: #00c499;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.results-section {
    animation: fadeInUp 0.6s ease-out;
}

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

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.summary-item {
    position: relative;
    text-align: left;
    padding: 1.5rem;
    background: #2d3748;
    border-radius: 8px;
    border: 1px solid #4a5568;
    transition: all 0.3s ease;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #00d4aa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-item:hover::before {
    opacity: 1;
}

.summary-item:hover {
    border-color: #00d4aa;
    background: #1a202c;
}

.summary-item.highlight-card {
    background: linear-gradient(135deg, #00d4aa 0%, #00c499 100%);
    color: #ffffff;
    border-color: #00d4aa;
}

.summary-item.highlight-card .label {
    color: rgba(255, 255, 255, 0.9);
}

.summary-item.highlight-card .value {
    color: #ffffff;
}

.summary-item.highlight-card .value.highlight {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
}

.summary-item.highlight-card .growth-indicator {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.summary-item.highlight-card .summary-icon.final {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #4a5568;
    color: #00d4aa;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.summary-icon.growth {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

.summary-icon.final {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.summary-item:hover .summary-icon {
    transform: scale(1.1);
}

.summary-item .label {
    display: block;
    font-size: 0.8rem;
    color: #cbd5e0;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item .value {
    display: block;
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffffff;
}

.summary-item .value.highlight {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
}

.growth-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 212, 170, 0.15);
    border-radius: 4px;
    color: #00d4aa;
    font-weight: 600;
    font-size: 0.8rem;
}

.growth-indicator i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

.sparkline {
    height: 24px;
    margin-top: 1rem;
    background: rgba(74, 85, 104, 0.3);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.sparkline::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4aa, transparent);
    transform: translateY(-50%);
    animation: sparklineGlow 2s ease-in-out infinite;
}

@keyframes sparklineGlow {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(-50%) scaleX(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scaleX(1);
    }
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    color: #e8eaed;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-card h3 i {
    color: #00d4aa;
}

.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
    background: #2d3748;
    border-radius: 8px;
    border: 1px solid #4a5568;
}

.table-controls {
    background: #1a202c;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: 1px solid #2d3748;
}

.table-controls h2 {
    margin-bottom: 1.5rem;
    color: #e8eaed;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-controls h2 i {
    color: #00d4aa;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
}

.view-toggle {
    display: flex;
    gap: 0;
    background: #2d3748;
    padding: 0;
    border-radius: 4px;
    border: 1px solid #4a5568;
}

.toggle-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #a0aec0;
    font-size: 0.9rem;
}

.toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.toggle-btn.active {
    background: #00d4aa;
    color: #1a202c;
    font-weight: 600;
}

.toggle-btn:hover:not(.active) {
    background: #4a5568;
    color: #e8eaed;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-selector label {
    font-weight: 500;
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.year-selector label i {
    color: #00d4aa;
}

.year-selector select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #4a5568;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #2d3748;
    color: #e8eaed;
}

.table-container {
    background: #1a202c;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #2d3748;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#results-table th {
    background: #2d3748;
    color: #e8eaed;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    border-bottom: 1px solid #4a5568;
}

#results-table th i {
    margin-right: 0.5rem;
    color: #00d4aa;
}

#results-table td {
    padding: 1rem;
    border-bottom: 1px solid #2d3748;
    transition: all 0.2s ease;
    position: relative;
    background: #1a202c;
}

#results-table tr:hover {
    background: #2d3748;
}

#results-table tr:hover td {
    color: #e8eaed;
    background: #2d3748;
}

#results-table tr:last-child td {
    border-bottom: none;
}

.currency {
    font-weight: 600;
    color: #e8eaed;
    position: relative;
}

.currency::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    width: 2px;
    height: 0;
    background: #00d4aa;
    transform: translateY(-50%);
    transition: height 0.3s ease;
    border-radius: 1px;
}

tr:hover .currency::before {
    height: 60%;
}

.positive {
    color: #00d4aa;
    font-weight: 600;
    position: relative;
}

.positive::after {
    content: '↗';
    margin-left: 0.5rem;
    color: #00d4aa;
    animation: pulse 2s infinite;
    font-size: 0.8rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.negative {
    color: #ef4444;
}

.growth-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
    margin-top: 0.25rem;
    animation: slideIn 0.5s ease-out;
    white-space: nowrap;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

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

#results-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

.summary-item .value.growth-value {
    color: #00d4aa;
}

.chart-card {
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #00d4aa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.validation-message {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    color: #fca5a5;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
}

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .calculator-form {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .year-selector {
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    #results-table {
        min-width: 600px;
    }
    
    .calculator-card, .summary-card, .table-controls, .chart-card {
        padding: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .calculator-card, .summary-card, .table-controls, .chart-card {
        padding: 1rem;
    }
    
    .summary-item {
        padding: 1.5rem 1rem;
    }
    
    .summary-item .value {
        font-size: 1.5rem;
    }
    
    .summary-item .value.highlight {
        font-size: 1.7rem;
    }
    
    .summary-grid {
        gap: 0.75rem;
    }
    
    .charts-section {
        gap: 0.75rem;
    }
    
    .chart-container {
        height: 200px;
        padding: 0.5rem;
    }
    
    .toggle-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}
