/* =================================
   HERO SECTION - PORTFOLIO
   ================================= */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: clamp(6rem, 15vh, 8rem) 0 clamp(2rem, 5vh, 4rem);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.5;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-container h1 {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 800;
    margin-bottom: clamp(1rem, 3vh, 1.5rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--color-white);
}

.hero-container p {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    color: #b3b3b3;
    margin-bottom: clamp(2rem, 5vh, 2rem);
    max-width: min(600px, 90%);
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* =================================
   FILTER TABS
   ================================= */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    margin-bottom: clamp(2rem, 5vh, 3rem);
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid rgba(22, 237, 72, 0.2);
    color: #b3b3b3;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.85rem, 2vw, 1rem);
    white-space: nowrap;
}

.filter-btn.active,
.filter-btn:hover {
    border-color: var(--color-primary);
    background: rgba(22, 237, 72, 0.1);
    color: var(--color-primary);
}

/* =================================
   PORTFOLIO GRID
   ================================= */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(2rem, 5vh, 3rem);
    align-items: stretch;
}

.project-card {
    background: #111111;
    border: 1px solid rgba(22, 237, 72, 0.15);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 520px;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

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

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: 0 35px 60px -12px rgba(22, 237, 72, 0.25);
    background: rgba(22, 237, 72, 0.02);
}

.project-card.hidden {
    display: none;
}

/* =================================
   PROJECT IMAGES
   ================================= */
.project-image-container {
    position: relative;
    overflow: hidden;
    height: clamp(200px, 30vw, 280px);
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid rgba(22, 237, 72, 0.1);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    max-width: 80%;
    max-height: 80%;
}

.project-card:hover .project-image {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 20px rgba(22, 237, 72, 0.3));
}

.project-image.logo-unificado {
    max-width: 70%;
    max-height: 70%;
    padding: clamp(1rem, 3vw, 1.5rem);
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(22, 237, 72, 0.1);
}

.project-card:hover .project-image.logo-unificado {
    background: #222222;
    border-color: var(--color-primary);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
    font-size: clamp(2rem, 6vw, 3rem);
    border-radius: 12px;
    border: 1px solid rgba(22, 237, 72, 0.1);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

/* =================================
   PROJECT CONTENT
   ================================= */
.project-content {
    padding: clamp(1.5rem, 4vw, 2rem);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.project-category {
    color: var(--color-primary);
    font-weight: 600;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: block;
    min-height: 1.2em;
}

.project-title {
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-white);
    line-height: 1.3;
    min-height: 2.6em;
}

.project-description {
    color: #b3b3b3;
    line-height: 1.6;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(0.9rem, 2vw, 1rem);
    flex: 1;
    min-height: 3em;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.4rem, 1vw, 0.5rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    min-height: 2.5em;
}

.tech-tag {
    background: rgba(22, 237, 72, 0.1);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: clamp(0.75rem, 2vw, 0.8rem);
    font-weight: 500;
    border: 1px solid rgba(22, 237, 72, 0.3);
    white-space: nowrap;
}

/* =================================
   PROJECT ACTIONS - BOTONES
   ================================= */
.project-actions {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1rem);
    margin-top: auto;
    flex-wrap: nowrap;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    flex: 1;
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: var(--color-black);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(22, 237, 72, 0.3);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-black);
    border: 2px solid var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    flex: 1;
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(22, 237, 72, 0.3);
}

/* =================================
   LOADING & EMPTY STATES
   ================================= */
.loading {
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem);
    color: #b3b3b3;
}

.loading i {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
    color: var(--color-primary);
}

.empty-state {
    text-align: center;
    padding: clamp(3rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
    color: #b3b3b3;
}

.empty-state i {
    font-size: clamp(3rem, 8vw, 4rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    opacity: 0.5;
    color: var(--color-primary);
}

.empty-state h3 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin-bottom: 1rem;
    color: var(--color-white);
}

/* =================================
   MODAL - ESTILOS MEJORADOS
   ================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #111111 100%);
    margin: 2% auto;
    padding: 0;
    border: 1px solid rgba(22, 237, 72, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 20px 0 15px;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--color-primary);
    transform: rotate(90deg);
}

#modal-content-wrapper {
    padding: 2rem;
}

/* =================================
   CONTENIDO DEL MODAL
   ================================= */

.modal-project-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.modal-project-image {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(22, 237, 72, 0.2);
    max-height: 300px;
}

.modal-project-image img {
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

.modal-project-image img.logo-unificado {
    filter: drop-shadow(0 10px 30px rgba(22, 237, 72, 0.3));
}

.modal-project-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-project-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.modal-project-description,
.modal-project-technologies {
    background: rgba(22, 237, 72, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--color-primary);
}

.modal-project-description h3,
.modal-project-technologies h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-project-description h3::before {
    content: "📋";
}

.modal-project-technologies h3::before {
    content: "⚙️";
}

.modal-project-description p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.tech-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-tags-container .tech-tag {
    background: linear-gradient(135deg, rgba(22, 237, 72, 0.2), rgba(22, 237, 72, 0.1));
    color: var(--color-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(22, 237, 72, 0.3);
    transition: all 0.3s ease;
}

.tech-tags-container .tech-tag:hover {
    background: var(--color-primary);
    color: var(--color-black);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(22, 237, 72, 0.4);
}

.modal-project-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-project-actions .btn-primary {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* =================================
   SCROLLBAR PERSONALIZADO PARA EL MODAL
   ================================= */

.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #0d9668;
}

/* =================================
   CTA SECTION
   ================================= */
.cta-section {
    background: #111111;
    text-align: center;
    padding: clamp(3rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
    border-radius: 20px;
    margin-top: clamp(2rem, 5vh, 3rem);
    border: 1px solid rgba(22, 237, 72, 0.1);
}

.cta-section h3 {
    font-size: clamp(1.75rem, 5vw, 2rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.cta-section p {
    color: #b3b3b3;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.6;
    max-width: min(600px, 90%);
    margin-left: auto;
    margin-right: auto;
}

/* =================================
   MEDIA QUERIES ESPECÍFICAS
   ================================= */
@media (min-width: 769px) {
    .project-card {
        min-height: 450px;
    }
}

@media (max-width: 768px) {
    .filter-tabs {
        flex-direction: column;
        align-items: center;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .project-actions {
        flex-direction: row;
    }
    
    .project-actions .btn-secondary,
    .project-actions .btn-primary {
        flex: 1;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }

    #modal-content-wrapper {
        padding: 1.5rem;
    }

    .modal-project-title {
        font-size: 2rem;
    }

    .modal-project-image {
        padding: 1rem;
        max-height: 220px;
    }

    .modal-project-image img {
        max-width: 180px;
    }

    .modal-project-actions {
        flex-direction: column;
    }

    .modal-project-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .close-modal {
        font-size: 28px;
        padding: 0.75rem 1rem;
    }
    
    .project-image-container {
        height: 200px;
        padding: 1.5rem;
    }
    
    .project-image {
        max-width: 85%;
        max-height: 85%;
    }
    
    .project-image.logo-unificado {
        max-width: 75%;
        max-height: 75%;
        padding: 1rem;
    }
    
    .project-card {
        min-height: 420px;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 60vh;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-technologies {
        gap: 0.3rem;
    }
    
    .tech-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .close-modal {
        top: 0.5rem;
        right: 0.5rem;
    }

    .modal-project-title {
        font-size: 1.5rem;
    }

    .modal-project-description p {
        font-size: 0.95rem;
    }

    .modal-project-image {
        padding: 0.75rem;
        max-height: 180px;
    }

    .modal-project-image img {
        max-width: 150px;
    }

    .tech-tags-container .tech-tag {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .project-card {
        min-height: 400px;
    }

    .btn-secondary,
    .btn-primary {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 3rem 0 2rem;
    }
    
    .hero-container h1 {
        font-size: 2rem;
    }
}