/* Variables CSS globales */
:root {
    --primary-gradient: linear-gradient(135deg, #6B73FF 0%, #000DFF 100%);
    --accent-gradient: linear-gradient(135deg, #6B73FF 0%, #9B59B6 100%);
    --primary-color: #6B73FF;
    --secondary-color: #9B59B6;
    --background-dark: rgba(40, 40, 40, 0.85);
    --background-light: rgba(60, 60, 60, 0.6);
    --border-color: rgba(107, 115, 255, 0.3);
    --text-primary: #fff;
    --text-secondary: #ddd;
    --text-muted: #aaa;
    --error-color: #ff6b6b;
    --success-color: #66bb6a;
    --warning-color: #ffa726;
    --shadow-primary: 0 8px 32px rgba(107, 115, 255, 0.3);
    --shadow-hover: 0 12px 48px rgba(107, 115, 255, 0.4);
    --border-radius: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    background-image: url('/images/Background.webp');
    background-size: cover;
    background-position: right center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    height: 100vh;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* Loading overlay commun */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    font-size: 1.2rem;
    color: white;
}

.loading-overlay.hidden {
    display: none;
}

/* Footer commun */
.footer {
    position: fixed;
    bottom: 2vh;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 100;
    pointer-events: none;
}

.footer-content {
    text-align: center;
    color: #272b28;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    line-height: 1.4;
    width: 100%;
    max-width: none;
    font-weight: 600;
    padding: 0 2vw;
}

.footer-content p {
    margin-bottom: 5px;
}

.footer-link {
    color: #272b28;
    text-decoration: none;
    transition: var(--transition);
    pointer-events: auto;
    font-weight: 600;
}

.footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Media queries pour le footer */
@media (max-width: 600px) {
    .footer-content {
        font-size: clamp(0.7rem, 3vw, 1rem);
        padding: 0 1vw;
    }
    
    .footer-content p {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* Classes utilitaires communes */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-primary);
}

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

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(80, 80, 80, 0.8);
    color: #ccc;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(100, 100, 100, 0.9);
    color: #fff;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Messages communs */
.message {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    transition: var(--transition);
}

.message.hidden {
    display: none;
}

.message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.message.warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.message-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.message-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.message-content p {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

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

/* Scroll smooth */
html {
    scroll-behavior: smooth;
}

/* Media queries de base pour mobile */
@media (max-aspect-ratio: 1/1) {
    body {
        background-image: url('/images/Background-mobile.webp');
        background-size: 100% 100%;
        background-position: center center;
        background-repeat: no-repeat;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .footer-content {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
}

/* Amélioration de l'accessibilité */
.btn:focus,
.footer-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}