/* main.css : styles principaux du site (hors animations orbit/starfield) */

/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --background-color: #0f172a;
    --surface-color: transparent; /* plus de fond opaque */
    --surface-light: #232946; /* pour les effets de bordure si besoin */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: transparent;
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    padding-top: 48px;
    padding-bottom: 48px;
}

.container, .hero-container, .projects-grid, .skills-grid {
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
}

.hero-content {
    z-index: 3;
    position: relative;
    padding-right: 2.5rem;
    word-break: break-word;
    min-width: 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    word-break: break-word;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--primary-color);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    z-index: 3;
    position: relative;
    word-break: break-word;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .hero-container {
        padding-top: 32px;
        padding-bottom: 32px;
        gap: 2rem;
    }
    .hero-content {
        padding-bottom: 32px;
        padding-right: 0;
    }
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.hero-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Floating Card */
.floating-card {
    background: rgba(20,24,38,0.18);
    box-shadow: 0 0 16px 2px #6366f1aa, 0 2px 32px #0008;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.code-snippet {
    font-family: 'Courier New', monospace;
}

.code-line {
    margin-bottom: 0.5rem;
}

.keyword { color: #c792ea; }
.function { color: #82aaff; }
.string { color: #c3e88d; }

/* Common Section Styles */
section {
    padding: 5rem 0;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* About Section */
.about {
    background-color: transparent;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 900px) {
    .skills-grid {
        grid-template-columns: 1fr;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.skill-category {
    background: rgba(20,24,38,0.18);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #6366f1;
    box-shadow: 0 0 16px 2px #6366f1aa, 0 2px 32px #0008;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

/* Projects Section */
.projects {
    background-color: transparent;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem 2.5rem;
    width: 100%;
    margin: 0 auto;
    grid-auto-flow: dense;
    align-items: stretch;
    padding-bottom: 3rem;
    background: radial-gradient(ellipse at 50% 0%, #232946 60%, #0f172a 100%);
    justify-items: stretch;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
}

.project-card {
    background: rgba(20,24,38,0.18);
    border-radius: 20px;
    padding: 2rem;
    border: 1.5px solid #6366f1;
    box-shadow: 0 0 24px 4px #6366f1cc, 0 2px 32px #000a;
    transition: box-shadow 0.4s cubic-bezier(.4,2,.6,1), transform 0.4s cubic-bezier(.4,2,.6,1);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    min-width: 260px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    will-change: transform;
    break-inside: avoid;
}

.project-card.large-content {
    grid-column: span 2;
    max-width: 100%;
}

.project-card.middle-content {
    grid-column: span 2;
    max-width: 700px;
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
    .project-card.large-content {
        grid-column: span 2;
    }
    .project-card.middle-content {
        grid-column: span 2;
        max-width: 90vw;
    }
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-card.large-content {
        grid-column: span 1;
    }
    .project-card.middle-content {
        grid-column: span 1;
        max-width: 98vw;
    }
}

@media (max-width: 700px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-card {
        max-width: 98vw;
    }
    .project-card.large-content {
        grid-column: span 1;
    }
    .project-card.middle-content {
        grid-column: span 1;
        max-width: 98vw;
    }
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}


.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.project-icon i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
}

.project-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.project-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.project-media {
    background: rgba(20,24,38,0.18);
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
    height: 250px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
}

.media-carousel {
    position: relative;
    width: 100%;
    height: calc(100% - 20px);
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
}

.media-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-item.active {
    opacity: 1;
}

.media-item iframe,
.media-item video,
.media-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111827;
    border: none;
    border-radius: 10px;
    pointer-events: auto;
    z-index: 2;
}

.media-item video::-webkit-media-controls {
    z-index: 10;
}

.media-item video::-webkit-media-controls-panel {
    z-index: 10;
}

.media-item video::-webkit-media-controls-play-button {
    z-index: 10;
}

.media-item video {
    position: relative;
    z-index: 5;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.project-media:hover .carousel-controls {
    opacity: 1;
}

.carousel-btn {
    background: rgba(59, 130, 246, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(59, 130, 246, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e5e7eb;
}

.project-description {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: justify;
}



.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--primary-dark);
}

.support-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.support-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.support-btn.coffee {
    background-color: #ffdd44;
    color: #333;
}

.support-btn.kofi {
    background-color: #ff5e5b;
    color: white;
}

/* Footer */
.footer {
    background-color: transparent;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(15, 23, 42, 0.97); /* plus lisible */
        width: 100vw;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        overflow-y: auto; /* scroll si trop long */
        z-index: 1100; /* au-dessus du header */
        box-shadow: 0 8px 32px #000a;
    }
    .nav-menu.active {
        left: 0;
    }
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-title {
        font-size: 2rem;
    }
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 15px;
        gap: 1.5rem;
    }
    .project-card {
        grid-row: span 12 !important;
    }
    .project-card.large-content {
        grid-row: span 20 !important;
    }
    body {
        padding-top: 80px; /* plus d'espace sous le header */
    }
}

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

.animate-in {
    animation: fadeInUp 0.6s ease-out;
}

/* --- Skills Preview (About section) --- */
.skills-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(20,24,38,0.18);
    border-radius: 1rem;
    padding: 0.75rem 1.2rem;
    min-width: 80px;
    min-height: 80px;
    box-shadow: 0 0 8px 2px #6366f1cc;
    border: 1.5px solid #6366f1;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.3s;
    font-size: 1.1rem;
    word-break: break-word;
}

.skill-item i {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.skill-item span {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: center;
    white-space: normal;
}

@media (max-width: 700px) {
    .skills-preview {
        gap: 0.5rem;
    }
    .skill-item {
        min-width: 60px;
        min-height: 60px;
        padding: 0.5rem 0.7rem;
        font-size: 0.95rem;
    }
    .skill-item i {
        font-size: 1.3rem;
    }
}

/* --- About Stats --- */
.about-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: stretch;
}

.stat-item {
    min-width: 100px;
    flex: 1 1 120px;
    word-break: break-word;
}

@media (max-width: 700px) {
    .about-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .stat-item {
        min-width: 80px;
        width: 100%;
    }
}

/* --- Skills Section Tags --- */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: flex-start;
    align-items: center;
}

.skill-tag {
    display: flex;
    align-items: center;
    gap: 0.4em;
    background: rgba(20,24,38,0.18);
    border-radius: 0.7em;
    padding: 0.4em 1em;
    font-size: 1em;
    color: var(--text-primary);
    border: 1px solid #6366f1;
    margin-bottom: 0.3em;
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 700px) {
    .skill-tags {
        gap: 0.3rem;
    }
    .skill-tag {
        font-size: 0.95em;
        padding: 0.3em 0.7em;
    }
}

/* Planète de fond animée */
#planet-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 320px;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 60% 40%, #6366f1 60%, #232946 100%);
    box-shadow: 0 0 120px 40px #6366f1aa, 0 0 320px 120px #23294688;
    border-radius: 50%;
    opacity: 0.45;
    filter: blur(0.5px) saturate(1.2);
    transition: opacity 0.5s;
    animation: planet-glow 8s ease-in-out infinite alternate;
}

.planet-bg-multi {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0.45;
    filter: blur(0.5px) saturate(1.2);
    transition: opacity 0.5s;
    animation: planet-glow 8s ease-in-out infinite alternate;
}

@keyframes planet-glow {
    0% { filter: blur(1.5px) saturate(1.1); opacity: 0.38; }
    100% { filter: blur(3px) saturate(1.3); opacity: 0.55; }
}


.hero-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 48px;
}

/* Responsive : image en dessous du texte */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
    }
}

/* Bouton YouTube */
.youtube-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 0.7em;
    padding: 0.7em 1.3em;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px #ff000055;
    transition: background 0.2s, transform 0.2s;
}

.youtube-btn:hover {
    background: #cc0000;
    transform: scale(1.06);
}

.youtube-btn i {
    font-size: 1.2em;
}
