@media (max-width: 768px) {


    body.light-theme .header {
        border-bottom: 0;
    }
    
    .position-data-table {
        overflow-x: auto;
        width: 100%;
    }
    
    .position-data-table .mobile-table-container {
        width: 100%;
        overflow-x: auto;
        border: 1px solid #5555557a;
    }
    
    .position-data-table .selected-positions-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }
    
    .position-data-table .selected-positions-table td {
        width: 50%;
        padding: 8px;
        vertical-align: top;
        word-wrap: break-word;
        box-sizing: border-box;
    }
    
    .position-data-table .position-item {
        display: flex;
        align-items: flex-start;
        width: 100%;
        min-height: 40px;
    }
    
    .position-data-table .selected-position-icon {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .position-data-table .position-item-data {
        flex: 1;
        min-width: 0;
        width: 100%;
    }
    
    .position-data-table .selected-position-title {
        display: block;
        font-size: 12px;
        line-height: 1.2;
    }
    
    .position-data-table .position-amount {
        display: block;
        font-size: 12px;
        font-weight: 500;
        word-break: break-all;
        line-height: 1.3;
    }
    
    .position-data-table .input-wrapper {
        width: 100%;
        max-width: 100%;
        position: relative;
        display: flex;
        align-items: center;
        gap: 4px;
        box-sizing: border-box;
    }
    
    .position-data-table .input-field {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 40px);
        padding: 4px 6px;
        font-size: 12px;
        /* border: 1px solid #ddd; */
        border-radius: 4px;
        /* background: #fff; */
        box-sizing: border-box;
    }
    
    .position-data-table .input-field:disabled {
        background: transparent;
        border: 1px solid transparent;
        color: inherit;
        font-weight: 500;
    }
    
    .position-data-table .input-icons {
        flex-shrink: 0;
        display: flex;
        gap: 2px;
        width: auto;
    }
    
    .position-data-table .input-icons i {
        font-size: 12px;
        cursor: pointer;
        padding: 2px;
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .position-data-table .selected-positions-table td {
        padding: 6px;
    }
    
    .position-data-table .input-field {
        font-size: 11px;
        padding: 3px 4px;
        max-width: calc(100% - 35px);
    }
    
    .position-data-table .input-icons i {
        font-size: 11px;
        width: 14px;
        height: 14px;
    }

    .cancel-btn.disabled{
        border-color: #ccc!important;
        color: #ccc;
        cursor: not-allowed;
    }
    .cancel-btn.disabled:hover{
        background-color: transparent!important;
        border-color: #ccc!important;
        transition: background-color 0.3s ease;
        color: #ccc;
        cursor: not-allowed;
    }


    .close-position{
        padding:10px;
    }

    .close-position .sell-market-btn{
        background-color: #f0b90b;
        color: #fff;
        border: none;
        padding: 10px 10px;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s ease;
        width: 50%;
        height: 40px;
        display: block;
        margin: 0 auto;
        font-size: 15px;
        font-weight: bold;
    }

    .close-position .sell-market-btn:hover{
        background-color: #e8843d;
    }

    .position-data-table {
        border: 1px solid #555;
        padding: 0!important;
    }
    .selected-positions-table {
        width: 100%;
        table-layout: auto;
        border-collapse: collapse;
    }
    .selected-positions-table .position-item{
        display: flex;
        align-items: center;
        /* padding: 5px; */
    }
    .selected-position-icon{
        margin-right: 10px;
    }
    .token-symbol{
        margin-right: 10px;
    }
    .selected-position-title{
        font-weight: bold;
        color: #f0b90b;
        white-space: nowrap;
    }
    body.light-theme .selected-position-title{
        color: #ff954e;
    }
    body.light-theme .selectedRow td,
    .selectedRow td{
        background-color: rgba(240, 185, 11, 0.2);
        /* color: #000; */
    }

    .position-data-table .cancel-btn {    background-color: transparent;
        color: #fff;
        border: 1px solid #f0b90b;
        border-radius: 5px;
        padding: 0;
        cursor: pointer;
        transition: background-color 0.3s ease;
        width: 100%;
        height: 30px;
        display: block;
        margin: 0 auto;
        font-size: 12px;
    }

    .position-data-table .cancel-btn:hover {
        background-color: #f0b90b;
        color: white;
        transition: background-color 0.3s ease, transform 0.3s ease;
    }

    body.light-theme .position-data-table .cancel-btn {    background-color: transparent;
        color: #000;
    }
    .selected-position-icon img{
        width: 22px;
    }
    .selected-position-icon i{
        font-size: 20px;
    }
    .position-item-data{
        display: flex;
        flex-direction: column;
        align-items: left;
        gap: 5px;
        justify-content: center;
    }
    body.light-theme .mobile-positions-table {
        display: block;
        background-color: #fff;
        padding: 15px;
        border-radius: 10px;
        overflow-x: auto;
        overflow: hidden;
        margin-bottom: 15px;
        border: 1px solid #5555557a;
    }
    .mobile-positions-table {
        display: block;
        background-color: #131722;
        padding: 15px;
        border-radius: 10px;
        overflow-x: auto;
        overflow: hidden;
        margin-bottom: 15px;
    }
    .mobile-positions-table-header{
        padding: 0;
        margin: 0;
        margin-bottom: 10px;
    }
    .table-container{
        display: none;
    }
    .table-list th{
        font-size: 12px;
    }
    .table-list td{
        font-size: 12px;
        height: 27px;
    }
    .container {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
    }
    .trade-layout {
        display: flex !important;
        flex-direction: column !important;
        /* gap: 10px !important; */
        grid-template-columns: none !important;
        min-height: auto !important;
        padding: 0 !important;
    }
    
    .split {
        height: auto !important;
        flex-direction: column !important;
    }
    .mobile-tabs-header {
        background: #333;
        border-bottom: 0;
        position: sticky;
        top: 0;
        z-index: 100;
        width: 100%;
        box-sizing: border-box;
    }
    body.light-theme .dropdown-container {
        border: 0;
        border-top: 0;
    }

    .calculator{
        display: none;
    }
    
    body.light-theme .mobile-tabs-header {
        background: #f8f9fa;
        border-bottom: 0;
    }
    
    .mobile-tab-nav {
        display: flex;
        padding: 0 10px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .mobile-tab-nav::-webkit-scrollbar {
        display: none;
    }

    .c-popup-close {
        right: 5px;
        top: 0px;
    }
    
    .tab-btn {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: none;
        border: none;
        color: #aaa;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        position: relative;
        transition: color 0.2s ease, background-color 0.2s ease;
        text-align: center;
        border-radius: 0;
    }
    
    .tab-btn:hover {
        color: #f0b90b;
        background-color: rgba(240, 185, 11, 0.1);
    }
    
    .tab-btn.active {
        color: #f0b90b;
        background-color: rgba(240, 185, 11, 0.2);
    }
    
    .tab-btn.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: #f0b90b;
    }
    
    
    body.light-theme .tab-btn {
        color: #e67e08;
    }
    
    body.light-theme .tab-btn:hover {
        color: #f0b90b;
        background-color: rgba(255, 204, 0, 0.1);
    }
    
    body.light-theme .tab-btn.active {
        color: #000;
        background-color: #fff;
    }
    body.light-theme .tab-btn {
        background-color: #e4e3e3;
        color: #000000;
        border: 0!important;
    }
    
    body.light-theme .tab-btn.active::after {
        background: #ff954e;
    }
    
    .tab-btn .badge {
        background: #f0b90b;
        color: #000;
        border-radius: 12px;
        padding: 2px 2px;
        font-size: 10px;
        font-weight: bold;
        margin-left: 5px;
        min-width: 15px;
        height: 15px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    
    body.light-theme .tab-btn .badge {
        background: #ff954e;
        color: white;
    }
    
    .left-section {
        width: 100% !important;
        order: 1;
        background-color: #131722;
        border-radius: 10px;
        /* padding: 10px; */
        /* margin-bottom: 10px; */
        box-sizing: border-box;
        min-height: 300px;
    }
    
    .mobile-container {
        order: 2;
    }
    
    .trade-section {
        width: 100% !important;
        height: auto;
        background-color: #131722;
        border-radius: 10px;
        padding: 15px;
        padding-top: 10px;
        margin-bottom: 0;
        box-sizing: border-box;
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    td {
        border: 1px solid #5555557a;
    }
    
    body.light-theme .left-section,
    body.light-theme .trade-section {
        background-color: #ffffff;
        /* border: 1px solid #e5e5e5; */
        /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    }

    body.light-theme .dropdown-header, .dropdown-header{
        border:0;
    }
    
    body.light-theme .mobile-container {
        order: 2;
    }
    
    .chart-section {
        width: 100% !important;
        /* min-height: calc(100vh - 320px) !important; */
        /* padding: 10px !important; */
        margin-bottom: 5px;
        order: 1;
    }
    
    #tv_chart_container {
        width: 100% !important;
        /* height: calc(100vh - 320px) !important; */
        border-radius: 8px;
        overflow: hidden;
    }
    
    
    .table-container {
        width: 100% !important;
        order: 3;
        background-color: #222 !important;
        padding: 15px !important;
        border-radius: 10px;
        margin-top: 10px;
        overflow-x: auto;
        box-sizing: border-box;
    }
    
    
    body.light-theme .table-container {
        background-color: #ffffff !important;
        border: 1px solid #e5e5e5;
    }
    
    .mobile-positions {
        display: block;
        width: 100%;
        max-width: 100%;
    }
    
    .mobile-container {
        flex-direction: column;
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .left-section.split {
        flex-direction: column !important;
        display: flex !important;
        height: auto !important;
    }
    
    .left-section.split .chart-section {
        flex: none !important;
        height: 350px !important;
        max-height: 350px !important;
        min-height: 350px !important;
    }
    
    .left-section.split .table-container {
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .gutter,
    .gutter-vertical,
    .gutter-horizontal {
        display: none !important;
    }
    
    .dropdown-container.hide,
    .chart-section.hide,
    .trade-section.hide,
    .table-container.hide {
        display: none !important;
    }
    
    .tab-mobile-active {
        background-color: #f0b90b;
    }
    .dropdown-menu {
        max-height: calc(100vh - 220px);
        min-height: 150px;
    }
    
    body.light-theme .dropdown-menu {
        max-height: calc(100vh - 220px);
        min-height: 150px;
    }
    
    .order-badge {
        font-size: 9px;
        width: 16px;
        height: 16px;
        margin-left: 4px;
    }
    
    
    .dropdown-header {
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .left-section-dropdown {
        width: 100%;
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
    }
    
    .left-section-dropdown .current-coin {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 2px;
    }
    
    
    .mobile-stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        width: 100%;
        font-size: 9px;
        margin-top: 4px;
    }
    
    .mobile-stats-grid .stat-item {
        text-align: center;
        border-right: 1px solid #444;
        padding-right: 6px;
    }
    
    .mobile-stats-grid .stat-item:last-child {
        border-right: none;
    }
    
    .mobile-stats-grid .stat-label {
        display: block;
        color: #aaa;
        font-size: 12px;
        margin-bottom: 1px;
    }
    
    .mobile-stats-grid .stat-value {
        display: block;
        font-weight: bold;
        font-size: 12px;
    }
    
    .right-section-dropdown {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        margin-top: 4px;
    }
    
    
    .left-section-dropdown .change,
    .left-section-dropdown .high,
    .left-section-dropdown .low {
        display: none;
    }
    
    .dropdown-container {
        width: 100%;
        max-width: 100%;
    }
    
    
    .dropdown-menu {
        position: fixed;
        left: 0;
        right: 0;
        /* width: calc(100vw - 20px);
        max-width: calc(100vw - 20px); */
        box-sizing: border-box;
        overflow-x: hidden;
        z-index: 1000;
        top: auto;
    }
    
    
    .dropdown-container {
        position: relative;
    }
    
    .dropdown-menu table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }
    
    .dropdown-menu th,
    .dropdown-menu td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 6px 2px;
        font-size: 12px;
        border: none;
    }
    
    .dropdown-menu th {
        font-size: 12px;
    }
    
    .dropdown-menu th:nth-child(1),
    .dropdown-menu td:nth-child(1) {
        width: 50%;
    }
    
    .dropdown-menu th:nth-child(2),
    .dropdown-menu td:nth-child(2) {
        width: 25%;
        text-align: right;
    }
    
    .dropdown-menu th:nth-child(3),
    .dropdown-menu td:nth-child(3) {
        width: 25%;
        text-align: right;
    }
}

/* Hide mobile tabs on desktop */
@media (min-width: 769px) {
    .mobile-tabs-header {
        display: none !important;
    }
}


@media (max-width: 480px) {
    .dropdown-menu {
        max-height: calc(100vh - 220px);
        min-height: 120px;
    }
    
    body.light-theme .dropdown-menu {
        max-height: calc(100vh - 220px);
        min-height: 120px;
    }
}

