/* Reset et variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    background: var(--surface-color);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.header-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

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

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main content */
.main-content {
    margin-bottom: 40px;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Input section */
.input-section {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.input-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-section h2 i {
    color: var(--primary-color);
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group label i {
    color: var(--primary-color);
    width: 16px;
}

.input-group input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface-color);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.input-group .currency {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
}

.calculate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

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

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

/* Results section */
.results-section {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.results-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-section h2 i {
    color: var(--primary-color);
}

.result-cards {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 2px solid transparent;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-card.total {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    border-color: var(--accent-color);
}

.result-card.invested {
    background: linear-gradient(135deg, #dbeafe, #3b82f6);
    border-color: var(--primary-color);
}

.result-card.gains {
    background: linear-gradient(135deg, #d1fae5, #10b981);
    border-color: var(--secondary-color);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.card-content h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.card-content p {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart container */
.chart-container {
    margin: 30px 0;
    padding: 20px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Evolution table */
.breakdown {
    margin-top: 30px;
}

.breakdown h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breakdown h3 i {
    color: var(--primary-color);
}

.evolution-table {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.evolution-table table {
    width: 100%;
    border-collapse: collapse;
}

.evolution-table th,
.evolution-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.evolution-table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
}

.evolution-table td {
    color: var(--text-secondary);
}

.evolution-table tr:hover {
    background: var(--background-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        padding: 30px 20px;
    }
    
    .input-section,
    .results-section {
        padding: 20px;
    }
    
    .result-cards {
        gap: 15px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .card-content p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header-icon {
        font-size: 2.5rem;
    }
    
    .input-section h2,
    .results-section h2 {
        font-size: 1.3rem;
    }
    
    .calculate-btn {
        padding: 15px;
        font-size: 1rem;
    }
}

/* Animation pour les résultats */
.result-card {
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

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

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

