/* ==========================================================================
   BlushBank — Responsive Stylesheet
   Breakpoints: Tablet (<= 992px), Mobile (<= 576px)
   ========================================================================== */

/* Mobile Topbar (Hidden on desktop, visible on mobile/tablet) */
.bb-mobile-header {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--soft-pink);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.bb-hamburger {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--soft-pink);
    color: var(--accent);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.bb-hamburger:hover {
    background: #F2C7DA;
    color: var(--accent-hover);
}

/* Sidebar Overlay */
.bb-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(73, 50, 63, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bb-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Table Wrapper */
.table-responsive-bb {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Tablet Breakpoint (max-width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .bb-mobile-header {
        display: flex;
    }

    /* Collapse sidebar off-canvas */
    .bb-sidebar,
    .bb-admin-sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 30px rgba(73, 50, 63, 0.15);
        z-index: 1045;
    }

    /* Toggled open state */
    .bb-sidebar.sidebar-open,
    .bb-admin-sidebar.sidebar-open {
        transform: translateX(0);
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0 !important;
        padding: 20px;
        min-height: calc(100vh - 64px);
    }

    .page-header {
        margin-bottom: 20px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* Stat grid adjustments */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .bank-card-visual {
        max-width: 100%;
    }
}

/* ==========================================================================
   Mobile Breakpoint (max-width: 576px)
   ========================================================================== */
@media (max-width: 576px) {
    .main-content {
        padding: 14px 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .page-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .page-actions .btn,
    .page-actions .btn-blush,
    .page-actions .btn-blush-outline {
        width: 100%;
    }

    .bb-card {
        padding: 16px;
        border-radius: 14px;
    }

    .bb-card-header {
        padding-bottom: 12px;
        margin-bottom: 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Stat cards full width on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.55rem;
    }

    /* Bank Card Visual */
    .bank-card-visual {
        height: 200px;
        padding: 18px 20px;
        border-radius: 16px;
    }

    .bank-card-number {
        font-size: 1.2rem;
        letter-spacing: 2px;
        margin: 8px 0;
    }

    .bank-card-holder-val {
        font-size: 0.85rem;
    }

    /* Transaction Item */
    .transaction-item {
        padding: 12px 14px;
    }

    .tx-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .tx-title {
        font-size: 0.88rem;
    }

    .tx-amount {
        font-size: 0.95rem;
    }

    /* Table adjustments */
    .bb-table th,
    .bb-table td {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    /* Modals */
    .modal-dialog {
        margin: 12px;
    }

    .bb-modal .modal-header,
    .bb-modal .modal-body,
    .bb-modal .modal-footer {
        padding: 16px;
    }

    /* Toast notification */
    #bbToastContainer {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .bb-toast {
        min-width: unset;
        width: 100%;
    }

    /* Receipt */
    .receipt-wrapper {
        padding: 20px 16px;
    }

    .receipt-amount {
        font-size: 1.8rem;
    }
}
