/* Mobile Responsiveness Fixes for GDCS Portal */

/* Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1050; /* Below toggle, above content */
}

.sidebar-backdrop.active {
    display: block;
}

/* Sidebar behavior on small screens */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 1100 !important;
        width: 280px !important;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        padding: 80px 15px 100px 15px !important; /* Proper spacing for mobile */
    }
    .mobile-nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed !important;
        left: 15px !important; /* MOVED TO LEFT */
        top: 15px !important;
        right: auto !important;
        z-index: 1200 !important;
        width: 50px;
        height: 50px;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(67, 24, 255, 0.25);
    }
}

/* Bottom Nav - Only visible on Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.08);
    display: none;
    justify-content: space-around;
    padding: 12px 5px;
    z-index: 1000;
    border-radius: 25px 25px 0 0;
}

.bottom-nav-item {
    text-align: center;
    text-decoration: none;
    color: #A3AED0;
    font-size: 0.65rem;
    font-weight: 700;
    flex: 1;
}

.bottom-nav-item.active { color: var(--primary-color); }
.bottom-nav-item i { display: block; font-size: 1.3rem; margin-bottom: 3px; }

@media (max-width: 991px) {
    .bottom-nav { display: flex; }
}

/* Profile Banner Adjustments */
@media (max-width: 768px) {
    .profile-banner {
        height: auto !important;
        padding: 40px 20px 80px 20px !important;
        border-radius: 30px !important;
        margin-bottom: 80px !important;
    }
    .avatar-container {
        position: relative !important;
        bottom: 0 !important;
        left: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important;
    }
    .profile-img {
        width: 130px !important;
        height: 130px !important;
        border-radius: 40px !important;
    }
    .user-name-title {
        font-size: 1.6rem !important;
        justify-content: center !important;
    }
}

/* Table Responsiveness */
@media (max-width: 768px) {
    .responsive-table-mobile thead {
        display: none;
    }
    .responsive-table-mobile, .responsive-table-mobile tbody, .responsive-table-mobile tr, .responsive-table-mobile td {
        display: block;
        width: 100%;
    }
    .responsive-table-mobile tr {
        margin-bottom: 15px;
        border-radius: 20px;
        padding: 15px;
        background: #fff;
        box-shadow: 0 4px 15px rgba(0,0,0,0.03);
        border: 1px solid #f0f2f8;
    }
    .responsive-table-mobile td {
        text-align: right;
        padding: 10px 0;
        position: relative;
        border: none;
        border-bottom: 1px solid #f8f9fa;
        min-height: 40px;
    }
    .responsive-table-mobile td:last-child {
        border-bottom: none;
    }
    .responsive-table-mobile td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        font-weight: 800;
        color: #A3AED0;
        font-size: 0.7rem;
        text-transform: uppercase;
    }
}

/* Fix for buy coins box */
@media (max-width: 576px) {
    .estimated-box {
        flex-direction: column !important;
        text-align: center !important;
        gap: 10px !important;
        padding: 20px !important;
    }
}
