/* GOPX Africa Exchange - Mobile Responsive Styles */

@media (max-width: 1024px) {
  .trade-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .portfolio-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .chart-container {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  /* Header Mobile Styles */
  .nav-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 16px;
    gap: 8px;
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .nav-link {
    padding: 12px 16px;
    border-radius: 8px;
    width: 100%;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  .btn span {
    display: none;
  }
  
  /* Trade Page Mobile */
  .trading-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .pair-selector {
    width: 100%;
    justify-content: space-between;
  }
  
  .timeframes {
    width: 100%;
    justify-content: space-between;
  }
  
  .current-price {
    font-size: 1.5rem;
  }
  
  .chart-container {
    height: 250px;
    padding: 16px;
  }
  
  .orderbook {
    max-height: 300px;
  }
  
  .orderbook-header {
    padding: 12px 16px;
  }
  
  .orderbook-content {
    max-height: 250px;
  }
  
  .orderbook-sells,
  .orderbook-buys {
    padding: 8px 16px;
  }
  
  .orderbook-header-row {
    font-size: 0.75rem;
    gap: 8px;
  }
  
  .orderbook-row {
    font-size: 0.8rem;
    gap: 8px;
  }
  
  .spread-info {
    padding: 8px 16px;
  }
  
  /* Trading Panel Mobile */
  .trading-panel {
    gap: 16px;
  }
  
  .wallet-info {
    padding: 16px;
  }
  
  .wallet-balances {
    margin-bottom: 12px;
  }
  
  .balance-item .balance {
    font-size: 1rem;
  }
  
  .order-form {
    padding: 16px;
  }
  
  .percentage-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .pct-btn {
    padding: 10px;
  }
  
  .recent-trades {
    padding: 16px;
  }
  
  .recent-trades h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }
  
  .trade-item {
    font-size: 0.8rem;
    gap: 8px;
  }
  
  /* Markets Page Mobile */
  .markets-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .market-filters {
    width: 100%;
    flex-direction: column;
  }
  
  .search-input {
    min-width: auto;
    width: 100%;
  }
  
  .markets-table-container {
    border-radius: 8px;
  }
  
  .markets-table {
    font-size: 0.85rem;
  }
  
  .markets-table th,
  .markets-table td {
    padding: 12px 8px;
  }
  
  .market-pair {
    font-size: 0.9rem;
  }
  
  .mini-chart {
    width: 60px;
    height: 25px;
  }
  
  /* Portfolio Page Mobile */
  .portfolio-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .portfolio-value {
    text-align: left;
  }
  
  .portfolio-value .value {
    font-size: 1.5rem;
  }
  
  .wallets-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .wallet-card {
    padding: 16px;
  }
  
  .wallet-balance {
    font-size: 1.5rem;
  }
  
  .portfolio-stats {
    padding: 20px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  /* Orders Page Mobile */
  .orders-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .orders-table {
    font-size: 0.8rem;
  }
  
  .orders-table th,
  .orders-table td {
    padding: 10px 6px;
  }
  
  /* Modal Mobile */
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  /* Toast Mobile */
  .toast {
    top: 70px;
    right: 16px;
    left: 16px;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .header-content {
    height: 56px;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .logo img {
    width: 32px;
    height: 32px;
  }
  
  /* Hero Section Mobile */
@media (max-width: 768px) {
  .hero-section {
    padding: 40px 0 60px;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero-main {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.4rem;
  }
  
  .hero-description {
    font-size: 1.1rem;
  }
  
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stat-item {
    padding: 16px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .hero-visual {
    height: 300px;
  }
  
  .african-pattern {
    width: 200px;
    height: 200px;
  }
  
  .crypto-item {
    font-size: 0.8rem;
    padding: 10px 16px;
  }
}

/* Trade Page Ultra Mobile */
  .trading-header {
    margin-bottom: 16px;
  }
  
  .pair-selector {
    flex-direction: column;
    gap: 8px;
  }
  
  .timeframes {
    gap: 2px;
  }
  
  .timeframe-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .current-price {
    font-size: 1.3rem;
  }
  
  .chart-container {
    height: 200px;
    padding: 12px;
  }
  
  .orderbook {
    max-height: 250px;
  }
  
  .orderbook-header {
    padding: 10px 12px;
  }
  
  .orderbook-header h3 {
    font-size: 1rem;
  }
  
  .orderbook-content {
    max-height: 200px;
  }
  
  .orderbook-sells,
  .orderbook-buys {
    padding: 6px 12px;
  }
  
  .orderbook-header-row {
    font-size: 0.7rem;
    gap: 6px;
  }
  
  .orderbook-row {
    font-size: 0.75rem;
    gap: 6px;
  }
  
  /* Trading Panel Ultra Mobile */
  .wallet-info {
    padding: 12px;
  }
  
  .balance-item .balance {
    font-size: 0.95rem;
  }
  
  .order-form {
    padding: 12px;
  }
  
  .form-group {
    margin-bottom: 12px;
  }
  
  .form-control {
    padding: 10px;
  }
  
  .percentage-buttons {
    margin-bottom: 12px;
  }
  
  .pct-btn {
    padding: 8px;
    font-size: 0.85rem;
  }
  
  .recent-trades {
    padding: 12px;
  }
  
  .recent-trades h4 {
    margin-bottom: 10px;
  }
  
  .trade-item {
    padding: 6px 0;
    font-size: 0.75rem;
    gap: 6px;
  }
  
  /* Markets Ultra Mobile */
  .markets-header h2 {
    font-size: 1.5rem;
  }
  
  .markets-table {
    font-size: 0.75rem;
  }
  
  .markets-table th,
  .markets-table td {
    padding: 8px 4px;
  }
  
  .market-pair {
    font-size: 0.85rem;
  }
  
  .mini-chart {
    width: 50px;
    height: 20px;
  }
  
  /* Portfolio Ultra Mobile */
  .portfolio-header h2 {
    font-size: 1.5rem;
  }
  
  .portfolio-value .value {
    font-size: 1.3rem;
  }
  
  .wallets-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .wallet-card {
    padding: 12px;
  }
  
  .wallet-currency {
    font-size: 1rem;
  }
  
  .wallet-balance {
    font-size: 1.3rem;
  }
  
  .wallet-available {
    font-size: 0.8rem;
  }
  
  .portfolio-stats {
    padding: 16px;
  }
  
  .portfolio-stats h3 {
    font-size: 1.1rem;
  }
  
  .stat-card {
    padding: 10px;
  }
  
  .stat-value {
    font-size: 1rem;
  }
  
  /* Orders Ultra Mobile */
  .orders-header h2 {
    font-size: 1.5rem;
  }
  
  .orders-table {
    font-size: 0.7rem;
  }
  
  .orders-table th,
  .orders-table td {
    padding: 8px 4px;
  }
  
  /* Modal Ultra Mobile */
  .modal-content {
    width: 98%;
    margin: 10px;
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .modal-header h3 {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .auth-form {
    gap: 12px;
  }
  
  /* Toast Ultra Mobile */
  .toast {
    top: 66px;
    padding: 12px;
    min-height: auto;
  }
  
  .toast-content {
    gap: 8px;
  }
  
  .toast-message {
    font-size: 0.9rem;
  }
}

/* Footer Mobile */
@media (max-width: 768px) {
  .footer {
    padding: 40px 0 20px;
    margin-top: 40px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
}

/* Touch optimizations for mobile */
@media (hover: none) and (pointer: coarse) {
  .orderbook-row:hover,
  .markets-table tr:hover,
  .orders-table tr:hover {
    background: transparent;
  }
  
  .orderbook-row:active,
  .markets-table tr:active,
  .orders-table tr:active {
    background: rgba(0, 82, 255, 0.1);
  }
  
  .btn:hover {
    transform: none;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .wallet-card:hover {
    transform: none;
    box-shadow: none;
  }
  
  .wallet-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 82, 255, 0.2);
  }
}

/* Landscape mobile optimizations */
@media (max-height: 600px) and (orientation: landscape) {
  .chart-container {
    height: 180px;
  }
  
  .orderbook {
    max-height: 200px;
  }
  
  .orderbook-content {
    max-height: 160px;
  }
  
  .trading-panel {
    gap: 12px;
  }
  
  .wallet-info {
    padding: 10px;
  }
  
  .order-form {
    padding: 10px;
  }
  
  .recent-trades {
    padding: 10px;
  }
  
  .modal-content {
    max-height: 80vh;
  }
}

/* Dark mode improvements for mobile (already dark by default) */
@media (prefers-color-scheme: dark) {
  /* Already optimized for dark theme */
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #666666;
    --text-secondary: #cccccc;
  }
  
  .btn {
    border-width: 2px;
  }
  
  .form-control {
    border-width: 2px;
  }
}

/* RTL support for Arabic markets */
@media (direction: rtl) {
  .header-content {
    flex-direction: row-reverse;
  }
  
  .nav-menu {
    flex-direction: row-reverse;
  }
  
  .wallet-balances {
    flex-direction: row-reverse;
  }
  
  .orderbook-header {
    flex-direction: row-reverse;
  }
  
  .modal-header {
    flex-direction: row-reverse;
  }
  
  .toast {
    right: auto;
    left: 20px;
    transform: translateX(-400px);
  }
  
  .toast.show {
    transform: translateX(0);
  }
}