/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #0a1628;
    padding: 0.5rem;
}

/* Tablet Styles (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        gap: 0.3rem;
    }
    
    .nav-links a {
        padding: 0.6rem 0.9rem;
        font-size: 0.95rem;
    }
    
    .container {
        padding: 1.5rem;
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    /* Mobile Menu */
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links > li {
        width: 100%;
    }
    
    .nav-links a {
        padding: 1rem 2rem;
        border-radius: 0;
    }
    
    .nav-links a::after {
        display: none !important;
    }
    
    .nav-links a:hover {
        transform: none !important;
        background: rgba(10, 22, 40, 0.05);
    }
    
    /* Dropdown on Mobile */
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: #f8f9fa;
        border-radius: 0;
        margin: 0;
        padding: 0;
    }
    
    .nav-links li:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding: 0.8rem 3rem;
        font-size: 0.95rem;
    }
    
    .dropdown-icon {
        display: inline;
    }
    
    /* Container */
    .container {
        padding: 1rem;
    }
    
    /* Cards */
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.6rem !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    p {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
    }
    
    /* Grid Layouts */
    .exercise-grid,
    .food-grid,
    .metric-grid,
    .calculator-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Tables */
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem !important;
    }
    
    /* Footer */
    footer {
        padding: 2rem 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-section {
        text-align: center;
    }
}

/* Small Mobile Styles (max-width: 480px) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.8rem 1rem;
    }
    
    .logo {
        font-size: 1.5rem !important;
    }
    
    body {
        padding-top: 0;
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.6rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    .card {
        padding: 1.2rem;
    }
    
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Hide less important elements on very small screens */
    .exercise-icon {
        font-size: 2.5rem !important;
    }
    
    .big-number {
        font-size: 2.5rem !important;
    }
    
    /* Simplify grid layouts */
    .gender-selection {
        grid-template-columns: 1fr !important;
    }
    
    .slider-value {
        font-size: 1.5rem !important;
    }
    
    .macro-card {
        padding: 1rem !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 0;
    }
    
    nav {
        position: relative;
    }
    
    .hero-diabetes,
    .exercise-hero {
        height: auto;
        padding: 2rem 1rem;
    }
}

/* Responsive Images */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .food-image,
    .exercise-hero img {
        height: 200px;
    }
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
    
    .show-desktop {
        display: block !important;
    }
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Prevent text zoom on iOS */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Responsive spacing */
@media (max-width: 768px) {
    [style*="gap: 2rem"] {
        gap: 1rem !important;
    }
    
    [style*="margin: 2rem"] {
        margin: 1rem !important;
    }
    
    [style*="padding: 2rem"] {
        padding: 1rem !important;
    }
}

