/* --- Variables et Bases --- */
:root {
    --primary: #00d2ff;
    --dark: #1a1a2e;
    --light-bg: #f4f7f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== STYLES MODE JOUR/NUIT ===== */
.theme-toggle {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.theme-toggle:hover {
    background: #2563eb;
    transform: scale(1.05);
}

/* Mode sombre */
body.dark-mode {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
}

body.dark-mode .top-nav {
    background-color: #1e293b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .nav-links a {
    color: #e2e8f0;
}

body.dark-mode .nav-links a:hover {
    color: var(--primary);
}

body.dark-mode .card,
body.dark-mode .carde,
body.dark-mode .cardf {
    background-color: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .card:hover,
body.dark-mode .carde:hover,
body.dark-mode .cardf:hover {
    box-shadow: 0 12px 25px rgba(0, 210, 255, 0.4);
}

body.dark-mode .card h2,
body.dark-mode .carde h2,
body.dark-mode .cardf h2 {
    color: #60a5fa;
}

body.dark-mode .card p,
body.dark-mode .carde p,
body.dark-mode .cardf p {
    color: #cbd5e1;
}

body.dark-mode .contact-link {
    background-color: #1e293b;
    color: var(--primary);
    border-color: var(--primary);
}

body.dark-mode .contact-link:hover {
    background-color: var(--primary);
    color: #1e293b;
}

body.dark-mode .skill-category {
    background-color: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

body.dark-mode .bar {
    background: #334155;
}

body.dark-mode footer {
    background-color: #1e293b;
    color: #94a3b8;
}

/* ===== FIN STYLES MODE JOUR/NUIT ===== */

/* --- Navigation --- */
.top-nav {
    display: flex; 
    justify-content: space-between;
    align-items: center;
    padding: 0 5vw; 
    background: var(--dark); 
    height: 10vh;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

/* Conteneur des liens */
.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Style des liens */
.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.icon {
    height: 7vh; 
    width: auto;
    display: block;
}

/* --- Contenu Principal (Grille) --- */
.content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    align-items: center; 
    height: 85vh;
    gap: 2vw; 
    padding: 2vh 5vw; 
    box-sizing: border-box;
}

/* --- Cartes --- */
.card, .carde, .cardf {
    background: white;
    padding: 3vh 2vw;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-top: 5px solid var(--primary);
    flex: 0 0 28vw; 
    height: 38vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Cible précisément l'image avec la classe logo */
img.logo {
    height: 4vh !important;
    width: auto;
    max-width: 75%;
    margin-bottom: 1.5vh;
    display: block;
    object-fit: contain;
}

/* --- Liens de contact (Boutons) --- */
.contact-link {
    margin-top: 2vh;
    padding: 1vh 1.5vw;
    background: var(--dark);
    color: var(--primary);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.8rem;
    border: 1px solid var(--primary);
    transition: 0.3s;
}

.contact-link:hover {
    background: var(--primary);
    color: var(--dark);
}

/* --- Effets au Survol --- */
.card:hover, .carde:hover, .cardf:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0, 210, 255, 0.2);
}

.card:hover .icon, .carde:hover .icon, .cardf:hover .icon {
    transform: scale(1.1);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
}

.skill-category {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-bottom: 4px solid var(--primary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.skill-item {
    margin-bottom: 15px;
    text-align: left;
}

.skill-item span {
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

/* Barre de progression */
.bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    transition: background 0.3s ease;
}

.fill {
    background: var(--primary);
    height: 100%;
    border-radius: 10px;
    transition: width 1.5s ease-in-out;
}

/* --- Footer --- */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    height: 5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Animations --- */
.fade-in { animation: fadeIn 1s forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }