/* ====================================
   Responsive Media Queries
   ==================================== */

/* Large Screens */
@media (min-width: 1200px) {
    .wrapper {
        max-width: 1080px;
    }
}

@media (max-width: 1199px) {
    .wrapper {
        max-width: 960px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .wrapper {
        max-width: 720px;
        width: 95%;
    }

    .title {
        font-size: 26px;
    }

    .two-col {
        flex-direction: column;
        gap: 12px;
    }

    .two-col textarea {
        height: 180px;
        min-height: 180px;
    }

    .progress-summary-row {
        flex-direction: column;
        align-items: center;
    }

    .account-progress-item {
        max-width: 100%;
        width: 100%;
    }

    .result-table td:nth-child(5) {
        max-width: 150px;
    }
}

/* Mobile - Large */
@media (max-width: 767px) {
    .wrapper {
        width: 98%;
        padding: 0 8px;
        margin: 10px auto;
    }

    .title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .tabs {
        gap: 5px;
    }

    .tab {
        padding: 5px 10px;
        font-size: 12px;
    }

    .top-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn,
    .qr-refresh-btn-content {
        padding: 7px 12px;
        font-size: 12px;
        height: 36px;
    }

    .account-card {
        padding: 15px;
    }

    .two-col {
        flex-direction: column;
        gap: 15px;
    }

    .numbers-container,
    .messages-container {
        width: 100%;
    }

    .two-col textarea {
        height: 150px;
        min-height: 150px;
        font-size: 12px;
        width: 100%;
    }

    .message-tabs-header {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .message-tabs-wrap {
        min-width: 0;
        overflow: hidden;
    }

    .message-tabs-scroller {
        max-width: 100%;
    }

    .m-tab {
        min-width: 34px;
        padding: 6px 10px;
    }

    .progress-summary-section,
    .global-section {
        padding: 15px;
    }

    .progress-summary-section h3,
    .global-section h3 {
        font-size: 16px;
    }

    .progress-account-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .result-wrapper {
        overflow-x: hidden;
    }

    .result-table {
        width: 100%;
        min-width: 0;
        font-size: 11px;
        table-layout: fixed;
    }

    .result-table th,
    .result-table td {
        padding: 7px 5px;
        vertical-align: middle;
    }

    .result-table th {
        font-size: 10px;
        letter-spacing: 0;
    }

    .result-table th:nth-child(1),
    .result-table td:nth-child(1) {
        width: 34px;
        padding-left: 8px;
        text-align: center;
    }

    .result-table th:nth-child(2),
    .result-table td:nth-child(2) {
        width: 34px;
        text-align: center;
    }

    .result-table th:nth-child(2) {
        font-size: 0;
    }

    .result-table th:nth-child(2)::after {
        content: "BR";
        font-size: 10px;
    }

    .result-table .browser-full {
        display: none;
    }

    .result-table .browser-short {
        display: inline;
        font-weight: 800;
        color: var(--text-secondary);
    }

    .result-table th:nth-child(3),
    .result-table td:nth-child(3) {
        width: 104px;
    }

    .result-table th:nth-child(4),
    .result-table td:nth-child(4) {
        width: 62px;
    }

    .result-table th:nth-child(5),
    .result-table td:nth-child(5) {
        width: 46px;
    }

    .result-table td:nth-child(4) {
        font-size: 12px;
        font-weight: 800;
    }

    .result-table th:nth-child(6),
    .result-table td:nth-child(6) {
        width: auto;
        min-width: 0;
    }

    .result-table td.message-cell {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .result-table .message-preview {
        display: block;
        max-height: none;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        word-break: normal;
    }

    .result-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-input-row {
        flex-direction: column;
        gap: 10px;
    }

    .qr-inline-img {
        width: 220px;
        height: 220px;
    }

    .global-aggregate-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .utility-card {
        padding: 8px 10px;
        gap: 8px;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 12px 14px;
    }

    .modal-overlay {
        padding: 10px;
        align-items: center;
    }

    .modal-container {
        width: 100% !important;
        max-width: min(100%, 520px) !important;
        max-height: calc(100dvh - 20px);
        border-radius: 16px;
    }

    .modal-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .modal-header h3 {
        font-size: 16px;
        line-height: 1.25;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 14px 16px;
    }

    .modal-btn {
        flex: 1 1 120px;
        min-width: 0;
    }

    .pairing-phone-input,
    #pairingPhoneInput,
    #getPairCodeBtn {
        width: 100% !important;
        max-width: 320px;
    }

    .pairing-code-text {
        max-width: 100%;
        overflow: hidden;
        font-size: 40px;
        letter-spacing: 6px;
    }

    .qr-inline-text,
    .pairing-code-account {
        max-width: 100%;
        overflow-wrap: anywhere;
        border-radius: 12px;
    }

    .test-mode-popover {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }

    .schedule-time-row,
    .test-mode-delay-row {
        flex-wrap: wrap;
    }
}

/* Mobile - Small */
@media (max-width: 575px) {
    .wrapper {
        width: 100%;
        padding: 0 5px;
        margin: 5px auto;
    }

    .title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .tabs {
        justify-content: center;
        gap: 4px;
    }

    .tab {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 6px;
    }

    .top-actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .top-actions .btn {
        width: auto;
    }

    .btn,
    .qr-refresh-btn-content {
        padding: 8px 10px;
        font-size: 11px;
        height: 34px;
    }

    .btn.blast-all {
        width: 100%;
        max-width: 100%;
    }

    .account-card {
        padding: 12px;
        border-radius: 12px;
    }

    .two-col {
        flex-direction: column;
        gap: 12px;
    }

    .two-col textarea {
        height: 140px;
        min-height: 140px;
        font-size: 11px;
    }

    .message-tabs-header {
        gap: 6px;
    }

    .m-tab {
        min-width: 32px;
        padding: 5px 9px;
        font-size: 11px;
    }

    .progress-account-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .result-table {
        min-width: 0;
        font-size: 10px;
    }

    .result-table th,
    .result-table td {
        padding: 6px 4px;
    }

    .result-table th:nth-child(1),
    .result-table td:nth-child(1) {
        width: 28px;
        padding-left: 6px;
    }

    .result-table th:nth-child(2),
    .result-table td:nth-child(2) {
        width: 28px;
    }

    .result-table th:nth-child(3),
    .result-table td:nth-child(3) {
        width: 96px;
    }

    .result-table th:nth-child(4),
    .result-table td:nth-child(4) {
        width: 58px;
    }

    .result-table th:nth-child(5),
    .result-table td:nth-child(5) {
        width: 42px;
    }

    .result-table td:nth-child(4) {
        font-size: 11px;
        font-weight: 800;
    }

    .qr-inline-img,
    #qrPopupImg {
        width: 200px;
        height: 200px;
    }

    .pairing-code-text {
        font-size: 36px;
        letter-spacing: 5px;
    }

    .global-aggregate-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ag-stat-item {
        padding: 10px 8px;
    }

    .ag-value {
        font-size: 22px;
    }

    .utility-card {
        width: 100%;
        border-radius: 12px;
        justify-content: space-around;
        gap: 6px;
    }

    .btn.utility-btn {
        flex: 1;
        min-width: 90px;
        justify-content: center;
        font-size: 10px !important;
        padding: 5px 8px !important;
    }

    .modal-overlay {
        padding: 6px;
    }

    .modal-container {
        border-radius: 14px;
        max-height: calc(100dvh - 12px);
    }

    .modal-header {
        padding: 12px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 22px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-footer {
        padding: 12px;
    }

    .modal-btn {
        width: 100%;
        flex-basis: 100%;
    }

    .toast {
        gap: 8px;
        padding: 10px 12px;
    }

    .toast-icon {
        font-size: 20px;
    }

    .toast-message {
        font-size: 12px;
        line-height: 1.4;
    }

    .toast-close {
        width: 22px;
        height: 22px;
        font-size: 20px;
    }
}

/* Tablet Responsive (768px breakpoint - already handled in 767px) */
@media (max-width: 768px) {
    .progress-summary-row {
        flex-direction: column;
        align-items: center;
    }

    .account-progress-item {
        max-width: 100%;
        width: 100%;
    }
}
