/* ============================================
   RenderCore - Ajustes Adicionales Responsive
   Mejoras específicas para tablets y pantallas medianas
   ============================================ */

/* --- Mejoras generales para tablets --- */
@media screen and (max-width: 1100px) {
    /* Mejorar espaciado del contenedor principal */
    .main-content {
        padding: 2rem 1.5rem;
    }

    /* Ajustar tamaños de widgets */
    .widget {
        border-radius: 10px;
    }

    /* Mejorar legibilidad */
    .quick-link span {
        font-size: 0.95rem;
    }

    /* Ajustar estadísticas */
    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Mejorar botones */
    .btn {
        padding: 0.75rem 1.3rem;
        font-size: 0.95rem;
    }

    /* Ajustar news items */
    .news-content h4 {
        font-size: 0.95rem;
    }

    .news-content p {
        font-size: 0.85rem;
    }

    /* Mejorar categorías */
    .category-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* --- Tablets en orientación portrait --- */
@media screen and (max-width: 820px) {
    /* Reducir padding general */
    .main-content {
        padding: 1.5rem 1rem;
    }

    /* Layout a una columna pero con mejor distribución */
    .three-column-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Widgets de la derecha en grid */
    .right-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    /* Mejorar proyectos */
    .project-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .project-carousel {
        height: 250px;
    }

    /* Ajustar header de proyecto */
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .project-category {
        align-self: flex-start;
    }

    /* Mejorar footer de proyecto */
    .project-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .project-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Ajustar widgets */
    .widget h3 {
        font-size: 1.05rem;
        margin-bottom: 1rem;
    }

    /* Mejorar stats */
    .stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    /* Dashboard header */
    .dashboard-header h1 {
        font-size: 1.6rem;
    }

    .dashboard-header p {
        font-size: 0.95rem;
    }
}

/* --- Optimización para iPad y tablets similares --- */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    /* Asegurar que el layout de 2 columnas se vea bien */
    .three-column-layout {
        grid-template-columns: 1.5fr 1fr;
        gap: 2rem;
    }

    .center-content {
        min-width: 0; /* Prevenir overflow */
    }

    .right-sidebar {
        max-width: 350px;
    }

    /* Mejorar tarjetas de proyecto */
    .project-card {
        margin-bottom: 1.5rem;
    }

    .project-carousel {
        height: 300px;
    }

    /* Optimizar widgets de la derecha */
    .widget {
        padding: 1.3rem;
    }

    /* Mejorar navegación del carrusel */
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* --- Ajustes específicos para pantallas de 1024px (iPad Pro portrait) --- */
@media screen and (width: 1024px) {
    .three-column-layout {
        grid-template-columns: 1fr 320px;
        gap: 2rem;
    }

    .project-carousel {
        height: 320px;
    }
}

/* --- Mejoras para header en tablets --- */
@media screen and (max-width: 1024px) {
    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-container {
        padding: 0 1.5rem;
    }

    .menu-toggle,
    .profile-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .logo img {
        height: 48px;
    }
}

/* --- Mejoras para modal en tablets --- */
@media screen and (max-width: 1024px) {
    .modal-content {
        width: 90%;
        max-width: 600px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 1.5rem;
    }
}

/* --- Optimización de formularios en tablets --- */
@media screen and (max-width: 1024px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevenir zoom en iOS */
    }

    .upload-form {
        padding: 1.5rem;
    }

    .image-upload-area {
        padding: 2.5rem 1.5rem;
    }

    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

/* --- Mejoras para admin panel en tablets --- */
@media screen and (max-width: 1024px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card-large {
        padding: 1.3rem;
        gap: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }

    .admin-card {
        padding: 1.5rem;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.8rem 0.6rem;
    }
}

/* --- Ajustes de tipografía para mejor legibilidad --- */
@media screen and (max-width: 1024px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    p {
        line-height: 1.6;
    }
}

/* --- Mejoras de interacción táctil --- */
@media screen and (max-width: 1024px) {
    /* Áreas de toque más grandes */
    .quick-link,
    .category-btn,
    .news-item {
        min-height: 44px; /* Recomendación de Apple para áreas táctiles */
    }

    /* Mejorar botones */
    .btn {
        min-height: 44px;
    }

    /* Mejorar controles del carrusel */
    .carousel-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .indicator {
        width: 12px;
        height: 12px;
        margin: 0 4px;
    }

    .indicator.active {
        width: 32px;
    }
}

/* --- Prevenir problemas de overflow --- */
@media screen and (max-width: 1024px) {
    .container {
        overflow-x: hidden;
    }

    .three-column-layout {
        width: 100%;
        overflow-x: hidden;
    }

    .project-card,
    .widget,
    .modal-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}

/* --- Animaciones suavizadas para tablets --- */
@media screen and (max-width: 1024px) {
    * {
        transition-duration: 0.2s !important;
    }

    .sidebar {
        transition: left 0.25s ease;
    }

    .overlay {
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }
}

/* --- Mejoras de performance en tablets --- */
@media screen and (max-width: 1024px) {
    /* Reducir sombras para mejor performance */
    .project-card:hover,
    .widget:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

    /* Simplificar animaciones */
    .carousel-images {
        transition: transform 0.3s ease;
    }
}

