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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Variables CSS dynamiques pour les couleurs de startup */
.startup-theme {
    --startup-primary: #6366f1;
    --startup-secondary: #8b5cf6;
    --startup-accent: #f59e0b;
    --startup-gradient: linear-gradient(135deg, var(--startup-primary), var(--startup-secondary));
    --startup-bg-pattern: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
                         radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 50%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--startup-gradient, linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%));
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    color: var(--text-color);
    transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--startup-bg-pattern);
    pointer-events: none;
    z-index: -1;
    transition: background 0.8s ease;
}

/* Animation de changement de thème */
body.theme-changing {
    animation: themeTransition 1s ease-in-out;
}

@keyframes themeTransition {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; transform: scale(1.02); }
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.generator-section {
    text-align: center;
    margin-bottom: 3rem;
}

.generate-button {
    background: linear-gradient(135deg, var(--accent-color) 0%, #f97316 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.generate-button:active {
    transform: translateY(0);
}

.result-section {
    margin-bottom: 2rem;
}

.startup-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: slideIn 0.5s ease-out, cardGlow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.startup-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--startup-gradient);
    animation: gradientShift 4s ease-in-out infinite;
}

.startup-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--startup-primary), transparent);
    opacity: 0.1;
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes cardGlow {
    0%, 100% { 
        box-shadow: var(--shadow); 
    }
    50% { 
        box-shadow: 0 15px 40px rgba(var(--startup-primary), 0.3); 
    }
}

@keyframes gradientShift {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.startup-logo {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
    display: block;
    animation: bounce 2s infinite;
}

.startup-name {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.startup-info {
    display: grid;
    gap: 1.5rem;
}

.info-item {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.info-item:nth-child(2) { border-left-color: var(--secondary-color); }
.info-item:nth-child(3) { border-left-color: var(--accent-color); }
.info-item:nth-child(4) { border-left-color: #10b981; }

.info-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.info-content {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.action-btn {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: white;
    opacity: 0.8;
}

/* Nouveaux styles pour les fonctionnalités avancées */

/* Indicateur de valuation */
.valuation-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--startup-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

/* Mode sombre/clair */
body.dark-theme {
    --text-color: #f9fafb;
    --bg-color: #111827;
    --card-bg: #1f2937;
    --startup-gradient: linear-gradient(135deg, #374151, #1f2937);
}

body.dark-theme .startup-card {
    background: var(--card-bg);
    color: var(--text-color);
}

body.dark-theme .info-item {
    background: #374151;
    color: var(--text-color);
}

body.dark-theme header,
body.dark-theme footer {
    color: #f9fafb;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme .theme-toggle {
    background: rgba(0, 0, 0, 0.3);
    color: #f9fafb;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    background: rgba(255, 255, 255, 0.3);
}

body.dark-theme .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Générateur de logo SVG */
.logo-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: block;
}

/* Statistiques en temps réel */
.stats-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1rem;
    color: white;
    font-size: 0.8rem;
    max-width: 200px;
    z-index: 100;
}

/* Mode présentation */
.presentation-mode .startup-card {
    transform: scale(1.1);
    margin: 2rem auto;
    max-width: 600px;
}

.presentation-mode header,
.presentation-mode .generator-section,
.presentation-mode .actions,
.presentation-mode footer {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

/* Effets de particules */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--startup-primary);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.5;
    }
}

/* Animation de typing pour le nom */
.startup-name.typing {
    overflow: hidden;
    border-right: 3px solid var(--startup-primary);
    white-space: nowrap;
    animation: typing 2s steps(20) 1s 1 normal both, blink 1s infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Histogramme de performance */
.performance-chart {
    display: flex;
    gap: 5px;
    margin: 1rem 0;
    height: 30px;
    align-items: end;
}

.chart-bar {
    background: var(--startup-gradient);
    min-width: 20px;
    border-radius: 3px 3px 0 0;
    animation: growBar 1s ease-out forwards;
    transform: scaleY(0);
    transform-origin: bottom;
}

@keyframes growBar {
    to { transform: scaleY(1); }
}

/* Shake effect pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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



/* Responsive amélioré */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .startup-name {
        font-size: 2rem;
    }
    
    .startup-card {
        padding: 1.5rem;
    }
    
    .actions {
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .stats-panel {
        position: relative;
        margin: 1rem 0;
        left: auto;
        bottom: auto;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .valuation-badge {
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin: 1rem 0;
    }
}

/* Styles pour les options du générateur */
.generator-options {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.generator-options .action-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.generator-options .action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

#presentation-mode {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#presentation-mode:hover {
    background: #4f46e5;
}

/* Animations pour la crise économique */
@keyframes crisisAlert {
    0% { 
        opacity: 0; 
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

@keyframes fallDown {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Mode crise pour les startups */
.startup-card.crisis-mode {
    border: 2px solid #ef4444 !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    animation: cardGlow 1s ease-in-out infinite, shake 0.5s ease-in-out;
}

.crisis-indicator {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}

/* Effets de particules de crise */
.crisis-particle {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: fallDown 3s ease-in forwards;
}

/* Animation de baisse des barres de performance */
.chart-bar.declining {
    background: linear-gradient(to top, #ef4444, #dc2626) !important;
    animation: declineBar 1s ease-out;
}

@keyframes declineBar {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

/* Alerte de notification */
.economic-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
    animation: slideInRight 0.5s ease, pulse 2s infinite 0.5s;
    z-index: 999;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Styles pour les modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-color);
}

.modal-body {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 120px;
}

.modal-btn.crisis-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.modal-btn.crisis-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
}

.modal-btn.success-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.modal-btn.success-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

.modal-btn.warning-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.modal-btn.warning-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
}

/* Styles pour les éléments de crise */
.crisis-content {
    text-align: left;
}

.crisis-breakdown {
    background: var(--bg-color);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.crisis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.crisis-item.total {
    border-bottom: none;
    font-weight: bold;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--primary-color);
}

.crisis-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 1px solid #ef4444;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

/* Couleurs pour les valeurs */
.positive { color: #10b981; font-weight: bold; }
.negative { color: #ef4444; font-weight: bold; }
.warning { color: #f59e0b; font-weight: bold; }
.success { color: #10b981; font-weight: bold; }
.highlight { color: var(--primary-color); font-weight: bold; }

/* Styles pour les éléments de sauvetage */
.rescue-success-content,
.rescue-failure-content {
    text-align: left;
}

.rescue-details,
.failure-details {
    background: var(--bg-color);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.rescue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.rescue-item:last-child {
    border-bottom: none;
}

.rescue-message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border: 1px solid #10b981;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mode sombre pour les modales */
body.dark-theme .modal-content {
    background: var(--card-bg);
    color: var(--text-color);
}

body.dark-theme .crisis-breakdown,
body.dark-theme .rescue-details,
body.dark-theme .failure-details {
    background: #374151;
}

body.dark-theme .crisis-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Responsive pour les modales */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}
