/* 
 * W Pay Fintech - Responsive Stylesheet
 * Version: 1.0.0
 * Author: W Pay Development Team
 */

/* Mobile First Approach */
@media (max-width: 576px) {
  /* Typography */
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
  }
  
  /* Layout */
  .container {
    padding: 0 1rem;
  }
  
  /* Header */
  .header {
    padding: 0.75rem 0;
  }
  
  .logo img {
    height: 30px;
  }
  
  /* Hero Section */
  .hero {
    padding: 2rem 0;
    text-align: center;
  }
  
  .hero h1 {
    font-size: 1.75rem !important;
    margin-bottom: 1rem;
  }
  
  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .hero-buttons .btn {
    width: 100%;
  }
  
  /* Features */
  .features {
    padding: 2rem 0;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  /* Cards */
  .cards-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  
  .card {
    width: 100%;
    max-width: 300px;
  }
  
  /* Dashboard */
  .dashboard-content {
    padding: 1rem;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .table th, 
  .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-control {
    padding: 0.625rem;
  }
  
  /* Footer */
  .footer {
    padding-top: 2rem;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-newsletter form {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .footer-newsletter input,
  .footer-newsletter button {
    width: 100%;
    border-radius: 0.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1rem 0;
  }
  
  .footer-bottom-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Small tablets and large phones */
@media (min-width: 577px) and (max-width: 767px) {
  /* Typography */
  h1 {
    font-size: 2.25rem !important;
  }
  
  /* Layout */
  .container {
    padding: 0 1.25rem;
  }
  
  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  
  /* Cards */
  .cards-container {
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
  }
  
  /* Dashboard */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
  /* Layout */
  .container {
    padding: 0 1.5rem;
  }
  
  /* Features */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* Cards */
  .cards-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
  }
  
  .card {
    width: calc(50% - 1rem);
    max-width: 300px;
  }
  
  /* Dashboard */
  .dashboard {
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  /* Footer */
  .footer-top {
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
  }
}

/* Small desktops */
@media (min-width: 992px) and (max-width: 1199px) {
  /* Layout */
  .container {
    padding: 0 2rem;
  }
  
  /* Dashboard */
  .dashboard {
    grid-template-columns: 220px 1fr;
    gap: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* RTL Support */
[dir="rtl"] {
  /* Text alignment */
  .text-right {
    text-align: left;
  }
  
  .text-left {
    text-align: right;
  }
  
  /* Navigation */
  .main-nav li {
    margin-left: 0;
    margin-right: 1.5rem;
  }
  
  .auth-buttons .btn {
    margin-left: 0;
    margin-right: 1rem;
  }
  
  /* Forms */
  .form-check-input {
    margin-right: 0;
    margin-left: 0.5rem;
  }
  
  /* Dashboard */
  .dashboard-nav ul li a i {
    margin-right: 0;
    margin-left: 1rem;
  }
  
  /* Tables */
  .table th,
  .table td {
    text-align: right;
  }
  
  /* Cards */
  .stat-card {
    border-left: none;
    border-right: 4px solid var(--primary-color);
  }
  
  /* Footer */
  .footer-newsletter input {
    border-radius: 0 0.5rem 0.5rem 0;
  }
  
  .footer-newsletter button {
    border-radius: 0.5rem 0 0 0.5rem;
  }
  
  /* Icons and elements that need flipping */
  .user-dropdown-btn .fa-chevron-down {
    margin-left: 0;
    margin-right: 0.5rem;
  }
  
  .step:not(:last-child)::after {
    right: auto;
    left: -50px;
  }
  
  /* Mobile menu */
  .mobile-menu {
    right: auto;
    left: -100%;
    transition: left var(--transition-normal);
  }
  
  .mobile-menu.active {
    right: auto;
    left: 0;
  }
}

/* High-DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images for high-DPI screens */
  .logo img,
  .footer-logo img {
    transform: scale(1);
  }
}

/* Print Styles */
@media print {
  body {
    background-color: #fff;
    color: #000;
    font-size: 12pt;
  }
  
  .header,
  .footer,
  .mobile-menu,
  .mobile-menu-toggle,
  .btn,
  .dashboard-sidebar {
    display: none !important;
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  
  .dashboard {
    display: block;
  }
  
  .dashboard-content {
    box-shadow: none;
    padding: 0;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
  
  table {
    border-collapse: collapse;
  }
  
  table, th, td {
    border: 1px solid #000;
  }
}

/* Animations for page transitions */
.page-transition-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms, transform 300ms;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 300ms;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
