/* Responsive Styles */

/* Tablets and small desktops */
@media screen and (max-width: 1024px) {
  .broker-cards {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .weight-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .header-content h1 {
    font-size: 2.2rem;
  }
}

/* Tablets */
@media screen and (max-width: 768px) {
  .broker-cards {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }
  
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  
  .header-content h1 {
    font-size: 2rem;
  }
  
  .header-content p {
    font-size: 1rem;
  }
  
  .broker-table th,
  .broker-table td,
  .methodology-table th,
  .methodology-table td {
    padding: 0.75rem;
  }
  
  .weight-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  
  .weight-percentage {
    font-size: 1.75rem;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 640px) {
  .broker-cards {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .weight-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header-content h1 {
    font-size: 1.75rem;
  }
  
  .main-header {
    padding: 1.5rem 0;
  }
  
  .logo-container {
    margin-bottom: 1.5rem;
  }
  
  .logo {
    font-size: 1.25rem;
  }
  
  .logo i {
    font-size: 1.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-logo {
    justify-content: center;
  }
  
  .footer-social {
    justify-content: center;
  }
  
  .error-container h1 {
    font-size: 5rem;
  }
  
  .error-container h2 {
    font-size: 1.75rem;
  }
  
  .error-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .primary-btn, .secondary-btn {
    width: 100%;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 480px) {
  .broker-card {
    padding: 1.25rem;
  }
  
  .header-content h1 {
    font-size: 1.5rem;
  }
  
  .header-content p {
    font-size: 0.95rem;
  }
  
  .weight-cards {
    grid-template-columns: 1fr;
  }
  
  .logo-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .language-switch {
    width: 100%;
    justify-content: center;
  }
  
  .error-container h1 {
    font-size: 4rem;
  }
  
  .error-container h2 {
    font-size: 1.5rem;
  }
  
  /* Make tables responsive for very small screens */
  .broker-table th:nth-child(4),
  .broker-table td:nth-child(4),
  .broker-table th:nth-child(5),
  .broker-table td:nth-child(5) {
    display: none;
  }
  
  .table-wrapper {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
    border-radius: 0;
  }
}

/* RTL specific adjustments */
@media screen and (max-width: 640px) {
  body:not(.ltr) .logo-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  body:not(.ltr) .language-switch {
    width: 100%;
    justify-content: center;
  }
}

/* Adjust table scrolling for RTL */
body:not(.ltr) .table-wrapper {
  direction: rtl;
}

/* Ensure proper table cell alignment for RTL */
body:not(.ltr) .broker-table td,
body:not(.ltr) .methodology-table td {
  text-align: right;
}

/* Adjust list marker positions for RTL */
body:not(.ltr) .values-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}

body:not(.ltr) .values-list li::before {
  left: auto;
  right: 0;
}

/* Adjust logo icon spacing for RTL */
body:not(.ltr) .logo i,
body:not(.ltr) .footer-logo i,
body:not(.ltr) .error-logo i {
  margin-right: 0;
  margin-left: 0.5rem;
}

/* Adjust error page buttons for RTL */
@media screen and (max-width: 640px) {
  body:not(.ltr) .error-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
}