/* Mobile Responsive Styles for Coach.AI */

@media (max-width: 768px) {
    /* Hide desktop navigation */
    .nav-bar {
        display: none;
    }

    /* Full screen layout */
    body {
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-container {
        padding: 0;
    }

    .main-content {
        padding: 0;
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e9ecef;
        display: flex;
        justify-content: space-around;
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        text-decoration: none;
        color: #6c757d;
        font-size: 11px;
        cursor: pointer;
        transition: color 0.2s;
        border: none;
        background: none;
    }

    .mobile-nav-item.active {
        color: #667eea;
    }

    .mobile-nav-icon {
        font-size: 22px;
    }

    /* Tab Content */
    .tab-content {
        padding: 16px;
        min-height: 100vh;
    }

    /* Dashboard Mobile */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .card {
        border-radius: 12px;
        margin-bottom: 0;
    }

    .progress-card .chart-controls {
        flex-direction: column;
        gap: 12px;
    }

    .metric-toggles {
        flex-wrap: wrap;
    }

    .progress-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quick-stat {
        padding: 16px;
    }

    /* Nutrition Mobile */
    .nutrition-header {
        flex-direction: column;
        gap: 12px;
    }

    .nutrition-controls {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .date-selector {
        width: 100%;
    }

    .nutrition-grid {
        grid-template-columns: 1fr;
    }

    .macro-rings {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .meal-sections {
        gap: 12px;
    }

    /* Lift Log Mobile */
    .lift-log-header {
        flex-direction: column;
        gap: 12px;
    }

    .lift-log-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .lift-log-controls button {
        width: 100%;
        justify-content: center;
    }

    .weekly-split {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .day-card {
        padding: 12px;
    }

    /* Chat Mobile */
    .chat-layout {
        height: calc(100vh - 70px);
    }

    .chat-container {
        height: 100%;
    }

    .chat-messages {
        padding: 12px;
    }

    .message {
        max-width: 85%;
    }

    /* Modals Mobile */
    .modal {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content {
        padding: 16px;
    }

    /* Forms Mobile */
    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    /* Buttons Mobile */
    button, .btn, .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }

    /* Inputs Mobile */
    input, select, textarea {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    /* Notes Mobile */
    .notes-app {
        flex-direction: column;
    }

    .notes-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .notes-editor {
        width: 100%;
    }

    /* Workout Log Mobile */
    .workout-log-section {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        background: white;
        overflow-y: auto;
    }

    .exercises-list {
        gap: 12px;
    }

    /* Touch Optimizations */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

/* iPhone Specific */
@media (max-width: 430px) {
    /* iPhone safe areas */
    @supports (padding: max(0px)) {
        body {
            padding-top: max(env(safe-area-inset-top), 0px);
        }
    }

    /* Smaller text for compact screens */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }

    /* Tighter spacing */
    .tab-content {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }
}
