/* Mobile Overrides for NF Tasks */

@media (max-width: 600px) {
    :root {
        /* Slightly larger base font for mobile */
        font-size: 16px;
    }

    body {
        /* Prevent accidental scrolling */
        touch-action: none;
    }

    /* Icon Buttons - User preferred top for mobile */
    .icon-btn-group {
        bottom: auto;
        left: 50%;
        top: 0px;
        transform: translateX(-50%);
        gap: 15px;
        padding: 10px 20px;
        background: rgba(15, 15, 19, 0.7);
        backdrop-filter: blur(12px);
        border-radius: 40px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        width: fit-content;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .icon-btn {
        width: 48px;
        height: 48px;
        padding: 0;
    }

    .icon-btn img {
        width: 26px;
        height: 26px;
    }

    /* Modals - Full width and responsive */
    .modal {
        align-items: flex-start;
        padding-top: 0px;
        /* Space for the top buttons */
    }

    .modal-content.glass {
        width: 95%;
        max-width: 95%;
        padding: 1.2rem;
        margin: 10px auto;
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Table Refinement */
    th,
    td {
        padding: 6px 4px;
        font-size: 0.7rem;
        line-height: 1.1;
    }

    .priority-cell {
        font-size: 0.7rem;
        padding: 2px 5px;
        min-width: 18px;
        text-align: center;
    }

    .days-cell {
        padding: 2px 4px;
        font-size: 0.75rem;
        min-width: 25px;
    }

    /* Large modals (Tables, Notes) */
    .modal-content.large {
        width: 98% !important;
        height: 95vh !important;
        max-height: 95vh;
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    /* Form improvements */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group label {
        margin-bottom: 4px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
        /* Prevent iOS zoom on focus */
    }

    .actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .actions button {
        width: 100%;
        padding: 1rem;
    }

    /* Table Responsiveness */
    .table-container {
        padding-right: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 100%;
        /* Change from 500px to 100% */
        table-layout: fixed;
    }

    th,
    td {
        padding: 6px 4px;
        /* More compact padding */
        font-size: 0.75rem;
        /* Slightly smaller text */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Column width distribution */
    th:nth-child(1),
    td:nth-child(1) {
        width: 35%;
    }

    /* Name */
    th:nth-child(2),
    td:nth-child(2) {
        width: 18%;
    }

    /* Start */
    th:nth-child(3),
    td:nth-child(3) {
        width: 18%;
    }

    /* Final */
    th:nth-child(4),
    td:nth-child(4) {
        width: 15%;
    }

    /* Priority */
    th:nth-child(5),
    td:nth-child(5) {
        width: 14%;
    }

    /* Days */

    .priority-cell {
        font-size: 0.7rem;
        padding: 2px 4px;
    }

    /* Subscriptions specific */
    .subs-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-card strong {
        font-size: 1.1rem;
    }

    /* Notes specific */
    .notes-tabs {
        gap: 5px;
    }

    .notes-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .notes-editor-contenteditable {
        font-size: 1rem;
        line-height: 1.5;
    }
}