@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ===== ESTILOS GENERALES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Courier New', monospace;
    background: #1e1e1e;
    color: #fff;
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* ===== BARRA LATERAL (ESTILOS MEJORADOS) ===== */
.sidebar {
    width: 250px;
    background: #282828;
    padding: 25px 15px;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.4);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.header {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: rgb(6, 235, 6);
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgb(6, 235, 6), transparent);
}

.header span {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.header span:first-child:hover {
    transform: scale(1.1) rotate(-3deg);
    text-shadow: 0 0 10px rgba(6, 235, 6, 0.7);
}

.header span:last-child:hover {
    transform: scale(1.3);
}

.projects h3 {
    color: #aaa;
    font-family: "Oswald", sans-serif;
    font-weight: 500;
    font-size: 1.3rem;
    text-align: center;
    margin: 20px 0;
    letter-spacing: 1px;
}

.project-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(45, 45, 45, 0.7);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(6, 235, 6, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.project-item:hover {
    background: #383838;
    transform: translateX(8px);
    border-left: 3px solid rgb(6, 235, 6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.project-item:hover::before {
    opacity: 1;
}

.project-item img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 6px;
    border: 2px solid #444;
    transition: all 0.3s ease;
}

.project-item:hover img {
    transform: rotate(5deg) scale(1.1);
    border-color: rgb(6, 235, 6);
    filter: brightness(1.1);
}

.project-item a {
    color: #ddd;
    font-family: "Oswald", sans-serif;
    font-weight: 300;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-grow: 1;
}

.project-item:hover a {
    color: rgb(6, 235, 6);
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(6, 235, 6, 0.3);
}

/* ===== SECCIÓN DE CONTACTO EN SIDEBAR ===== */
.contact-section {
    margin-top: auto; /* Empuja hacia abajo */
    padding-top: 20px;
    border-top: 1px solid #383838;
}

.contact-section h3 {
    color: #aaa;
    font-family: "Oswald", sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 15px;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.contact-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
}

.contact-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.email { background-color: #d44638; }
.github { background-color: #333; }
.linkedin { background-color: #0077b5; }
.twitter { background-color: #1da1f2; }

/* ===== ÁREA PRINCIPAL ===== */
main {
    padding: 30px;
    overflow-y: auto;
    width: calc(100% - 250px);
}
.project-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    width: 240px; /* Ancho fijo para cada tarjeta */
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
    animation-delay: calc(var(--order) * 0.1s);
    flex-shrink: 0; /* Evita que las tarjetas se encojan */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    background-color: #2e2e2e;
}

.project-card img {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    border: 1px solid #383838;
}

.project-card:hover img {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.project-card h2 {
    font-family: "Oswald", sans-serif;
    font-weight: 400;
    margin: 10px 0;
    color: #f0f0f0;
    font-size: 1.2rem;
}

.project-card p {
    color: #bbb;
    font-size: 0.9rem;
    margin: 8px 0;
}

/* ===== DETALLE DE PROYECTO ===== */
.project-detail-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 30, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.project-detail-container.visible {
    opacity: 1;
    pointer-events: all;
}

.project-detail {
    background: #252525;
    padding: 40px;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid #383838;
}

.visible .project-detail {
    transform: translateY(0);
    opacity: 1;
}

.project-detail > * {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    transition-delay: calc(var(--i) * 0.1s);
}

.visible .project-detail > * {
    opacity: 1;
    transform: translateY(0);
}

.project-detail img {
    max-width: 250px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid #444;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.project-detail h1 {
    font-family: "Oswald", sans-serif;
    font-weight: 500;
    margin-bottom: 20px;
    color: #f0f0f0;
    font-size: 1.8rem;
}

.language-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.lang-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.lang-icon:hover {
    transform: scale(1.2);
}

.description {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.7;
    text-align: center;
}

/* ===== BOTONES Y ENLACES ===== */
.project-link {
    display: inline-block;
    margin: 25px 0;
    padding: 12px 30px;
    background: rgb(6, 235, 6);
    color: #111;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Oswald", sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(6, 235, 6, 0.3);
}

.project-link:hover {
    background: rgb(10, 255, 10);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(6, 235, 6, 0.4);
}

.back-button {
    padding: 12px 30px;
    background: #383838;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Oswald", sans-serif;
    font-weight: 400;
    margin-top: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 15px;
    }
    
    main {
        width: 100%;
        padding: 20px;
    }
    
    .project-card {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .project-detail {
        padding: 25px;
    }
    
    .project-detail img {
        max-width: 180px;
    }
    
    .project-link, .back-button {
        padding: 10px 20px;
    }
    
    .contact-buttons {
        gap: 8px;
    }
}

.hidden {
    display: none !important;
}
#project-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
}
.project-itemBack {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(45, 45, 45, 0.7);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.project-itemBack::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(6, 235, 6, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.project-itemBack:hover {
    background: #383838;
    transform: translateX(8px);
    border-left: 3px solid rgb(235, 6, 6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.project-itemBack:hover::before {
    opacity: 1;
}

.project-itemBack img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 6px;
    border: 2px solid #444;
    transition: all 0.3s ease;
}

.project-itemBack:hover img {
    transform: rotate(5deg) scale(1.1);
    border-color: rgb(235, 6, 6);
    filter: brightness(1.1);
}

.project-itemBack a {
    color: #ddd;
    font-family: "Oswald", sans-serif;
    font-weight: 300;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-grow: 1;
}

.project-itemBack:hover a {
    color: rgb(235, 6, 6);
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(6, 235, 6, 0.3);
}