/**
 * ResiPlan - Composants UI réutilisables
 * Style élégant et moderne avec glassmorphism
 * Version: 2.0.0
 */

/* ===== VARIABLES ÉTENDUES ===== */
:root {
    /* Couleurs principales */
    --rp-gradient-primary: linear-gradient(135deg, #0F52BA 0%, #0597B7 100%);
    --rp-gradient-secondary: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    --rp-gradient-success: linear-gradient(135deg, #0CAA6E 0%, #20c997 100%);
    --rp-gradient-danger: linear-gradient(135deg, #DC3545 0%, #e55353 100%);
    --rp-gradient-warning: linear-gradient(135deg, #FFC107 0%, #ffca2c 100%);
    --rp-gradient-info: linear-gradient(135deg, #0597B7 0%, #17a2b8 100%);
    
    /* Ombres élégantes */
    --rp-shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --rp-shadow-md: 0 5px 20px rgba(0,0,0,0.15);
    --rp-shadow-lg: 0 25px 50px rgba(0,0,0,0.15);
    --rp-shadow-xl: 0 35px 60px rgba(0,0,0,0.2);
    
    /* Effets glassmorphism */
    --rp-glass-bg: rgba(255, 255, 255, 0.95);
    --rp-glass-bg-dark: rgba(255, 255, 255, 0.1);
    --rp-glass-border: rgba(255, 255, 255, 0.2);
    --rp-glass-blur: blur(10px);
    
    /* Bordures et espacements */
    --rp-radius-sm: 8px;
    --rp-radius-md: 12px;
    --rp-radius-lg: 20px;
    --rp-radius-xl: 24px;
    
    /* Transitions */
    --rp-transition: all 0.3s ease;
    --rp-transition-fast: all 0.2s ease;
}

/* ===== BACKGROUNDS ÉLÉGANTS ===== */

/* Page d'authentification */
.rp-auth-bg {
    background: var(--rp-gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Page standard */
.rp-page-bg {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Hero section avec gradient */
.rp-hero-section {
    background: var(--rp-gradient-primary);
    color: white;
    padding: 4rem 2rem;
    border-radius: var(--rp-radius-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.rp-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.rp-hero-content {
    position: relative;
    z-index: 2;
}

/* ===== CARTES ÉLÉGANTES ===== */

/* Carte glassmorphism standard */
.rp-card-glass {
    background: var(--rp-glass-bg);
    backdrop-filter: var(--rp-glass-blur);
    border-radius: var(--rp-radius-lg);
    box-shadow: var(--rp-shadow-lg);
    border: 1px solid var(--rp-glass-border);
    overflow: hidden;
    transition: var(--rp-transition);
}

.rp-card-glass:hover {
    transform: translateY(-5px);
    box-shadow: var(--rp-shadow-xl);
}

/* Carte de statistique */
.rp-stat-card {
    background: white;
    border-radius: var(--rp-radius-md);
    padding: 1.5rem;
    box-shadow: var(--rp-shadow-sm);
    transition: var(--rp-transition);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
}

.rp-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--rp-shadow-md);
}

.rp-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: var(--rp-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rp-stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Carte de module */
.rp-module-card {
    background: white;
    border-radius: var(--rp-radius-md);
    box-shadow: var(--rp-shadow-sm);
    transition: var(--rp-transition);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.rp-module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--rp-shadow-md);
}

.rp-module-header {
    background: var(--rp-gradient-primary);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.rp-module-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid-module" width="8" height="8" patternUnits="userSpaceOnUse"><path d="M 8 0 L 0 0 0 8" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid-module)"/></svg>');
    opacity: 0.3;
}

.rp-module-icon {
    position: relative;
    z-index: 2;
}

/* ===== CONTENEURS D'AUTH ===== */

/* Conteneur de connexion */
.rp-auth-container {
    background: var(--rp-glass-bg);
    backdrop-filter: var(--rp-glass-blur);
    border-radius: var(--rp-radius-lg);
    box-shadow: var(--rp-shadow-lg);
    border: 1px solid var(--rp-glass-border);
    overflow: hidden;
    animation: rp-fade-in-up 0.6s ease-out forwards;
}

.rp-auth-header {
    background: var(--rp-gradient-primary);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.rp-auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="auth-grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23auth-grid)"/></svg>');
    opacity: 0.3;
}

.rp-auth-logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.rp-auth-subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

.rp-auth-form {
    padding: 2.5rem;
}

/* ===== BOUTONS ÉLÉGANTS ===== */

/* Bouton principal avec gradient */
.rp-btn-primary {
    background: var(--rp-gradient-primary) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.75rem 2rem !important;
    border-radius: var(--rp-radius-md) !important;
    transition: var(--rp-transition) !important;
    text-transform: none !important;
    box-shadow: var(--rp-shadow-sm) !important;
}

.rp-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--rp-shadow-md) !important;
    filter: brightness(1.1) !important;
}

/* Bouton secondaire */
.rp-btn-secondary {
    background: var(--rp-gradient-secondary) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.75rem 2rem !important;
    border-radius: var(--rp-radius-md) !important;
    transition: var(--rp-transition) !important;
    box-shadow: var(--rp-shadow-sm) !important;
}

.rp-btn-secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--rp-shadow-md) !important;
    filter: brightness(1.1) !important;
}

/* Bouton outline élégant */
.rp-btn-outline {
    background: transparent !important;
    border: 2px solid var(--rp-primary) !important;
    color: var(--rp-primary) !important;
    font-weight: 600 !important;
    padding: 0.75rem 2rem !important;
    border-radius: var(--rp-radius-md) !important;
    transition: var(--rp-transition) !important;
}

.rp-btn-outline:hover {
    background: var(--rp-gradient-primary) !important;
    border-color: transparent !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--rp-shadow-md) !important;
}

/* ===== FORMULAIRES ÉLÉGANTS ===== */

/* Input floating élégant */
.rp-form-floating {
    margin-bottom: 1.5rem;
}

.rp-form-floating .form-control {
    border: 2px solid #dee2e6;
    border-radius: var(--rp-radius-md);
    padding: 1rem 0.75rem;
    font-size: 1rem;
    transition: var(--rp-transition);
    background: white;
}

.rp-form-floating .form-control:focus {
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 0.25rem rgba(15, 82, 186, 0.15);
    background: white;
}

.rp-form-floating label {
    padding: 1rem 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

/* ===== ALERTES ÉLÉGANTES ===== */

.rp-alert {
    border: none;
    border-radius: var(--rp-radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--rp-shadow-sm);
    font-weight: 500;
}

.rp-alert-success {
    background: var(--rp-gradient-success);
    color: white;
}

.rp-alert-danger {
    background: var(--rp-gradient-danger);
    color: white;
}

.rp-alert-warning {
    background: var(--rp-gradient-warning);
    color: #212529;
}

.rp-alert-info {
    background: var(--rp-gradient-info);
    color: white;
}

/* ===== NAVIGATION ÉLÉGANTE ===== */

.rp-navbar {
    background: var(--rp-gradient-primary) !important;
    box-shadow: var(--rp-shadow-md);
    padding: 1rem 0;
}

.rp-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.rp-navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--rp-radius-sm);
    transition: var(--rp-transition);
}

.rp-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rp-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== ANIMATIONS ===== */

@keyframes rp-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rp-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.rp-animate-fade-in-up {
    animation: rp-fade-in-up 0.6s ease-out forwards;
}

.rp-animate-pulse {
    animation: rp-pulse 2s infinite;
}

/* Délais d'animation pour les éléments multiples */
.rp-animate-delay-1 { animation-delay: 0.1s; }
.rp-animate-delay-2 { animation-delay: 0.2s; }
.rp-animate-delay-3 { animation-delay: 0.3s; }
.rp-animate-delay-4 { animation-delay: 0.4s; }

/* ===== UTILITAIRES ===== */

/* Texte avec gradient */
.rp-text-gradient {
    background: var(--rp-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Séparateur élégant */
.rp-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #dee2e6 50%, transparent 100%);
    border: none;
    margin: 2rem 0;
}

/* Conteneur avec padding responsive */
.rp-container {
    padding: 2rem 1rem;
}

@media (min-width: 768px) {
    .rp-container {
        padding: 3rem 2rem;
    }
}

@media (min-width: 1200px) {
    .rp-container {
        padding: 4rem 3rem;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile first adjustments */
@media (max-width: 576px) {
    .rp-auth-container {
        margin: 1rem;
        border-radius: var(--rp-radius-md);
    }
    
    .rp-auth-header,
    .rp-auth-form {
        padding: 1.5rem;
    }
    
    .rp-auth-logo {
        font-size: 2rem;
    }
    
    .rp-stat-number {
        font-size: 2rem;
    }
}