/* Mobile-specific styles */

@media (max-width: 768px) {
    /* Better tap targets */
    button,
    .session-item {
        min-height: 44px;
    }

    /* Adjust font sizes */
    body {
        font-size: 16px; /* Prevent zoom on input focus */
    }

    .login-container h1 {
        font-size: 1.75rem;
    }

    /* Input area */
    .input-area {
        padding: 0.75rem;
    }

    #message-input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    /* Messages padding */
    .messages {
        padding: 0.75rem;
    }

    .message {
        max-width: 90%;
    }

    /* Sidebar full width on small screens */
    .sidebar {
        width: 85%;
        max-width: none;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Even smaller screens */
    .app-header h2 {
        font-size: 1rem;
    }

    .message-content {
        font-size: 0.9rem;
    }

    .session-item h4 {
        font-size: 0.95rem;
    }
}

/* iOS-specific tweaks */
@supports (-webkit-touch-callout: none) {
    /* Safe area for notch */
    .app-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .input-area {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    /* Prevent overscroll bounce */
    body {
        position: fixed;
        overflow: hidden;
    }

    /* Smooth scrolling */
    .messages,
    .sessions-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    .login-container {
        padding: 1rem;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .app-header {
        padding: 0.5rem 1rem;
    }

    .app-header h2 {
        font-size: 1rem;
    }
}

/* Dark mode adjustments for iOS */
@media (prefers-color-scheme: dark) {
    /* Already dark by default */
}

/* Reduce animations on low-power mode */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch feedback */
button:active,
.session-item:active {
    transform: scale(0.98);
    opacity: 0.8;
}
