/* ============================================
   RESPONSIVE DESIGN
   Electrotécnica PRO - IPET N°66
   ============================================ */

/* ============================================
   TABLET (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 240px 1fr;
    }

    .sidebar {
        width: 240px;
    }

    .content-header h2 {
        font-size: var(--font-size-2xl);
    }
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .app-container {
        grid-template-areas:
            "header"
            "main"
            "footer";
        grid-template-columns: 1fr;
    }

    .header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .logo h1 {
        font-size: var(--font-size-lg);
    }

    .logo span {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left var(--transition-normal);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        padding: var(--spacing-md);
    }

    .content-header h2 {
        font-size: var(--font-size-xl);
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .calculator-container {
        grid-template-columns: 1fr !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .logo-image {
        width: 40px;
        height: 40px;
    }

    .logo h1 {
        font-size: var(--font-size-base);
    }

    .theme-toggle {
        padding: var(--spacing-xs);
        font-size: var(--font-size-base);
    }

    .main-content {
        padding: var(--spacing-sm);
    }

    .card {
        padding: var(--spacing-md);
    }

    .stats-container {
        grid-template-columns: 1fr !important;
    }

    .mobile-menu-toggle {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */
@media (max-height: 600px) and (orientation: landscape) {
    .sidebar {
        height: calc(100vh - 60px);
        top: 60px;
    }

    .header {
        padding: var(--spacing-xs) var(--spacing-md);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .sidebar,
    .header,
    .footer,
    .mobile-menu-toggle,
    .theme-toggle {
        display: none !important;
    }

    .app-container {
        grid-template-areas: "main";
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --glass-border: rgba(148, 163, 184, 0.5);
    }

    .card,
    .glass-card {
        border-width: 2px;
    }

    .btn {
        border-width: 2px;
    }
}