/* Enhanced Responsive Design Improvements for GamePort.Ai */

/* Additional breakpoints for better responsiveness */

/* Extra small devices (phones, 320px and up) */
@media (max-width: 320px) {
  .shell { 
    grid-template-columns: 35px 1fr; 
    margin: 0; 
    border-radius: 0; 
  }
  
  .icon { 
    width: 28px; 
    height: 28px; 
    border-radius: 6px; 
  }
  
  .rail-icons, .rail-bottom { 
    gap: 8px; 
    margin-top: 8px; 
  }
  
  .hero { 
    margin-top: 50px; 
    padding: 0 10px; 
  }
  
  .hero h1 { 
    font-size: 20px; 
    line-height: 1.2;
  }
  
  .hero h2 { 
    font-size: 14px; 
  }
  
  .sub { 
    font-size: 11px; 
    line-height: 1.4;
  }
  
  .search-box { 
    padding: 10px 10px 35px; 
    border-radius: 10px; 
    margin: 0 5px;
  }
  
  .search-box input {
    font-size: 12px;
  }
  
  .tags { 
    left: 8px; 
    bottom: 6px; 
    gap: 3px; 
    max-width: 55%; 
  }
  
  .tags button { 
    padding: 2px 5px; 
    font-size: 9px; 
    border-radius: 6px; 
  }
  
  .actions { 
    right: 6px; 
    bottom: 4px; 
    gap: 3px; 
  }
  
  .actions button { 
    width: 22px; 
    height: 22px; 
    border-radius: 5px; 
  }
  
  .topbar { 
    padding: 6px 8px; 
  }
  
  .wordmark { 
    font-size: 10px; 
  }
  
  .btn { 
    padding: 3px 6px; 
    font-size: 9px; 
    border-radius: 6px; 
  }
  
  .rail-panel { 
    inset: 0 auto 0 35px; 
  }
  
  .rail.open .rail-panel { 
    width: calc(100vw - 35px); 
  }
  
  .bottom-chat-bar { 
    left: 35px; 
    padding: 6px 8px; 
  }
  
  .bottom-chat-input { 
    padding: 4px 70px 4px 8px; 
    border-radius: 10px; 
  }
  
  .bottom-chat-input input { 
    font-size: 11px; 
  }
  
  .bottom-chat-actions button { 
    width: 22px; 
    height: 22px; 
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
  .shell { 
    grid-template-columns: 55px 1fr; 
  }
  
  .hero { 
    margin-top: 90px; 
    padding: 0 18px; 
  }
  
  .hero h1 { 
    font-size: 32px; 
  }
  
  .hero h2 { 
    font-size: 20px; 
  }
  
  .search-box { 
    max-width: 500px;
    padding: 15px 15px 50px; 
  }
  
  .game-card { 
    flex-direction: column;
    text-align: center;
  }
  
  .game-image { 
    width: 100%; 
    height: 150px; 
    margin: 0 0 12px 0; 
  }
  
  .game-info { 
    padding: 12px; 
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
  .shell { 
    grid-template-columns: 65px 1fr; 
  }
  
  .hero { 
    margin-top: 120px; 
    padding: 0 24px; 
  }
  
  .hero h1 { 
    font-size: 38px; 
  }
  
  .hero h2 { 
    font-size: 22px; 
  }
  
  .search-box { 
    max-width: 650px;
  }
  
  .game-card { 
    flex-direction: row;
  }
  
  .game-image { 
    width: 100px; 
    height: 100px; 
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
  .hero { 
    max-width: 850px; 
    margin-top: 140px; 
  }
  
  .hero h1 { 
    font-size: 40px; 
  }
  
  .hero h2 { 
    font-size: 24px; 
  }
  
  .search-box { 
    max-width: 700px;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) and (max-width: 1599px) {
  .hero { 
    max-width: 950px; 
    margin-top: 160px; 
  }
  
  .hero h1 { 
    font-size: 44px; 
  }
  
  .hero h2 { 
    font-size: 26px; 
  }
  
  .search-box { 
    max-width: 750px;
  }
}

/* Ultra wide screens (1920px and up) */
@media (min-width: 1920px) {
  .hero { 
    max-width: 1400px; 
    margin-top: 300px; 
  }
  
  .hero h1 { 
    font-size: 56px; 
  }
  
  .hero h2 { 
    font-size: 32px; 
  }
  
  .search-box { 
    max-width: 1000px;
    padding: 24px 24px 70px; 
  }
  
  .search-box input { 
    font-size: 20px; 
  }
  
  .tags button { 
    padding: 8px 12px; 
    font-size: 15px; 
  }
  
  .actions button { 
    width: 36px; 
    height: 36px; 
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .hero { 
    margin-top: 40px; 
  }
  
  .hero h1 { 
    font-size: 28px; 
  }
  
  .hero h2 { 
    font-size: 18px; 
  }
  
  .search-box { 
    padding: 12px 12px 40px; 
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero h1, .hero h2 {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .icon, .btn, .tags button, .actions button {
    min-height: 44px;
    min-width: 44px;
  }
  
  .search-box input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .tags button {
    padding: 8px 12px;
  }
}

/* Print styles */
@media print {
  .rail, .topbar, .bottom-chat-bar, .fx {
    display: none !important;
  }
  
  .shell {
    grid-template-columns: 1fr;
  }
  
  .hero {
    margin-top: 0;
    color: black;
  }
  
  .search-box {
    border: 2px solid black;
    background: white;
  }
}

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

/* Dark mode support (if system preference changes) */
@media (prefers-color-scheme: light) {
  /* Keep dark theme as default for this gaming platform */
}

/* Container query support for modern browsers */
@supports (container-type: inline-size) {
  .search-box {
    container-type: inline-size;
  }
  
  @container (max-width: 400px) {
    .tags {
      flex-direction: column;
      align-items: flex-start;
    }
  }
}

/* Focus improvements for accessibility */
@media (prefers-reduced-motion: no-preference) {
  .icon:focus, .btn:focus, .tags button:focus, .actions button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    transform: scale(1.05);
  }
}

/* Flexible grid improvements */
.game-recommendations {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .game-recommendations {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }
}

@media (min-width: 1200px) {
  .game-recommendations {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  }
}

/* Improved text scaling */
.hero h1, .hero h2, .sub {
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
}

/* Better button spacing on small screens */
@media (max-width: 480px) {
  .top-right {
    gap: 6px;
  }
  
  .top-right .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Improved sidebar responsiveness */
@media (max-width: 768px) {
  .rail.open .rail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: none;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
  }
  
  .panel-head {
    margin-top: 60px;
  }
}

/* Enhanced game card responsiveness */
@media (max-width: 600px) {
  .game-card {
    flex-direction: column;
    text-align: center;
  }
  
  .game-image {
    width: 100%;
    height: 120px;
    margin: 0 0 12px 0;
  }
  
  .game-info {
    padding: 12px;
  }
  
  .game-meta {
    justify-content: center;
  }
  
  .game-actions {
    justify-content: center;
  }
}

/* Improved typography scaling */
@media (max-width: 480px) {
  .ai-message h3 {
    font-size: 14px;
    line-height: 1.3;
  }
  
  .ai-message p, .ai-message li {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .game-title {
    font-size: 14px;
    line-height: 1.3;
  }
  
  .game-description {
    font-size: 11px;
    line-height: 1.4;
  }
}

/* Better spacing for very large screens */
@media (min-width: 2560px) {
  .hero {
    max-width: 1600px;
    margin-top: 400px;
  }
  
  .hero h1 {
    font-size: 64px;
  }
  
  .hero h2 {
    font-size: 36px;
  }
  
  .search-box {
    max-width: 1200px;
    padding: 28px 28px 80px;
  }
}

