/* ===== VARIABLES ===== */
:root {
    --primary: #270089;
    --primary-light: #3a1ca3;
    --primary-light-20: rgba(39, 0, 137, 0.2);
    --primary-light-10: rgba(39, 0, 137, 0.1);
    --white: #ffffff;
    --white-90: rgba(255, 255, 255, 0.9);
    --white-80: rgba(255, 255, 255, 0.8);
    --white-60: rgba(255, 255, 255, 0.6);
    --white-40: rgba(255, 255, 255, 0.4);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-10: rgba(255, 255, 255, 0.1);
    --accent-blue: #00ACD8;
    --accent-blue-light: #4dd0ff;
    --accent-blue-light-20: rgba(0, 172, 216, 0.2);
    --accent-pink: #D50057;
    --accent-pink-light: rgba(213, 0, 87, 0.2);
    --bg-dark-overlay: rgba(0, 0, 0, 0.8);
    --bg-dark-overlay-light: rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --radius: 16px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--white);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== FONDO CON IMAGEN ===== */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/Chat (1).jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 88, 139, 0.30);
    /* backdrop-filter: blur(5px); */
    opacity: 0.9;
    z-index: -1;
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ===== LOGO CON ANIMACIÓN ===== */
.logo-section {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    opacity: 0.9;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.logo-img {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo-image {
    max-width: 15rem;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
    animation: floatLogo 6s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 172, 216, 0.3));
}

.logo-text {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: 700;
    color: var(--white);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    letter-spacing: -0.5px;
    text-align: center;
    line-height: 1.2;
}

.logo-text i {
    color: var(--accent-blue);
    font-size: clamp(1.5rem, 4vw, 2rem);
    animation: pulseIcon 2s ease-in-out infinite;
}

/* ===== BÚSQUEDA ===== */
.search-container {
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    /* backdrop-filter: blur(20px); */
    opacity: 0.9;
    border-radius: var(--radius);
    padding: 0.875rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    width: 100%;
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-blue-light-20);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.search-box i {
    color: var(--white);
    font-size: 1.1rem;
    margin-right: 0.875rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--white);
    outline: none;
    font-family: 'Inter', sans-serif;
    width: 100%;
    min-width: 0;
}

.search-box input::placeholder {
    color: var(--white-60);
    opacity: 0.8;
}

/* ===== GRID DE PROYECTOS DINÁMICO ===== */
.projects-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: clamp(1rem, 3vw, 1.875rem);
    margin-bottom: 2.5rem;
    width: 100%;
    align-items: stretch;
}

/* ===== CARD COMO ENLACE ===== */
.project-card {
    display: block;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    height: 250px;
    /* Tamaño fijo */
    cursor: pointer;
    transition: var(--transition);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0.7;
    /* Opacidad inicial para todas las cards */
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

/* Imagen de fondo - CON OPACIDAD */
.project-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: var(--transition);
    z-index: 1;
    opacity: 0.3;
    /* Opacidad baja por defecto */
}

/* Overlay con opacidad variable */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    /* opacity: 0.9; */
    /* Más oscuro por defecto */
    z-index: 2;
    transition: var(--transition);
}

/* Contenido de la card */
.project-content {
    position: relative;
    z-index: 3;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Ícono de carpeta */
.project-icon {
    /* position: absolute; */
    top: 1.5rem;
    left: 1.5rem;
    width: clamp(2.5rem, 6vw, 3.125rem);
    height: clamp(2.5rem, 6vw, 3.125rem);
    background: var(--accent-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

/* Nombre del proyecto */
.project-name {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 600;
    color: var(--white);
    margin-top: auto;
    transition: var(--transition);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.project-desc{
    font-weight: 200;
    color: var(--white);
    transition: var(--transition);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Ruta del proyecto */
.project-path {
    font-size: 0.9rem;
    color: var(--white-60);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin-top: 0.5rem;
}

/* ===== EFECTO HOVER - AUMENTA OPACIDAD DE LA IMAGEN ===== */
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 8px 30px rgba(0, 172, 216, 0.3);
    border-color: var(--accent-blue);
    opacity: 1;
    /* Card totalmente visible al hover */
}

.project-card:hover .project-bg {
    opacity: 1;
    /* Imagen totalmente visible */
    transform: scale(1.05);
}

.project-card:hover .project-overlay {
    background: rgba(0, 0, 0, 0.2);
    /* Overlay más claro al hover */
}

.project-card:hover .project-icon {
    background: var(--accent-pink);
    transform: scale(1.1) rotate(-5deg);
}

.project-card:hover .project-name {
    color: var(--accent-blue-light);
    transform: translateY(-2px);
}

/* ===== LOADING ===== */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.75rem 1.25rem;
    color: var(--white);
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.loader-circle {
    width: 1rem;
    height: 1rem;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loader-circle:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-circle:nth-child(2) {
    animation-delay: -0.16s;
}

.loading p {
    font-size: 1.1rem;
    color: var(--white-80);
}

/* ===== NO RESULTS ===== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.75rem 1.25rem;
    color: var(--white);
    opacity: 0.8;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    color: var(--accent-blue);
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.3rem;
    margin-bottom: 0.625rem;
    font-weight: 500;
    color: var(--white-90);
}

.no-results p {
    font-size: 1rem;
    opacity: 0.7;
    color: var(--white-70);
}

/* ===== INFORMACIÓN ===== */
.info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 4vw, 1.875rem);
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    opacity: 0.7;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.05);
    /* backdrop-filter: blur(10px); */
    opacity: 0.9;
    border-radius: var(--radius);
    padding: 1.5rem;
}

.info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.info i {
    color: var(--accent-blue);
    font-size: 1.1em;
}

.info span {
    font-weight: 600;
    color: var(--accent-blue);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-0.625rem) rotate(1deg);
    }

    66% {
        transform: translateY(0.3125rem) rotate(-1deg);
    }
}

@keyframes pulseIcon {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Delays para las animaciones de las cards */
.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

.project-card:nth-child(5) {
    animation-delay: 0.5s;
}

.project-card:nth-child(6) {
    animation-delay: 0.6s;
}

.project-card:nth-child(7) {
    animation-delay: 0.7s;
}

.project-card:nth-child(8) {
    animation-delay: 0.8s;
}

.project-card:nth-child(n+9) {
    animation-delay: 0.9s;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Pantallas grandes (desktop) */
@media screen and (min-width: 1200px) {
    .container {
        padding: 2.5rem 2rem;
    }

    .logo-img {
        gap: 2rem;
    }
}

/* Tablets (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .project-card {
        height: 220px;
        /* Tamaño reducido pero fijo */
    }
}

/* Tablets pequeñas (576px - 768px) */
@media screen and (max-width: 768px) {
    .project-card {
        height: 200px;
    }
}

/* Móviles (425px - 576px) */
@media screen and (max-width: 576px) {
    .project-card {
        height: 180px;
    }
}

/* Móviles pequeños (320px - 425px) */
@media screen and (max-width: 425px) {
    .project-card {
        height: 160px;
    }
}

/* Móviles muy pequeños (menos de 320px) */
@media screen and (max-width: 320px) {
    .project-card {
        height: 150px;
    }
}

/* Ajustes para modo landscape en móviles */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .project-card {
        height: 140px;
    }
}