/* =============================================
   WYD_X - MOBILE RESPONSIVE OPTIMIZATION
   Otimização completa para dispositivos móveis
   Mantém desktop intacto
   ============================================= */

/* =============================================
   MOBILE NAVIGATION FIXES
   ============================================= */
@media (max-width: 768px) {
  /* Fix menu overlapping content */
  body {
    padding-top: 80px !important;
  }
  
  /* Ensure mobile menu is properly positioned */
  .mobile-menu {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Make mobile menu more touch-friendly */
  .mobile-nav-link,
  .mobile-auth-btn {
    min-height: 48px;
    touch-action: manipulation;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 75px !important;
  }
  
  .mobile-menu {
    max-height: calc(100vh - 75px);
  }
}

/* =============================================
   HERO SECTION - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .hero-section {
    min-height: 0vh;
    height: auto;
    padding: 60px 0 40px 0;
  }
  
  .hero-background {
    background-attachment: scroll;
    background-size: cover;
    background-position: center center;
  }
  
  .hero-content {
    padding: 20px 15px;
  }
  
  .hero-logo {
    margin-bottom: 20px;
  }
  
  .logo-image {
    height: 70px !important;
  }
  
  .logo-glow {
    width: 130px !important;
    height: 130px !important;
  }
  
  .hero-title {
    font-size: 42px !important;
    letter-spacing: 1px !important;
    margin-bottom: 15px;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 16px !important;
    margin-bottom: 30px;
    padding: 0 10px;
    line-height: 1.5;
  }
  
  .hero-stats {
    gap: 15px !important;
    margin: 25px 0 !important;
    padding: 0 10px;
  }
  
  .stat-item {
    min-width: 90px !important;
    padding: 12px !important;
    flex: 1;
    max-width: 120px;
  }
  
  .stat-number {
    font-size: 20px !important;
  }
  
  .stat-label {
    font-size: 10px !important;
  }
  
  .hero-actions {
    gap: 12px !important;
    margin-bottom: 40px;
    padding: 0 15px;
  }
  
  .hero-btn {
    width: 100% !important;
    max-width: 280px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    min-height: 52px;
  }
  
  .btn-icon {
    font-size: 18px !important;
  }
  
  .scroll-indicator {
    bottom: 20px;
  }
  
  .scroll-arrow {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .hero-section {
    min-height: 80vh;
  }
  
  .logo-image {
    height: 55px !important;
  }
  
  .logo-glow {
    width: 110px !important;
    height: 110px !important;
  }
  
  .hero-title {
    font-size: 32px !important;
    letter-spacing: 0.5px !important;
  }
  
  .hero-subtitle {
    font-size: 14px !important;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 10px !important;
  }
  
  .stat-item {
    width: 100%;
    max-width: 200px;
  }
  
  .hero-btn {
    max-width: 100% !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 360px) {
  .hero-title {
    font-size: 28px !important;
  }
  
  .hero-subtitle {
    font-size: 13px !important;
  }
  
  .stat-number {
    font-size: 18px !important;
  }
}

/* =============================================
   SECTIONS - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .news-section,
  .ranking-section,
  .social-section {
    padding: 50px 0 !important;
  }
  
  .section-header {
    margin-bottom: 35px;
    padding: 0 15px;
  }
  
  .section-title {
    font-size: 32px !important;
    letter-spacing: 1px;
    margin-bottom: 15px;
  }
  
  .section-subtitle {
    font-size: 15px !important;
    padding: 0 10px;
  }
  
  .news-container,
  .ranking-container,
  .social-container {
    padding: 0 15px !important;
  }
}

@media (max-width: 480px) {
  .news-section,
  .ranking-section,
  .social-section {
    padding: 40px 0 !important;
  }
  
  .section-title {
    font-size: 28px !important;
  }
  
  .section-subtitle {
    font-size: 14px !important;
  }
}

/* =============================================
   DASHBOARD - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .dashboard-container {
    display: flex;
    flex-direction: column;
  }
  
  .dashboard-sidebar {
    position: fixed;
    top: 80px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 80px);
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(26, 26, 26, 0.98) 100%);
    border-right: 2px solid rgba(249, 115, 22, 0.3);
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .dashboard-sidebar.mobile-open {
    left: 0;
  }
  
  .dashboard-main {
    width: 100%;
    padding: 20px 15px;
    min-height: calc(100vh - 80px);
  }
  
  .sidebar-toggle-mobile {
    display: flex !important;
    position: fixed;
    top: 90px;
    left: 15px;
    z-index: 998;
    background: linear-gradient(135deg, #f97316, #ff8c00);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .sidebar-toggle-mobile:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
  }
  
  .sidebar-toggle-mobile span {
    width: 22px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    backdrop-filter: blur(4px);
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  /* Dashboard cards */
  .dashboard-card,
  .card {
    margin: 10px 0 !important;
    padding: 20px 15px !important;
  }
  
  /* Dashboard forms */
  .form-group,
  .formGroup {
    margin: 15px 0 !important;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .dashboard-sidebar {
    top: 75px;
    height: calc(100vh - 75px);
    width: 100%;
    left: -100%;
  }
  
  .sidebar-toggle-mobile {
    top: 85px;
    left: 10px;
    width: 40px;
    height: 40px;
  }
  
  .sidebar-overlay {
    top: 75px;
  }
  
  .dashboard-main {
    padding: 15px 10px;
  }
}

/* =============================================
   SIDEBAR - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .sidebar-content {
    padding: 20px;
  }
  
  .sidebar-logo {
    padding: 20px 0;
    border-bottom: 2px solid rgba(249, 115, 22, 0.2);
    margin-bottom: 20px;
  }
  
  .logo-wrapper {
    justify-content: center;
  }
  
  .user-section {
    padding: 15px;
    margin-bottom: 20px;
    background: rgba(249, 115, 22, 0.05);
    border-radius: 12px;
  }
  
  .nav-group {
    margin-bottom: 20px;
  }
  
  .nav-group-title {
    font-size: 12px;
    padding: 10px 15px;
    margin-bottom: 8px;
  }
  
  .nav-item {
    padding: 14px 15px !important;
    margin-bottom: 6px;
    font-size: 15px;
    border-radius: 10px;
    min-height: 48px;
  }
  
  .nav-icon {
    font-size: 20px;
    width: 30px;
  }
  
  .nav-label {
    font-size: 14px;
  }
}

/* =============================================
   MODALS - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .modal_div,
  .download-modal-content {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin: 10px !important;
    padding: 25px 20px !important;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .download-modal-header {
    padding: 20px 15px !important;
  }
  
  .download-modal-icon {
    margin-bottom: 15px;
  }
  
  .download-icon {
    font-size: 36px !important;
  }
  
  .download-modal-title {
    font-size: 22px !important;
    letter-spacing: 0.5px;
  }
  
  .download-modal-subtitle {
    font-size: 14px !important;
  }
  
  .download-modal-close {
    width: 35px;
    height: 35px;
    top: 15px;
    right: 15px;
    font-size: 20px;
  }
  
  .download-modal-body {
    padding: 20px 15px !important;
  }
  
  .download-option {
    flex-direction: column !important;
    text-align: center;
    gap: 15px !important;
    padding: 20px !important;
  }
  
  .download-option-icon {
    width: 50px;
    height: 50px;
    font-size: 28px !important;
  }
  
  .download-option-content {
    width: 100%;
  }
  
  .download-option-title {
    font-size: 18px !important;
  }
  
  .download-option-desc {
    font-size: 13px !important;
  }
  
  .download-option-meta {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px !important;
    font-size: 11px !important;
  }
  
  .download-option-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .download-option-btn {
    width: 100% !important;
    justify-content: center;
    padding: 14px 20px !important;
    font-size: 13px !important;
  }
  
  .download-requirements {
    padding: 20px 15px !important;
  }
  
  .requirements-title {
    font-size: 16px !important;
    margin-bottom: 15px !important;
  }
  
  .requirements-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  .requirement-item {
    flex-direction: column !important;
    text-align: center;
    gap: 8px !important;
    padding: 12px !important;
  }
  
  .requirement-icon {
    font-size: 20px !important;
    width: 35px;
    height: 35px;
  }
  
  .requirement-content h5 {
    font-size: 13px !important;
  }
  
  .requirement-content p {
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .modal_div,
  .download-modal-content {
    width: calc(100% - 10px) !important;
    margin: 5px !important;
    padding: 20px 15px !important;
  }
  
  .download-modal-title {
    font-size: 20px !important;
  }
  
  .download-option {
    padding: 15px !important;
  }
  
  .requirements-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================
   TABLES - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .scroll-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -15px;
    padding: 0 15px;
  }
  
  table {
    min-width: 600px;
    font-size: 13px;
  }
  
  table th,
  table td {
    padding: 10px 8px !important;
    white-space: nowrap;
  }
  
  table th {
    font-size: 12px;
  }
  
  /* Responsive table alternative */
  .mobile-card-table {
    display: none;
  }
  
  @supports (display: grid) {
    .table-responsive-mobile table {
      display: none;
    }
    
    .mobile-card-table {
      display: block;
    }
    
    .mobile-table-card {
      background: rgba(249, 115, 22, 0.05);
      border: 1px solid rgba(249, 115, 22, 0.2);
      border-radius: 12px;
      padding: 15px;
      margin-bottom: 15px;
    }
    
    .mobile-table-card-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid rgba(249, 115, 22, 0.1);
    }
    
    .mobile-table-card-row:last-child {
      border-bottom: none;
    }
    
    .mobile-table-label {
      font-weight: 600;
      color: #f97316;
      font-size: 12px;
    }
    
    .mobile-table-value {
      color: #fff;
      font-size: 13px;
      text-align: right;
    }
  }
}

@media (max-width: 480px) {
  table {
    min-width: 500px;
    font-size: 12px;
  }
  
  table th,
  table td {
    padding: 8px 6px !important;
  }
}

/* =============================================
   CARDS & ITEMS - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  /* Case cards */
  .case-card,
  .item-card,
  .reward-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 !important;
  }
  
  /* Grid layouts */
  .cases-grid,
  .items-grid,
  .rewards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 12px !important;
    padding: 0 15px;
  }
  
  /* News cards */
  .news-card {
    flex-direction: column;
    margin-bottom: 20px;
  }
  
  .news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
  }
  
  /* Ranking cards */
  .rank-card,
  .rank {
    padding: 12px !important;
    margin: 8px 0 !important;
  }
  
  .rank-info {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .rank-info_ava {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .cases-grid,
  .items-grid,
  .rewards-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 10px !important;
  }
  
  .news-card img {
    height: 180px;
  }
}

/* =============================================
   FORMS - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .form-container {
    padding: 20px 15px !important;
  }
  
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .form-col {
    width: 100% !important;
    flex: 1;
  }
  
  label {
    font-size: 14px;
    margin-bottom: 6px;
  }
  
  input,
  select,
  textarea,
  button {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px 15px !important;
    border-radius: 8px;
  }
  
  textarea {
    min-height: 120px;
  }
  
  button[type="submit"],
  .btn,
  .button {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 15px !important;
    min-height: 48px;
    touch-action: manipulation;
  }
  
  .btn-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn-group button,
  .btn-group .btn {
    width: 100%;
  }
}

/* =============================================
   FOOTER - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  footer {
    padding: 40px 20px 30px 20px !important;
  }
  
  .footerInfoBlock {
    flex-direction: column;
    gap: 30px;
  }
  
  .footerMenuBlock {
    flex-direction: column;
    gap: 20px;
  }
  
  .footerMenu {
    width: 100% !important;
    text-align: center;
  }
  
  .copyBlock,
  .dkLogo {
    width: 100% !important;
    text-align: center;
    margin-bottom: 20px;
  }
  
  .socBlock {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .logosBlock {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
}

/* =============================================
   UTILITY CLASSES - MOBILE
   ============================================= */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
  
  .show-mobile {
    display: block !important;
  }
  
  .text-center-mobile {
    text-align: center !important;
  }
  
  .full-width-mobile {
    width: 100% !important;
  }
  
  .no-padding-mobile {
    padding: 0 !important;
  }
  
  .no-margin-mobile {
    margin: 0 !important;
  }
}

/* =============================================
   CASES/ROULETTE - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  /* Case opening container */
  .case-opening-container {
    padding: 15px !important;
    margin: 15px 0 !important;
  }
  
  /* 3D Canvas */
  .case-canvas,
  #caseCanvas {
    max-width: 100% !important;
    height: 250px !important;
    touch-action: none;
  }
  
  /* Roulette container */
  .roulette-container {
    padding: 15px !important;
    overflow-x: hidden;
  }
  
  .roulette-items {
    gap: 10px !important;
  }
  
  .roulette-item {
    min-width: 100px !important;
    height: 100px !important;
  }
  
  /* Case items display */
  .case-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 10px !important;
  }
  
  .case-item {
    padding: 10px !important;
  }
  
  .case-item-image {
    width: 60px !important;
    height: 60px !important;
  }
  
  .case-item-name {
    font-size: 11px !important;
  }
  
  .case-item-chance {
    font-size: 10px !important;
  }
  
  /* Open case button */
  .open-case-btn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  .case-canvas,
  #caseCanvas {
    height: 200px !important;
  }
  
  .roulette-item {
    min-width: 80px !important;
    height: 80px !important;
  }
  
  .case-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  }
}

/* =============================================
   PAGINATION - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 20px 10px;
  }
  
  .pagination a,
  .pagination span {
    min-width: 40px;
    height: 40px;
    padding: 10px;
    font-size: 13px;
  }
  
  .pagination .pagination-info {
    width: 100%;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
  }
}

/* =============================================
   TEXT & TYPOGRAPHY - MOBILE
   ============================================= */
@media (max-width: 768px) {
  h1 {
    font-size: 28px !important;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 24px !important;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 20px !important;
    line-height: 1.3;
  }
  
  h4 {
    font-size: 18px !important;
    line-height: 1.4;
  }
  
  h5 {
    font-size: 16px !important;
  }
  
  h6 {
    font-size: 14px !important;
  }
  
  p {
    font-size: 14px !important;
    line-height: 1.6;
  }
  
  .page-title h1 {
    font-size: 24px !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 24px !important;
  }
  
  h2 {
    font-size: 20px !important;
  }
  
  h3 {
    font-size: 18px !important;
  }
  
  p {
    font-size: 13px !important;
  }
}

/* =============================================
   CONTAINERS & SPACING - MOBILE
   ============================================= */
@media (max-width: 768px) {
  .container {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  
  .row {
    margin-left: -10px !important;
    margin-right: -10px !important;
  }
  
  .col,
  [class*="col-"] {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* =============================================
   IMAGES & MEDIA - MOBILE
   ============================================= */
@media (max-width: 768px) {
  img {
    max-width: 100%;
    height: auto;
  }
  
  video {
    max-width: 100%;
    height: auto;
  }
  
  iframe {
    max-width: 100%;
  }
  
  .video-background {
    display: none !important;
  }
  
  /* Replace video backgrounds with static images on mobile */
  .hero-background.has-video {
    background-image: url('/images/back.png') !important;
    background-size: cover !important;
    background-position: center !important;
  }
}

/* =============================================
   BUTTONS - MOBILE ENHANCEMENT
   ============================================= */
@media (max-width: 768px) {
  button,
  .btn,
  .button,
  a.button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* iOS recommended touch target */
  }
  
  button:active,
  .btn:active,
  .button:active {
    transform: scale(0.98);
  }
}

/* =============================================
   ALERTS & NOTIFICATIONS - MOBILE
   ============================================= */
@media (max-width: 768px) {
  .alert,
  .notification,
  .message {
    margin: 10px !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    border-radius: 8px;
  }
  
  .alert-icon {
    font-size: 20px;
  }
}

/* =============================================
   LOADING & SPINNERS - MOBILE
   ============================================= */
@media (max-width: 768px) {
  .loading-overlay {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
  }
}

/* =============================================
   TOOLTIPS - MOBILE (Disable hover tooltips)
   ============================================= */
@media (max-width: 768px) {
  .tooltip {
    display: none !important;
  }
  
  /* Convert to touch tooltips */
  .tooltip-mobile {
    position: relative;
  }
  
  .tooltip-mobile[data-tooltip]:active::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
  }
}

/* =============================================
   ACCESSIBILITY - MOBILE
   ============================================= */
@media (max-width: 768px) {
  /* Larger tap targets */
  a,
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }
  
  /* Better focus states for keyboard navigation */
  a:focus,
  button:focus,
  input:focus,
  select:focus,
  textarea:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
  }
  
  /* Prevent text size adjustment on orientation change */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

/* =============================================
   PERFORMANCE OPTIMIZATIONS - MOBILE
   ============================================= */
@media (max-width: 768px) {
  /* Reduce animations on mobile for performance */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* Hardware acceleration for smooth scrolling */
  .hero-section,
  .mobile-menu,
  .dashboard-sidebar,
  .modal_div {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Optimize scroll performance */
  .scroll-container {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
  }
}

/* =============================================
   LANDSCAPE MODE - MOBILE
   ============================================= */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh;
  }
  
  .hero-title {
    font-size: 36px !important;
  }
  
  .hero-subtitle {
    font-size: 14px !important;
  }
  
  .hero-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .stat-item {
    flex: 0 0 calc(33.333% - 15px);
  }
}

/* =============================================
   PRINT STYLES - MOBILE
   ============================================= */
@media print {
  .mobile-menu-toggle,
  .mobile-menu,
  .sidebar-toggle-mobile,
  .hero-actions,
  nav,
  footer {
    display: none !important;
  }
  
  body {
    padding-top: 0 !important;
  }
}

/* =============================================
   SPECIFIC PAGE FIXES - MOBILE
   ============================================= */

/* Download Page */
@media (max-width: 768px) {
  .downloadBlock,
  .updateBlock {
    width: 100% !important;
    padding: 20px 15px !important;
    margin: 10px 0 !important;
  }
  
  .downloadBlock-flex {
    flex-direction: column;
    gap: 15px;
  }
}

/* Ranking Page */
@media (max-width: 768px) {
  .rankBlock-block {
    flex-direction: column;
  }
  
  .rank {
    width: 100% !important;
    margin: 10px 0 !important;
  }
}

/* News Page */
@media (max-width: 768px) {
  .news-block {
    padding: 20px 15px !important;
  }
  
  .news-item {
    margin: 15px 0 !important;
  }
  
  .news-image {
    width: 100% !important;
    height: auto !important;
  }
}

/* Store Page */
@media (max-width: 768px) {
  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 12px !important;
  }
  
  .store-item {
    padding: 12px !important;
  }
  
  .store-item-image {
    width: 80px !important;
    height: 80px !important;
  }
}

/* Support Page */
@media (max-width: 768px) {
  .ticket-list {
    padding: 15px !important;
  }
  
  .ticket-item {
    flex-direction: column;
    gap: 10px;
    padding: 15px !important;
  }
  
  .ticket-status {
    width: 100%;
    text-align: center;
  }
}

/* =============================================
   CUSTOM SCROLLBAR - MOBILE
   ============================================= */
@media (max-width: 768px) {
  /* Webkit browsers */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.5);
    border-radius: 3px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.7);
  }
}

/* =============================================
   SAFE AREA - iOS DEVICES
   ============================================= */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    body {
      padding-top: calc(0px + env(safe-area-inset-top)) !important;
    }
    
    .modern-nav {
      padding-top: env(safe-area-inset-top);
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
    
    .mobile-menu {
      padding-bottom: env(safe-area-inset-bottom);
    }
    
    .dashboard-sidebar {
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

/* =============================================
   FIXES FOR OLDER MOBILE BROWSERS
   ============================================= */
@media (max-width: 768px) {
  /* Flexbox fallbacks */
  .flex-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
  }
  
  /* Grid fallbacks */
  @supports not (display: grid) {
    .cases-grid,
    .items-grid,
    .rewards-grid,
    .store-grid {
      display: flex;
      flex-wrap: wrap;
      margin: -5px;
    }
    
    .cases-grid > *,
    .items-grid > *,
    .rewards-grid > *,
    .store-grid > * {
      flex: 0 0 calc(50% - 10px);
      margin: 5px;
    }
  }
}

/* =============================================
   END OF MOBILE RESPONSIVE OPTIMIZATION
   ============================================= */

