/*
 * ============================================================================
 * Mobile Responsive Styles
 * ============================================================================
 * Mobile-specific styles and media queries for responsive design.
 * Includes mobile menu, toolbar adjustments, and modal improvements.
 * ============================================================================
 */

@media (max-width: 768px) {
    /* ============================================================================
     * CONTAINER & LAYOUT
     * ============================================================================ */
    .container {
        padding: 10px;
    }

    /* ============================================================================
     * TOOLBAR ADJUSTMENTS
     * ============================================================================ */
    .toolbar {
        padding: 10px;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .toolbar-logo {
        order: 1;
        margin-right: auto;
    }

    .toolbar h1 {
        display: none;
    }

    /* ============================================================================
     * BUTTON ADJUSTMENTS
     * ============================================================================ */
    button.primary-action {
        padding: 8px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
    }

    button.destructive {
        padding: 8px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        order: 3;
    }

    .btn-text-mobile {
        display: inline;
        font-size: 16px;
    }

    .btn-text-desktop {
        display: none;
    }

    /* ============================================================================
     * MOBILE MENU
     * ============================================================================ */
    .mobile-menu-btn {
        display: inline-block;
        padding: 8px;
        font-size: 18px;
        width: 40px;
        height: 40px;
        order: 4;
        margin-left: 0;
    }

    .secondary-actions {
        display: none;
    }

    .mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--bg-header);
        border: 1px solid var(--border-header);
        border-radius: 4px;
        margin-top: 8px;
        min-width: 200px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        flex-direction: column;
        gap: 0;
    }

    .mobile-menu.open {
        display: flex;
    }

    .mobile-menu button {
        width: 100%;
        text-align: left;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-header);
        margin: 0;
    }

    .mobile-menu button:last-child {
        border-bottom: none;
        border-radius: 0 0 4px 4px;
    }

    .mobile-menu button:first-child {
        border-radius: 4px 4px 0 0;
    }

    /* ============================================================================
     * INFO BAR & TOOLTIP
     * ============================================================================ */
    .info-container {
        display: none; /* Hide info bar on mobile */
    }

    .info {
        padding: 8px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .floating-tooltip {
        display: block;
    }

    /* ============================================================================
     * BREADCRUMB BAR
     * ============================================================================ */
    .breadcrumb-bar {
        padding: 8px 10px;
        font-size: 12px;
    }

    .back-button {
        padding: 6px 12px;
        font-size: 14px;
        min-width: auto;
    }

    /* ============================================================================
     * EDGE INTERACTION
     * ============================================================================ */
    .edge-click-buffer {
        stroke-width: 30 !important;
    }

    /* ============================================================================
     * MODAL IMPROVEMENTS
     * ============================================================================ */
    .modal-overlay {
        position: fixed;
        inset: 0;
        height: calc(var(--vh, 1vh) * 100);
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .modal-dialog {
        min-width: unset;
        max-width: 400px;
        width: calc(100% - 32px);
        padding: 20px;
        margin: auto;
        max-height: calc(var(--vh, 1vh) * 90);
        overflow-y: auto;
        position: relative;
        z-index: 1001;
    }

    .modal-dialog h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .project-name-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
    }

    .modal-buttons {
        flex-direction: row;
        gap: 8px;
    }

    .modal-buttons button {
        flex: 1;
        padding: 12px;
    }
}

/* ============================================================================
 * EXTRA SMALL SCREENS
 * ============================================================================ */
@media (max-width: 480px) {
    .info {
        white-space: normal;
        font-size: 12px;
    }

    .modal-dialog {
        width: calc(100% - 16px);
        padding: 16px;
    }
}
