/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
@import url('variables.css');

/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   (Las variables ahora están en variables.css)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@700;800&display=swap');


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Hide scrollbar globally */
html,
body {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}


body {
    font-family: var(--fuente-texto);
    background-color: var(--blanco);
    color: var(--negro);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ==========================================================================
   2. LOADER (PANTALLA DE CARGA)
   ========================================================================== */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--blanco);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-principal);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* ==========================================================================
   4. NEW PUBLIC PORTFOLIO GRID (V2)
   ========================================================================== */
.public-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}

.project-card-public {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--borde);
    display: flex;
    flex-direction: column;
}

.project-card-public:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.proj-img-container {
    height: 220px;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.proj-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card-public:hover .proj-img-container img {
    transform: scale(1.05);
}

.proj-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card-public:hover .proj-overlay {
    opacity: 1;
}

.view-btn {
    background: white;
    color: black;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.project-card-public:hover .view-btn {
    transform: translateY(0);
}

.proj-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.proj-category-badge {
    align-self: flex-start;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.proj-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.proj-tools {
    font-size: 0.85rem;
    color: var(--gris-oscuro);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.proj-desc-preview {
    font-size: 0.9rem;
    color: #888;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
}

.proj-full-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* ==========================================================================
   5. PROJECT MODAL
   ========================================================================== */
.project-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.project-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.project-modal-backdrop.active .project-modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.close-modal-btn:hover {
    background: white;
}

.modal-header-banner {
    height: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    padding: 20px 40px;
}

.company-tag-modal {
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: 700;
    color: #333;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.modal-body-scroll {
    overflow-y: auto;
    padding: 40px;
    flex: 1;
}

.modal-proj-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-family: var(--fuente-titulos);
    line-height: 1.1;
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    color: #666;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.meta-item i {
    margin-right: 8px;
    color: #888;
}

.modal-main-image img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 40px;
}

.modal-rich-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    max-width: 700px;
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */
.site-footer {
    background: var(--gris-claro);
    color: var(--negro);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--borde);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    width: 180px;
    height: auto;
    margin-bottom: 0.5rem;
    filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%) hue-rotate(86deg) brightness(95%) contrast(101%);
}

.footer-col p {
    color: var(--gris-oscuro);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-col h4 {
    font-family: var(--fuente-titulos);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-principal);
    margin-bottom: 0.5rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col ul li a {
    color: var(--gris-oscuro);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--color-principal);
}

@media (max-width: 950px) {
    .site-footer {
        padding: 3rem 1.5rem 2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}