/**
 * RenderCore - Responsive Optimization CSS
 * Optimizaciones específicas para mejorar el responsive y ajustar el logo
 */

/* ============================================
   OPTIMIZACIÓN DEL LOGO EN HEADER
   ============================================ */

/* Logo base - tamaño por defecto */
.logo img {
    height: 35px;
    width: auto;
    transition: all 0.3s ease;
}

/* Logo en sidebar */
.sidebar-logo {
    height: 20px;
    width: auto;
    transition: all 0.3s ease;
}

/* ============================================
   RESPONSIVE BREAKPOINTS OPTIMIZADOS
   ============================================ */

/* Pantallas grandes (1200px+) */
@media screen and (min-width: 1200px) {
    .logo img {
        height: 40px;
    }
    
    .sidebar-logo {
        height: 22px;
    }
}

/* Tablets grandes (1024px - 1199px) */
@media screen and (max-width: 1199px) and (min-width: 1024px) {
    .logo img {
        height: 38px;
    }
    
    .sidebar-logo {
        height: 20px;
    }
    
    .header-container {
        padding: 0 1.5rem;
    }
}

/* Tablets medianas (768px - 1023px) */
@media screen and (max-width: 1023px) and (min-width: 768px) {
    .logo img {
        height: 35px;
    }
    
    .sidebar-logo {
        height: 18px;
    }
    
    .header {
        height: 65px;
    }
    
    .header-container {
        padding: 0 1.2rem;
    }
    
    .main-content {
        margin-top: 65px;
    }
}

/* Tablets pequeñas y móviles grandes (640px - 767px) */
@media screen and (max-width: 767px) and (min-width: 640px) {
    .logo img {
        height: 38px;
    }
    
    .sidebar-logo {
        height: 20px;
    }
    
    .header {
        height: 60px;
    }
    
    .header-container {
        padding: 0 1rem;
    }
    
    .main-content {
        margin-top: 60px;
    }
    
    /* Botones del header más pequeños */
    .menu-toggle,
    .profile-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Móviles (480px - 639px) */
@media screen and (max-width: 639px) and (min-width: 480px) {
    .logo img {
        height: 35px;
    }
    
    .sidebar-logo {
        height: 18px;
    }
    
    .header {
        height: 56px;
    }
    
    .header-container {
        padding: 0 0.8rem;
    }
    
    .main-content {
        margin-top: 56px;
    }
    
    .menu-toggle,
    .profile-btn {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
}

/* Móviles pequeños (hasta 479px) */
@media screen and (max-width: 479px) {
    .logo img {
        height: 32px;
    }
    
    .sidebar-logo {
        height: 16px;
    }
    
    .header {
        height: 52px;
    }
    
    .header-container {
        padding: 0 0.6rem;
    }
    
    .main-content {
        margin-top: 52px;
    }
    
    .menu-toggle,
    .profile-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* ============================================
   MEJORAS DE LAYOUT RESPONSIVE
   ============================================ */

/* Optimización para tablets en landscape */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .three-column-layout {
        grid-template-columns: 1fr 300px;
        gap: 1.5rem;
    }
    
    .left-sidebar {
        display: none;
    }
    
    .right-sidebar {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

/* Optimización para móviles en landscape */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .three-column-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .right-sidebar {
        display: none;
    }
    
    .project-carousel {
        height: 200px;
    }
}

/* ============================================
   MEJORAS DE PROYECTOS RESPONSIVE
   ============================================ */

/* Proyectos en tablets */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    .project-card {
        margin-bottom: 1.5rem;
    }
    
    .project-carousel {
        height: 280px;
    }
    
    .project-content {
        padding: 1.3rem;
    }
    
    .project-title {
        font-size: 1.3rem;
    }
    
    .project-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* Proyectos en móviles */
@media screen and (max-width: 767px) {
    .project-card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .project-carousel {
        height: 220px;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .project-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .project-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   MEJORAS DE WIDGETS RESPONSIVE
   ============================================ */

/* Widgets en tablets */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    .widget {
        padding: 1.2rem;
        border-radius: 10px;
    }
    
    .widget h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .quick-link {
        padding: 0.9rem;
        gap: 0.8rem;
    }
    
    .quick-link i {
        font-size: 1.4rem;
    }
    
    .quick-link span {
        font-size: 0.95rem;
    }
}

/* Widgets en móviles */
@media screen and (max-width: 767px) {
    .widget {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .widget h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .quick-link {
        padding: 0.8rem;
        gap: 0.6rem;
    }
    
    .quick-link i {
        font-size: 1.2rem;
    }
    
    .quick-link span {
        font-size: 0.9rem;
    }
    
    .category-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   MEJORAS DE DASHBOARD RESPONSIVE
   ============================================ */

/* Dashboard header responsive */
@media screen and (max-width: 1024px) {
    .dashboard-header {
        margin-bottom: 1.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.8rem;
    }
    
    .dashboard-header p {
        font-size: 1rem;
    }
}

@media screen and (max-width: 767px) {
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-header p {
        font-size: 0.9rem;
    }
}

/* Admin stats responsive */
@media screen and (max-width: 1024px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media screen and (max-width: 640px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .stat-card-large {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   MEJORAS DE MODAL RESPONSIVE
   ============================================ */

@media screen and (max-width: 1024px) {
    .modal-content {
        width: 90%;
        max-width: 600px;
        margin: 2rem auto;
    }
}

@media screen and (max-width: 640px) {
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem 1.2rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1.2rem;
    }
}

/* ============================================
   MEJORAS DE FORMULARIOS RESPONSIVE
   ============================================ */

@media screen and (max-width: 640px) {
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.7rem 0.9rem;
        font-size: 16px; /* Prevenir zoom en iOS */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   MEJORAS DE NAVEGACIÓN RESPONSIVE
   ============================================ */

/* Sidebar responsive */
@media screen and (max-width: 1024px) {
    .sidebar {
        width: 300px;
        left: -300px;
    }
    
    .sidebar.active {
        left: 0;
    }
}

@media screen and (max-width: 640px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
}

/* Profile dropdown responsive */
@media screen and (max-width: 640px) {
    .profile-dropdown {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
    }
    
    .profile-dropdown-header {
        padding: 1rem;
    }
    
    .user-avatar-small {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* ============================================
   MEJORAS DE PERFORMANCE
   ============================================ */

/* Reducir animaciones en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .project-card:hover,
    .widget:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Optimizar para pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img,
    .sidebar-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   MEJORAS DE ACCESIBILIDAD
   ============================================ */

/* Áreas de toque más grandes para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .menu-toggle,
    .profile-btn,
    .carousel-btn,
    .btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .quick-link,
    .category-btn,
    .news-item {
        min-height: 44px;
    }
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .logo img,
    .sidebar-logo {
        transition: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
