/* ========================================
   bulobi - UNIFIED RESPONSIVE STYLES
   ======================================== */

/* ========================================
   BREAKPOINT SYSTEM
   ======================================== */
:root {
  --breakpoint-xs: 480px;   /* Small Mobile */
  --breakpoint-sm: 640px;   /* Large Mobile */
  --breakpoint-md: 768px;   /* Tablet */
  --breakpoint-lg: 1024px;  /* Desktop */
  --breakpoint-xl: 1200px;  /* Large Desktop */
  --breakpoint-2xl: 1400px; /* Extra Large Desktop */
}

/* ========================================
   LARGE DESKTOP & ULTRA-WIDE (1400px+)
   ======================================== */
@media (min-width: 1920px) {
  .container,
  .header-container {
    max-width: 1600px;
    margin: 0 auto;
  }

  .lobbies-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero-features-grid {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* ========================================
   LARGE DESKTOP (1400px)
   ======================================== */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 1200px;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   DESKTOP TO LARGE TABLET (1200px)
   ======================================== */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .hero-features-grid {
    display: none; /* Hide on tablet too */
  }

  .gaming-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   HAMBURGER MENU STYLES (Desktop)
   ======================================== */
.header-mobile-section {
  display: none;
}

/* ========================================
   FLOATING BUTTON BAR (Hidden on Desktop)
   ======================================== */
.floating-button-bar {
  display: none; /* PC'de gizli, mobil media query'de gösterilir */
}


/* Button visibility control */
.home-only {
  display: flex;
}

.lobbies-only {
  display: none;
}

body.lobbies-active .home-only {
  display: none;
}

body.lobbies-active .lobbies-only {
  display: flex;
}

.hamburger-menu {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 2px;
  background: #00FF7F;
  transition: all 0.3s ease;
  position: absolute;
}

.hamburger-line:nth-child(1) {
  top: 12px;
}

.hamburger-line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
  bottom: 12px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

.header-logo {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  color: #00FF7F;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 127, 0.5);
}

/* ========================================
   TABLET LANDSCAPE (1024px)
   ======================================== */
@media (max-width: 1024px) and (min-width: 1px) {
  /* Show hamburger menu and mobile header */
  .header-mobile-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .header-logo {
    display: flex;
  }

  .hamburger-menu {
    display: flex;
  }

  /* Adjust header container */
  .header-container {
    flex-wrap: wrap;
    position: relative;
  }

  /* Hide header nav by default */
  .header-nav {
    position: fixed;
    top: 70px; /* Updated for thicker header */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.98) 0%, rgba(15, 25, 20, 0.98) 100%);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1050;
    border-bottom: 1px solid rgba(0, 255, 127, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    visibility: hidden;
    opacity: 0;
  }

  /* Show nav when active */
  .header-nav.active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
  }

  /* Nav buttons full width */
  .nav-btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 14px;
  }

  .header-nav .nav-separator {
    display: none;
  }

  /* Hide stats on tablet */
  .header-right {
    display: none;
  }

  /* Hero Section */
  .hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
  }

  /* Grid Systems */
  .lobbies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .gaming-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Chat Integration */
  .chat-sidebar {
    width: 350px;
  }

  .main-content.chat-open {
    margin-right: 350px;
  }

  /* Notification Tablet */
  #fixedNotification {
    max-width: 350px;
    font-size: 13px;
  }

  /* Lobby Ticker - Fixed position touching bottom bar */
  .lobby-ticker-section {
    position: fixed;
    bottom: 0; /* Touch bottom bar - same level */
    left: 0;
    right: 0;
    z-index: 998;
    margin: 0;
    padding: 10px 0;
    margin-bottom: 75px; /* Push above bottom bar height */
  }

  /* Show Floating Button Bar on Tablet */
  .floating-button-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: space-around;
    align-items: center;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 255, 127, 0.2);
    padding: 15px;
    z-index: 1000;
  }

    /* Remove fixed positioning - now inside flex container */
    position: relative;
    bottom: auto;
    right: auto;
    left: auto;
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Make them round */
    font-size: 16px;
    flex: 0 0 auto;
    /* Disable hover animations on tablet/mobile */
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }

  /* Chat toggle specific styling */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }

  .chat-toggle-icon {
    font-size: 14px;
    line-height: 1;
  }

  .chat-toggle-count {
    font-size: 10px;
    line-height: 1;
  }

  /* Disable right slide animation */
    right: auto !important;
    transform: none !important;
  }
}

/* ========================================
   TABLET TO MOBILE (768px) - PRIMARY MOBILE BREAKPOINT
   ======================================== */
@media (max-width: 768px) {
  /* Base Typography */
  body {
    font-size: 14px;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  /* Container & Spacing */
  .container {
    padding: 0 15px;
  }

  section {
    padding: 40px 0;
  }

  /* Header Mobile Adjustments */
  .main-header {
    padding: 15px 0; /* Increased from 10px */
    height: 70px !important; /* Override PC fixed height of 40px */
    min-height: 70px; /* Force header height */
  }

  .header-container {
    padding: 0 15px;
    min-height: 50px; /* Ensure container height */
    display: flex;
    align-items: center;
  }

  /* Mobile Logo Size */
  .header-logo {
    font-size: 1rem;
  }

  .logo-icon {
    font-size: 1.2rem;
  }

  /* Smaller hamburger button */
  .hamburger-menu {
    width: 35px;
    height: 35px;
  }

  .hamburger-line {
    width: 22px;
  }

  /* Keep header-right hidden on mobile */
  .header-right {
    display: none;
  }

  /* Hero Section */
  .hero-futuristic {
    padding: 60px 20px 40px;
    min-height: calc(100vh - 70px); /* Updated for thicker header */
    height: auto;
  }

  .hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: 2px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 4px 12px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 15px;
  }

  .btn-cyber {
    width: 100%;
    min-width: unset;
    padding: 12px 20px;
  }

  .quick-stats {
    flex-direction: column;
    gap: 15px;
  }

  .quick-stat-item {
    width: 100%;
    padding: 15px;
  }

  .hero-features-grid {
    display: none; /* Hide on mobile/tablet */
  }

  /* Lobby Ticker */
  .lobby-ticker-section {
    margin: 20px 0;
  }

  .lobby-ticker-header {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  /* Lobbies Section */
  .lobbies-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 15px;
  }

  .lobby-card {
    padding: 15px;
  }

  .lobby-info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lobby-actions {
    flex-direction: column;
    gap: 10px;
  }

  .lobby-actions .btn {
    width: 100%;
  }

  /* Pagination */
  .pagination-sidebar {
    position: relative;
    bottom: auto;
    left: auto;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    padding: 15px;
    background: rgba(0, 10, 20, 0.95);
    border-radius: 0;
  }

  .page-btn {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }

  /* Modal */
  .modal-content {
    width: 95%;
    max-width: none;
    margin: 20px;
    max-height: 90vh;
  }

  .modal-header h3 {
    font-size: 1.2rem;
  }

  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .form-group {
    width: 100%;
  }

  /* Chat Sidebar */
  .chat-sidebar {
    width: 100%;
    height: 100vh;
    right: -100%;
  }

  .chat-sidebar.open {
    right: 0;
  }

  .main-content.chat-open {
    margin-right: 0;
  }

  .chat-messages {
    height: calc(100vh - 200px); /* Mobil için daha fazla alan */
  }

  /* Footer */
  .footer-cyber {
    padding: 30px 15px;
  }

  .footer-cyber-links {
    flex-direction: column;
    gap: 15px;
  }

  .footer-cyber-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  /* Lobby Ticker - Mobile fixed position */
  .lobby-ticker-section {
    margin-bottom: 64px; /* Push above mobile bottom bar */
    padding: 8px 0;
  }

  /* Mobile Bottom Bar */
  .floating-button-bar {
    padding: 12px;
  }

  /* Mobilde bottom bar göster, PC floating butonları gizle */
  .floating-button-bar {
    display: flex !important;
  }
  
  body .share-lobby-btn,
  body .refresh-btn,
  body .chat-toggle-btn,
  body .scroll-top-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* Table Responsive */
  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 8px 5px;
  }

  /* Gaming Framework Specific */
  .game-selector {
    flex-direction: column;
    width: 100%;
  }

  .game-btn {
    width: 100%;
  }

  .stats-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  /* Notification Mobile */
  #fixedNotification {
    left: 15px;
    right: 15px;
    top: auto;
    bottom: 120px;
    transform: none;
    max-width: none;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 20px;
    text-align: left;
  }
}

/* ========================================
   SMALL MOBILE (480px)
   ======================================== */
@media (max-width: 480px) {
  /* Ultra-compact adjustments */
  .header-nav {
    font-size: 0.8rem;
  }

  .nav-btn {
    padding: 6px 10px;
  }

  .live-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
  }

  .btn-cyber {
    font-size: 0.9rem;
    padding: 10px 15px;
  }

  .lobby-card {
    padding: 12px;
  }

  .lobby-title {
    font-size: 1rem;
  }

  .modal-content {
    margin: 10px;
    padding: 15px;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  input, textarea, select {
    font-size: 14px;
  }

  /* Hide less critical elements */
  .nav-separator,
  .footer-cyber-divider {
    display: none;
  }

  /* Optimize spacing */
  section {
    padding: 30px 0;
  }

  .container {
    padding: 0 10px;
  }

  /* Notification Ultra Small */
  #fixedNotification {
    bottom: 80px;
    font-size: 12px;
    padding: 8px 12px;
    left: 10px;
    right: 10px;
  }

  /* Lobby Ticker - Ultra Small Mobile fixed position */
  .lobby-ticker-section {
    margin-bottom: 59px; /* Push above ultra small bottom bar */
    padding: 6px 0;
  }

  /* Ultra Small Mobile Bottom Bar */
  .floating-button-bar {
    padding: 8px;
  }

  /* Ultra mobilde bottom bar göster, PC floating butonları gizle */
  .floating-button-bar {
    display: flex !important;
  }
  
  body .share-lobby-btn,
  body .refresh-btn,
  body .chat-toggle-btn,
  body .scroll-top-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover,
  .nav-btn:hover,
  .lobby-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Increase touch targets */
  .btn,
  .nav-btn,
  button {
    min-height: 44px;
    min-width: 44px;
  }

  /* Disable hover animations */
  .glitch-effect:hover,
  .cyber-glow:hover {
    animation: none;
  }
}

/* ========================================
   LANDSCAPE ORIENTATION (Mobile)
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-futuristic {
    min-height: auto;
    padding: 40px 20px 20px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .quick-stats {
    flex-direction: row;
  }

  .chat-sidebar {
    height: 100vh;
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ========================================
   HIGH DPI / RETINA DISPLAYS
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* Sharper borders and shadows */
  .lobby-card,
  .modal-content,
  .btn {
    border-width: 0.5px;
  }

  /* Optimize images */
  .rank-icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

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

  .glitch-effect,
  .cyber-glow,
  .loading-spinner {
    animation: none !important;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  /* Hide unnecessary elements */
  .header-nav,
  .hero-actions,
  .chat-sidebar,
  .footer-cyber,
  .modal-overlay,
  #fixedNotification {
    display: none !important;
  }

  /* Optimize for print */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: white;
  }

  .lobby-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  a {
    text-decoration: none;
    color: #000;
  }

  /* Show URLs */
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* ========================================
   CONTAINER QUERIES (Future Support)
   ======================================== */
@supports (container-type: inline-size) {
  .lobbies-section {
    container-type: inline-size;
  }

  @container (max-width: 768px) {
    .lobby-card {
      grid-template-columns: 1fr;
    }
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f1419;
    --text-primary: #e1e8ed;
  }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
@media (prefers-contrast: high) {
  .btn,
  .lobby-card {
    border: 2px solid currentColor;
  }

  .text-accent {
    font-weight: bold;
  }
}

/* ========================================
   MOBILE LIVE STATS ANIMATIONS
   ======================================== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.6; }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */
@media (max-width: 768px) {
  /* Disable complex animations on mobile */
  .hero-grid-overlay,
  .footer-cyber-grid {
    animation: none;
  }

  /* Simplify backgrounds */
  .hero-futuristic::before,
  .footer-cyber::before {
    display: none;
  }

  /* Reduce blur effects */
  .modal-overlay {
    backdrop-filter: none;
    background: rgba(0, 0, 0, 0.9);
  }
}

/* ========================================
   DESKTOP (1025px+) - PC Layout
   ======================================== */
@media (min-width: 1025px) {
  /* Hamburger menüyü gizle, normal nav'ı göster */
  .hamburger-menu {
    display: none;
  }
  
  .header-nav {
    display: flex !important;
  }

  /* Mobil bottom bar gizle - PC'de sağ floating butonlar kullan */
  .floating-button-bar {
    display: none !important;
  }
  
  /* PC'de floating butonları force göster */
  .share-lobby-btn,
  .refresh-btn,
  .chat-toggle-btn,
  .scroll-top-btn {
    display: flex !important;
    position: fixed !important;
  }
}


