/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #1e293b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --card-bg: #edf2f6;
    --contain-bg: #ffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-ligth-lg: 0 8px 15px rgba(127, 127, 127, 0.2);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-size-base: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-image: linear-gradient(180deg,rgba(0,0,0,0.87) 0%,rgba(0,0,0,0.6) 100%),url('./images/bg_portfolio.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    background: var(--contain-bg);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Header */
header {
    position: relative;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #334155 100%);
    color: var(--text-light);
    overflow: hidden;
}

.header-content {
    position: relative;
    z-index: 2;
    padding: 2rem 0 4rem;
}

.header-nav {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    background: linear-gradient(180deg, #3949BE 0%, #0013A7 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    background: linear-gradient(180deg, #2939AA 0%, #00108B 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-ligth-lg);
}
.btn:focus {
    outline: 2px solid #80d4ff;
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
    background-color: #006bb3;
}

.hero {
    text-align: center;
    padding: 0 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-light) 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: #cbd5e1;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--card-bg);
    clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0 100%);
}

/* Main content */
main {
    padding: 3rem 2rem;
}

.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    -webkit-text-fill-color: transparent;
    background: -webkit-linear-gradient(95deg, #3949BE 50%, #0013A7 50%);
    background-clip: text;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4rem;
    height: 0.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: var(--radius-sm);
}

/* Project cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    display:flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tech-stack {
    margin-bottom: 1.5rem;
}
.tech-contain-label{
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    width: 49%;
    background-image: linear-gradient(to top, #f7f8fc 0%, #e8ecf3 25%, #ffffff 50%, #d0d7e3 75%, #f0f2f8 100%);
}

.tech-label {
    font-size: 0.875rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 0.5rem 0;
    display: block;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tech-item {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.tech-item:hover {
    transform: scale(1.1);
}
.tech-item img {
    height: 3.6rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding:1.5rem;
}

.project-link {
    flex: 1;
    height: 50px;
    width: 50px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-link:hover , .project-link:focus {
    color: var(--text-primary);
    border-color: var(--primary-color);
}
.project_links_contain {
    display: flex;
    align-items: center;
    gap: 13px;
}
.projetct_links_img {
    width: 25px;
    overflow: hidden;

}
.github-icon{
    fill: currentColor;
    padding-top:8px;
    transition: var(--transition);
}
.gitlab-icon{
    padding-top:5px;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: var(--transition);
}
.project-link:hover .gitlab-icon , .project-link:focus .gitlab-icon{
    opacity: 1;
    filter: grayscale(0);
}
.project-link img {
    height: 100%;
}

/* Skills sections */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.skill-card:nth-child(2n)::before {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--success-color) 100%);
}

.skill-card:nth-child(3n)::before {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--primary-color) 100%);
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.skill-icon {

}

.skill-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    background-image: linear-gradient(to top, #f7f8fc 0%, #e8ecf3 25%, #ffffff 50%, #d0d7e3 75%, #f0f2f8 100%);
    background-position: center bottom;
    background-size: auto 200%;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(192, 204, 218, 0.3);
    transition: 0.5s ease;
}
.skill-icon:hover {
    background-position: center top;
    box-shadow: 0 4px 15px rgba(192, 204, 218, 0.5);
}

.skill-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.skill-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.skill-example {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border-left: 0.25rem solid var(--primary-color);
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    max-height: 93vh;
    overflow-y: auto;
}
.captch-content {
    margin-bottom: 1.2rem;
}
.rgpd-content {
    margin-bottom: 1.2rem;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.close:hover {
    background: var(--light-bg);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit:disabled {
    background: rgb(112 105 105 / 30%);
    color: rgba(16, 16, 16, 0.3);
    border-color: rgba(11, 61, 194, 0.69);
}

.btn-submit:hover:not(:disabled):hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
}

/* Alert */
.alert {
    display: none;
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: var(--success-color);
    color: var(--text-light);
}

.alert-error {
    background: var(--danger-color);
    color: var(--text-light);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    float: right;
    margin-left: 1rem;
}
/* icon */
.project-links ion-icon {
    font-size: 25px;
    padding: .5rem;
}
/* scroll top */
.container-scroll {
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 1.75rem;
    width: 47px;
    height: 47px;
}
.container-circle {
    position: absolute;
    top:0;
    left:0;
    width: 47px;
    height: 47px;
}
.container-scroll > button {
    position: relative;
    height: 47px;
    width: 47px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity:0.3;
    padding: 0.5rem;
    background-color: rgba(226,232,240,1);
    border-radius: 100%;
    cursor: pointer;
    z-index: 20;
}
.container-scroll > button:hover {
    opacity: 0.6;
}

.svg-arrow {
    width: 1.5rem;
    height: 1.5rem;
}

.est-cacher {
    opacity: 0;
    -webkit-animation: fadeOutRight 1s 1 cubic-bezier(0.77, 0, 0.175, 1);
    animation: fadeOutRight 1s 1 cubic-bezier(0.77, 0, 0.175, 1);
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
}
.est-visible {
    opacity: 1;
    -webkit-animation: fadeInRight 1s 1 cubic-bezier(0.175, 0, 0.77, 1);
    animation: fadeInRight 1s 1 cubic-bezier(0.175, 0, 0.77, 1);
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
}


/* Animations */
@keyframes fadeOutRight {
    0% {
        opacity: 1;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    30% {
        opacity: 0;
        -webkit-transform: translate3d(20%, 0, 0);
        transform: translate3d(20%, 0, 0);
    }
    100% {
        opacity: 0;
        -webkit-transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
    }
}
@keyframes fadeInRight {
    0% {
        opacity: 0;
        -webkit-transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
    }
    70% {
        opacity: 0;
        -webkit-transform: translate3d(20%, 0, 0);
        transform: translate3d(20%, 0, 0);
    }
    100% {
        opacity: 1;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}


@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    :root {
        --font-size-base: 14px;
    }

    .container {
        margin: 0;
        border-radius: 0;
    }

    .header-nav {
        padding: 1rem;
    }

    .hero {
        padding: 0 1rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .section {
        margin-bottom: 3rem;
    }

    .projects-grid,
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-content {
        padding: 1rem;
    }

    .skill-card {
        padding: 1.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .alert {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .tech-list {
        justify-content: center;
    }
}