/* Mobile-friendly CSS for Stickee App - Fix horizontal scrolling and button positioning */

/* Reset and base mobile styles */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    body, html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 10px !important;
        padding-bottom: 80px !important; /* Space for footer */
    }
    
    /* Main container */
    #root, .app, .container {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Header/Toolbar - ensure buttons stay within viewport */
    .header, .toolbar, .nav {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 10px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    /* Action buttons - fixed positions within viewport */
    .add-button, .settings-button, .user-info, .search-button {
        position: fixed !important;
        z-index: 1000 !important;
    }
    
    .add-button {
        bottom: 90px !important; /* Above footer */
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
    }
    
    .settings-button {
        top: 20px !important;
        right: 20px !important;
        width: 44px !important;
        height: 44px !important;
    }
    
    .search-button {
        top: 20px !important;
        right: 70px !important; /* Next to settings */
        width: 44px !important;
        height: 44px !important;
    }
    
    .user-info {
        top: 20px !important;
        left: 20px !important;
        font-size: 12px !important;
        max-width: 150px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* Sticky notes - better mobile layout */
    .sticky-note {
        width: calc(100vw - 40px) !important;
        max-width: 350px !important;
        min-height: 150px !important;
        margin: 8px 20px !important;
        padding: 12px !important;
    }
    
    .sticky-note h3 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }
    
    .sticky-note p {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    /* Notes container - single column with proper spacing */
    .notes-container, .notes-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 10px 0 !important;
        width: 100% !important;
        align-items: center !important;
    }
    
    /* Modal adjustments */
    .modal, .popup {
        width: 95% !important;
        max-width: 350px !important;
        margin: 20px auto !important;
        left: 2.5% !important;
        right: 2.5% !important;
    }
    
    /* Input fields - prevent zoom */
    input, textarea {
        font-size: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        border: 1px solid #ccc !important;
    }
    
    /* Footer adjustments - ensure it's visible and not overlapping */
    footer {
        font-size: 12px !important;
        padding: 15px !important;
        width: 100% !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999 !important;
        background: var(--light) !important;
        border-top: 2px solid var(--dark) !important;
    }
    
    /* Touch-friendly buttons */
    button, .btn {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
    }
    
    /* Pin icon positioning */
    .pin-icon {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Ensure no horizontal scrolling */
    .main-content, .content-wrapper {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

/* Extra small phones - iPhone SE dimensions (375x667) and similar */
@media (max-width: 480px) {
    .sticky-note {
        width: calc(100vw - 20px) !important;
        max-width: 300px !important;
        min-height: 120px !important;
        margin: 5px 10px !important;
        padding: 10px !important;
    }
    
    .add-button {
        bottom: 80px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    .settings-button {
        top: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
    }
    
    .search-button {
        top: 15px !important;
        right: 60px !important; /* Adjusted for smaller screen */
        width: 40px !important;
        height: 40px !important;
    }
    
    .user-info {
        top: 15px !important;
        left: 15px !important;
        font-size: 11px !important;
        max-width: 120px !important;
    }
    
    footer {
        font-size: 11px !important;
        padding: 10px !important;
    }
}

/* Very small screens - ensure buttons don't overlap */
@media (max-width: 360px) {
    .search-button {
        right: 55px !important;
    }
    
    .user-info {
        max-width: 100px !important;
    }
}
