/* styles.css - CSS avancé pour les deux pages */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --light-bg: #f7fafc;
    --white: #ffffff;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--light-bg);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(176, 224, 230, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(216, 191, 216, 0.15) 0%, transparent 20%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar avancée */
.navbar {
    background: var(--dark-gradient) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 1rem;
    position: relative;
    overflow: hidden;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.navbar:hover::before {
    transform: translateX(100%);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(90deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-left: 40px;
}

.navbar-brand::before {
    content: '🌍';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
}

.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 50px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.4s;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* En-tête avec effet de particules */
.page-header {
    text-align: center;
    padding: 3rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-weight: 700;
    font-size: 2.8rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    width: 80%;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Boutons avec effets avancés */
.btn-advanced {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    z-index: 1;
}

.btn-advanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-gradient);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.btn-advanced:hover::before {
    opacity: 1;
}

.btn-advanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-advanced:active {
    transform: translateY(1px);
}

/* Cartes de pays avec effets 3D */
.country-card {
    border-radius: 16px;
    border: none;
    transition: var(--transition);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--card-shadow);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    height: 100%;
}

.country-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.country-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: var(--hover-shadow);
}

.country-card:hover::before {
    opacity: 0.05;
}

.country-card .card-img-top {
    height: 180px;
    object-fit: cover;
    transition: transform 0.6s;
}

.country-card:hover .card-img-top {
    transform: scale(1.05);
}

.country-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.country-card .card-title {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.country-card .card-text {
    color: var(--text-secondary);
}

.country-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    height: 100%;
}

/* Formulaire de recherche avancé */
.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.search-input {
    border-radius: 50px;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.search-btn {
    border-radius: 50px;
    padding: 0.8rem 2rem;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

/* Alertes stylisées */
.alert-advanced {
    border-radius: 16px;
    border: none;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.alert-advanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

.alert-danger.alert-advanced::before {
    background: #f56565;
}

.alert-warning.alert-advanced::before {
    background: #ed8936;
}

.alert-info.alert-advanced::before {
    background: #4299e1;
}

/* Animation d'entrée pour les cartes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.country-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.country-card:nth-child(1) { animation-delay: 0.1s; }
.country-card:nth-child(2) { animation-delay: 0.2s; }
.country-card:nth-child(3) { animation-delay: 0.3s; }
.country-card:nth-child(4) { animation-delay: 0.4s; }
.country-card:nth-child(5) { animation-delay: 0.5s; }
.country-card:nth-child(6) { animation-delay: 0.6s; }
.country-card:nth-child(7) { animation-delay: 0.7s; }
.country-card:nth-child(8) { animation-delay: 0.8s; }

/* Effet de particules flottantes */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Footer stylisé */
.footer-advanced {
    background: var(--dark-gradient);
    color: white;
    padding: 2rem 0 1.5rem;
    margin-top: auto;
    position: relative;
}

.footer-advanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

/* Styles spécifiques pour la page de recherche */
.country-detail-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: none;
    transition: var(--transition);
}

.country-detail-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.country-detail-card .card-img-top {
    height: 250px;
    object-fit: cover;
}

.country-info-list {
    list-style: none;
    padding: 0;
}

.country-info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: between;
}

.country-info-list li:last-child {
    border-bottom: none;
}

.country-info-list strong {
    min-width: 120px;
    display: inline-block;
    color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .country-card:hover {
        transform: translateY(-5px);
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}