/* Mobile Navigation */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        background: var(--panel);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-height: 100vh;
        padding: 1rem;
        padding-top: 4rem;
    }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--accent);
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.2rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        transition: all 0.2s ease;
    }
    
    .mobile-menu-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
}

/* Tablet Styles */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-top: 4.5rem; /* Account for mobile menu button */
    }
    
    .top-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        background: var(--card);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .top-header h1 {
        margin: 0;
        font-size: 1.8rem;
        color: var(--text);
    }
    
    .user-info {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    /* Quick Stats Mobile */
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .quick-stat {
        padding: 1rem;
        text-align: center;
    }
    
    .quick-stat i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
        display: block;
        margin: 0.5rem 0;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Progress Section Mobile */
    .progress-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .progress-card {
        padding: 1.5rem;
    }
    
    /* Stats Section Mobile */
    .stats-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    /* Fitness Goals Mobile */
    .fitness-goals-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .goal-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Notifications Mobile */
    .notifications-panel {
        margin-bottom: 2rem;
    }
    
    .notification-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .notification-content {
        text-align: center;
    }
    
    /* Footer Mobile */
    .footer {
        text-align: center;
        padding: 1rem;
    }
    
    .footer p {
        font-size: 0.8rem;
        margin: 0.25rem 0;
    }
}

/* Mobile Phone Styles */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
        padding-top: 4.5rem;
    }
    
    .top-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .top-header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .user-info {
        gap: 0.75rem;
    }
    
    .mobile-menu-btn {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.6rem;
        font-size: 1.1rem;
    }
    
    /* Quick Stats Single Column */
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .quick-stat {
        padding: 0.75rem;
    }
    
    /* Progress Cards */
    .progress-card {
        padding: 1rem;
    }
    
    .progress-card h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .continue-btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Stat Cards */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    /* SVG Responsive */
    .run-activity-preview svg {
        width: 100%;
        height: auto;
        max-height: 120px;
    }
    
    /* Fitness Goals */
    .fitness-goals-section {
        padding: 1rem;
    }
    
    .goal-form {
        padding: 1rem;
    }
    
    .form-input {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Buttons Mobile */
    .goals-btn,
    .btn-primary,
    .clear-sessions-btn {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Notifications */
    .notification-item {
        padding: 0.75rem;
    }
    
    .notification-title {
        font-size: 0.9rem;
    }
    
    .notification-desc {
        font-size: 0.8rem;
    }
    
    .notification-time {
        font-size: 0.7rem;
    }
    
    /* Version Badge */
    .version-badge {
        bottom: 0.5rem;
        right: 0.5rem;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Mobile Menu Button (Hidden by default) */
.mobile-menu-btn {
    display: none;
}

/* Show mobile menu button on mobile */
@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block !important;
    }
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.mobile-overlay.active {
    display: block;
}

/* Fix body overflow on mobile */
@media (max-width: 1024px) {
    body {
        overflow-x: hidden;
    }
    
    body.menu-open {
        overflow: hidden;
    }
}

/* Responsive Images */
img, svg {
    max-width: 100%;
    height: auto;
}

/* Touch Targets */
@media (max-width: 768px) {
    button, a, input, select {
        min-height: 44px;
        min-width: 44px;
    }
    
    .notification-close {
        min-height: 32px;
        min-width: 32px;
    }
}