/* =============================================
   PORTFOLIO.CSS - D4T Applications
   Ubicación: /assets/css/portfolio.css
   Estilos para la sección de portafolio
   ============================================= */

/* ===========================================
   1. SECCIÓN BASE
   =========================================== */
.portfolio-section {
    background-color: #f9fafb;
    position: relative;
    overflow: hidden;
}

/* ===========================================
   2. BOTONES DE FILTRO
   =========================================== */
.filter-btn {
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    color: #4b5563;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: #c084fc;
    color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background-color: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

/* ===========================================
   3. GRID DE PROYECTOS
   =========================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   4. TARJETAS DE PROYECTO
   =========================================== */
.project-card {
    background-color: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ===========================================
   5. IMAGEN DEL PROYECTO
   =========================================== */
.project-image {
    position: relative;
    height: 14rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.project-badge span {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

/* Colores de badges */
.badge-purple { color: #7c3aed; }
.badge-green { color: #059669; }
.badge-orange { color: #ea580c; }
.badge-red { color: #dc2626; }
.badge-teal { color: #0891b2; }

/* ===========================================
   6. CONTENIDO DEL PROYECTO
   =========================================== */
.project-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.project-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #7c3aed;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.project-link:hover {
    color: #6d28d9;
    gap: 0.5rem;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.status-active { color: #059669; }
.status-featured { color: #f59e0b; }

.btn-details {
    width: 2rem;
    height: 2rem;
    border: none;
    background-color: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-details:hover {
    background-color: #e5e7eb;
    color: #4b5563;
    transform: scale(1.1);
}

/* ===========================================
   7. BOTÓN VER MÁS
   =========================================== */
.btn-primary-portfolio {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 2rem;
    background-color: #7c3aed;
    color: #ffffff;
    font-weight: 500;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-portfolio:hover {
    background-color: #6d28d9;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.2);
}

/* ===========================================
   8. MODAL
   =========================================== */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    overflow-y: auto;
}

.project-modal.active {
    display: block;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    max-width: 42rem;
    margin: 2rem auto;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background-color: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #e5e7eb;
    color: #4b5563;
}

.modal-content {
    padding: 2rem;
}

/* ===========================================
   9. RESPONSIVE
   =========================================== */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .portfolio-section {
        padding: 3rem 1rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .project-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .modal-container {
        margin: 1rem;
        border-radius: 0.75rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* ===========================================
   10. UTILIDADES
   =========================================== */
.portfolio-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}