/* mobile.css - Responsive styles for mobile devices */

@media only screen and (max-width: 768px) {
    /* General layout adjustments */
    .dashboard-container {
        overflow-x: hidden;
    }
    
    .trading-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto;
        height: auto;
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .left-column, .chart-area, .right-column {
        grid-column: 1 !important;
    }
    
    /* Header adjustments */
    .dashboard-header {
        padding: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    /* Market selector adjustments */
    .market-selector {
        max-height: 300px;
    }
    
    .market-item {
        padding: 0.5rem;
    }
    
    /* Chart area adjustments */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 250px; /* Fixed height for mobile */
  margin: 0 auto;
}
canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 200px;
}
    
    .chart-header {
        padding: 0.75rem;
    }
    
    .market-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .market-stats {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .stat-item {
        font-size: 0.7rem;
    }
    
    .chart-intervals {
        justify-content: center;
        gap: 0.25rem;
    }
    
    .interval-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
    }
    
    /* Order book adjustments */
    .order-book-container {
        height: 250px;
    }
    
    .order-book-row {
        padding: 0.25rem 0.3rem;
        font-size: 0.65rem;
        gap: 0.25rem;
    }
    
    /* Recent trades adjustments */
    .recent-trades {
        height: 250px;
    }
    
    .trades-table th, 
    .trades-table td {
        padding: 0.3rem;
        font-size: 0.7rem;
    }
    
    /* Order forms adjustments */
    .order-forms-container {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .buy-order-form, 
    .sell-order-form {
        padding: 0.75rem;
    }
    
    .form-header h3 {
        font-size: 1rem;
    }
    
    .balance-info {
        font-size: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.75rem;
    }
    
    .form-group input {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .btn-buy, .btn-sell {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .percent-btn {
        padding: 0.25rem;
        font-size: 0.7rem;
    }
    
    /* Open orders adjustments */
    .open-orders {
        max-height: 300px;
    }
    
    .orders-table th, 
    .orders-table td {
        padding: 0.3rem;
        font-size: 0.7rem;
    }
    
    /* Hide less important columns on mobile */
    .orders-table th:nth-child(1),
    .orders-table td:nth-child(1),
    .orders-table th:nth-child(6),
    .orders-table td:nth-child(6) {
        display: none;
    }
    
    /* Modal adjustments */
    .modalO-content {
        width: 95% !important;
        max-width: none !important;
    }
    
    .confirm-row {
        font-size: 0.9rem;
    }
    
    /* Toast adjustments */
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    /* Specific element hiding for mobile */
    .logo-icon {
        display: none;
    }
    
    /* Order book spread adjustments */
    .order-book-spread {
        padding: 0.25rem;
        font-size: 0.65rem;
    }
    
    /* Chart action buttons */
    .chart-actions {
        gap: 0.25rem;
    }
    
    .chart-action-btn {
        padding: 3px 5px;
        font-size: 0.7rem;
    }
    
    /* Input currency labels */
    .input-currency {
        font-size: 0.75rem;
        right: 5px;
    }
    
    /* Market pair display */
    .market-pair {
        font-size: 1rem;
    }
    
    .market-price {
        font-size: 1rem;
    }
    
    /* Header buttons */
    .btn-icon {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }
    
    .btn-primary {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media only screen and (max-width: 480px) {
    /* Even smaller devices */
    .trading-content {
        padding: 0.25rem;
        gap: 0.5rem;
    }
    
    .market-pair-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }
    
    .market-price, .market-change {
        font-size: 0.9rem;
    }
    
    .stat-item {
        flex: 1 0 45%;
    }
    
    .order-book-row {
        grid-template-columns: 1fr 0.8fr 0.8fr;
    }
    
    .orders-table th:nth-child(4),
    .orders-table td:nth-child(4) {
        display: none;
    }
    
    .form-percentages {
        gap: 0.25rem;
    }
    
    .percent-btn {
        padding: 0.15rem;
        font-size: 0.6rem;
    }
    
    .btn-buy, .btn-sell {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .modalO-body {
        padding: 0.75rem;
    }
    
    .confirm-row {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .modalO-actions {
        gap: 0.5rem;
    }
    
    .modalO-actions .btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Portrait orientation specific adjustments */
@media only screen and (max-width: 768px) and (orientation: portrait) {
    .chart-container {
        height: 50vh;
    }
    
    .left-column {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .order-book-container, .recent-trades {
        height: 200px;
    }
}

/* Landscape orientation specific adjustments */
@media only screen and (max-width: 768px) and (orientation: landscape) {
    .trading-content {
        grid-template-rows: auto auto !important;
    }
    
    .left-column {
        grid-row: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .chart-area {
        grid-row: 2;
    }
    
    .right-column {
        grid-row: 3;
    }
    
    .order-book-container, .recent-trades {
        height: 150px;
    }
    
    .chart-container {
        height: 60vh;
    }
}

/* Very small height devices */
@media only screen and (max-height: 600px) {
    .chart-container {
        height: 40vh;
    }
    
    .order-book-container, .recent-trades {
        height: 150px;
    }
    
    .open-orders {
        max-height: 200px;
    }
}

/* iPhone 5/SE specific */
@media only screen and (max-width: 320px) {
    .interval-btn {
        padding: 0.15rem 0.25rem;
        font-size: 0.6rem;
    }
    
    .market-name {
        font-size: 0.75rem;
    }
    
    .market-price {
        font-size: 0.75rem;
        width: 4rem;
    }
    
    .market-change {
        font-size: 0.65rem;
        width: 3.5rem;
    }
    
    .form-header h3 {
        font-size: 0.9rem;
    }
    
    .balance-info {
        font-size: 0.65rem;
    }
    
    .btn-buy, .btn-sell {
        font-size: 0.7rem;
    }
}
