/* ===== PORTFOLIO - ESTILOS ESPECÍFICOS ===== */

/* ===== PORTFOLIO HERO SECTION ===== */
.portfolio-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-purple));
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="grad1" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(255,255,255,0);stop-opacity:1" /></radialGradient></defs><circle cx="150" cy="150" r="80" fill="url(%23grad1)" /><circle cx="850" cy="200" r="120" fill="url(%23grad1)" /><circle cx="300" cy="800" r="100" fill="url(%23grad1)" /><circle cx="700" cy="700" r="90" fill="url(%23grad1)" /></svg>');
    animation: float 8s ease-in-out infinite;
}

.portfolio-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);
    animation: float 10s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--white), var(--primary-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 4s infinite;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 40px;
}

.hero-stats .stat {
    text-align: center;
}

.hero-stats .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-yellow);
    font-family: var(--font-heading);
    animation: countUp 2s ease-out;
}

.hero-stats .stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* ===== PORTFOLIO FILTERS ===== */
.portfolio-filters {
    padding: 40px 0;
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 80px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 10px 20px;
    border-radius: 25px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-blue);
    transition: left 0.3s ease;
    z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    left: 0;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,255,0.3);
}

/* ===== PORTFOLIO GRID ===== */
.portfolio-grid {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
}

.project-item {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.project-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* ===== PROJECT IMAGE PLACEHOLDERS - VERSIÓN LIMPIA ===== */
.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: 200% 200%;
    animation: gradientAnimation 6s ease infinite;
}

/* Gradientes específicos por categoría */
.project-image[data-category="digital-marketing"] {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4) !important;
}

.project-image[data-category="web-development"] {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

.project-image[data-category="brand-identity"] {
    background: linear-gradient(135deg, #f093fb, #f5576c) !important;
}

.project-image[data-category="cybersecurity"] {
    background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
}

.project-image[data-category="cloud-support"] {
    background: linear-gradient(135deg, #43e97b, #38f9d7) !important;
}

.project-image[data-category="iso-consulting"] {
    background: linear-gradient(135deg, #fa709a, #fee140) !important;
}

/* Iconos como placeholders según la categoría */
.project-image[data-category="digital-marketing"]::before {
    content: '\f201' !important; /* chart-line */
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 4rem !important;
    color: rgba(255,255,255,0.4) !important;
    position: absolute !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

.project-image[data-category="web-development"]::before {
    content: '\f121' !important; /* code */
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 4rem !important;
    color: rgba(255,255,255,0.4) !important;
    position: absolute !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

.project-image[data-category="brand-identity"]::before {
    content: '\f53f' !important; /* palette */
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 4rem !important;
    color: rgba(255,255,255,0.4) !important;
    position: absolute !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

.project-image[data-category="cybersecurity"]::before {
    content: '\f3ed' !important; /* shield-alt */
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 4rem !important;
    color: rgba(255,255,255,0.4) !important;
    position: absolute !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

.project-image[data-category="cloud-support"]::before {
    content: '\f0c2' !important; /* cloud */
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 4rem !important;
    color: rgba(255,255,255,0.4) !important;
    position: absolute !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

.project-image[data-category="iso-consulting"]::before {
    content: '\f558' !important; /* award */
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 4rem !important;
    color: rgba(255,255,255,0.4) !important;
    position: absolute !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

/* Patrón de puntos para más atractivo visual */
.project-image::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px) !important;
    background-size: 20px 20px !important;
    background-position: 0 0, 10px 10px !important;
    z-index: 0 !important;
}

/* Animación de gradiente */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Efectos de hover mejorados */
.project-item:hover .project-image::before {
    transform: scale(1.1) rotate(5deg);
    color: rgba(255,255,255,0.6);
}

.project-item:hover .project-image {
    animation-play-state: paused;
}

/* ===== PROJECT OVERLAY ===== */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,255,0.9), rgba(104,104,150,0.9));
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    z-index: 10;
}

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

.project-info {
    color: var(--white);
    margin-bottom: 20px;
}

.project-info h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.project-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tags span {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.project-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.view-project {
    background: var(--primary-yellow);
    color: var(--black);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-project:hover {
    background: #e6e600;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(194,194,60,0.4);
}

.external-link {
    color: var(--white);
    font-size: 1.2rem;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.external-link:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.project-meta {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-category {
    background: var(--primary-blue);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-result {
    color: #4CAF50;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== PROJECT MODAL ===== */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.project-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideInUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--neutral-gray);
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-blue);
}

.modal-body {
    padding: 40px;
}

.case-study {
    text-align: left;
}

.case-study h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.case-study-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.case-study-meta span {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    color: var(--neutral-gray);
}

.case-study-section {
    margin-bottom: 30px;
}

.case-study-section h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.case-study-section p {
    color: var(--neutral-gray);
    line-height: 1.6;
    margin-bottom: 15px;
}

.case-study-section ul {
    list-style: none;
    padding-left: 0;
}

.case-study-section ul li {
    color: var(--neutral-gray);
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.case-study-section ul li::before {
    content: '•';
    color: var(--primary-blue);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.case-study-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.metric-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    font-family: var(--font-heading);
}

.metric-label {
    font-size: 0.9rem;
    color: var(--neutral-gray);
    margin-top: 5px;
}

/* ===== CLIENT TESTIMONIALS ===== */
.client-testimonials {
    padding: 80px 0;
    background: var(--white);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.testimonial-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.testimonial-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.testimonial-content {
    position: relative;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
}

.stars i {
    color: #ffd700;
    font-size: 1.2rem;
}

.testimonial-content p {
    font-size: 1.1rem;
    color: var(--neutral-gray);
    line-height: 1.6;
    margin-bottom: 25px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.testimonial-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.author-info span {
    font-size: 0.9rem;
    color: var(--neutral-gray);
}

/* ===== CTA SECTION ===== */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-purple));
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    animation: float 12s ease-in-out infinite;
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .portfolio-hero {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .project-overlay {
        padding: 20px;
    }
    
    .project-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-item {
        padding: 30px;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .case-study h2 {
        font-size: 1.8rem;
    }
    
    .case-study-metrics {
        grid-template-columns: 1fr;
    }

    .project-image::before {
        font-size: 3rem !important;
    }
    
    .project-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .portfolio-hero {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats .stat-number {
        font-size: 2rem;
    }
    
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .project-image {
        height: 180px;
    }

    .project-image::before {
        font-size: 2.5rem !important;
    }
    
    .project-overlay {
        padding: 15px;
    }
    
    .project-info h3 {
        font-size: 1.2rem;
    }
    
    .view-project {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .testimonial-item {
        padding: 25px;
    }
    
    .testimonial-content p {
        font-size: 1rem;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .case-study h2 {
        font-size: 1.5rem;
    }
    
    .case-study-section h3 {
        font-size: 1.2rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
}

/* ===== EFECTOS ADICIONALES ===== */
.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
    z-index: -1;
}

.project-item:hover::before {
    opacity: 0.02;
}

.testimonial-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
    z-index: -1;
}

.testimonial-item:hover::before {
    opacity: 0.02;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.filter-btn:focus,
.view-project:focus,
.external-link:focus,
.modal-close:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

.project-item:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

/* ===== CUSTOM SCROLLBAR ===== */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-purple);
}