/* =========================================================
 * OAE Leaderboard Pro - Mobile Design
 * Dediziertes Mobile-Design für Smartphones/Tablets
 * Wird nur auf mobilen Geräten geladen
 * ========================================================= */

/* Mobile-First Approach - Basis Styles für mobile Geräte */
@media only screen and (max-width: 768px) {
  
  /* Container und Layout */
  .oae-lb2-wrap {
    padding: 12px 8px;
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, #0B1426 0%, #0F172A 100%);
    font-size: 14px;
  }

  /* Header für Mobile optimiert */
  .oae-lb2-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px 12px;
    background: rgba(15,23,42,0.8);
    border-radius: 12px;
    border: 1px solid rgba(59,130,246,0.2);
  }
  
  .oae-lb2-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.2;
  }
  
  .oae-lb2-title:before {
    font-size: 24px;
    margin-right: 8px;
  }
  
  .oae-lb2-subtitle {
    font-size: 13px;
    line-height: 1.3;
  }

  /* Mobile Navigation - Stack Layout */
  .oae-lb2-tabs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    padding: 0 4px;
  }
  
  .oae-lb2-tabgroup {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
  }
  
  .oae-lb2-tab {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    min-height: 44px; /* iOS Touch Target */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
  }
  
  .oae-lb2-tab:not(.oae-lb2-nav-btn) {
    flex: 1;
  }
  
  .oae-lb2-nav-btn {
    min-width: 44px;
    padding: 12px;
  }
  
  .oae-lb2-tab:active {
    transform: scale(0.95);
  }

  /* Mobile Search - Optimiert für Touch */
  .oae-lb2-search {
    margin: 16px 0;
    padding: 0 4px;
  }
  
  .oae-lb2-search-wrapper {
    max-width: 100%;
    margin: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-radius: 12px;
    overflow: hidden;
  }
  
  .oae-lb2-search-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 14px 16px;
    min-height: 44px;
    border-radius: 12px 0 0 12px;
    background: rgba(30,41,59,0.9);
    border: 2px solid rgba(59,130,246,0.3);
  }
  
  .oae-lb2-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
  }
  
  .oae-lb2-search-btn {
    min-width: 50px;
    padding: 14px;
    min-height: 44px;
    border-radius: 0 12px 12px 0;
    font-size: 16px;
  }
  
  .oae-lb2-search-clear {
    right: 56px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Card Design für Mobile - verstecke Tabelle */
  .oae-lb2-table {
    display: none !important;
  }
  
  /* Mobile Card Layout */
  .oae-lb2-mobile-cards {
    display: block !important;
    gap: 12px;
  }
  
  .oae-lb2-mobile-card {
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
  }
  
  .oae-lb2-mobile-card:hover,
  .oae-lb2-mobile-card:active {
    background: rgba(30,41,59,0.9);
    border-color: rgba(59,130,246,0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  }
  
  .oae-lb2-mobile-card.top3 {
    background: rgba(59,130,246,0.15);
    border-color: rgba(251,191,36,0.4);
    position: relative;
  }
  
  .oae-lb2-mobile-card.top3:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 12px 12px 0 0;
  }
  
  /* Mobile Card Header */
  .oae-lb2-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  
  .oae-lb2-mobile-rank {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    min-width: 40px;
  }
  
  .oae-lb2-mobile-points {
    font-size: 18px;
    font-weight: bold;
    color: #60a5fa;
    font-variant-numeric: tabular-nums;
  }
  
  /* Mobile User Section */
  .oae-lb2-mobile-user {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .oae-lb2-mobile-user .oae-lb2-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  
  .oae-lb2-mobile-user .oae-lb2-name {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
  }
  
  /* Mobile Rank Badge */
  .oae-lb2-mobile-rank-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(30,64,175,0.3);
    border: 1px solid rgba(59,130,246,0.4);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin-top: 8px;
  }

  /* Mobile Pagination */
  .oae-lb2-pager {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 0 4px;
  }
  
  .oae-lb2-pager > span {
    display: flex;
    justify-content: center;
  }
  
  .oae-lb2-btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
  }
  
  .oae-lb2-page {
    padding: 8px 16px;
    font-size: 14px;
    text-align: center;
  }

  /* Empty State für Mobile */
  .oae-lb2-mobile-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9fb1c5;
    font-size: 16px;
  }
  
  .oae-lb2-mobile-empty:before {
    content: '🔍';
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
  }

  /* Search Info für Mobile */
  .oae-lb2-search-info {
    font-size: 13px;
    padding: 8px 12px;
    margin: 8px 4px;
    text-align: center;
    border-radius: 8px;
  }
}

/* Tablet Landscape Anpassungen */
@media only screen and (min-width: 481px) and (max-width: 768px) {
  .oae-lb2-wrap {
    padding: 16px 12px;
  }
  
  .oae-lb2-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .oae-lb2-mobile-cards {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .oae-lb2-pager {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .oae-lb2-pager > span:nth-child(2) {
    order: 3;
  }
}

/* Sehr kleine Smartphones */
@media only screen and (max-width: 360px) {
  .oae-lb2-wrap {
    padding: 8px 4px;
  }
  
  .oae-lb2-header {
    padding: 12px 8px;
  }
  
  .oae-lb2-title {
    font-size: 18px;
  }
  
  .oae-lb2-mobile-card {
    padding: 12px;
  }
  
  .oae-lb2-mobile-user .oae-lb2-avatar {
    width: 36px;
    height: 36px;
  }
  
  .oae-lb2-mobile-user .oae-lb2-name {
    font-size: 14px;
  }
  
  .oae-lb2-mobile-points {
    font-size: 16px;
  }
}

/* Dark Mode Improvements für Mobile */
@media (prefers-color-scheme: dark) {
  .oae-lb2-mobile-card {
    background: rgba(0,0,0,0.6);
    border-color: rgba(59,130,246,0.3);
  }
  
  .oae-lb2-search-input {
    background: rgba(0,0,0,0.7);
  }
}

/* High DPI / Retina Display Optimierungen */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
       only screen and (min-resolution: 192dpi) {
  .oae-lb2-mobile-card {
    border-width: 0.5px;
  }
}

/* Landscape Orientation für Smartphones */
@media only screen and (max-height: 500px) and (orientation: landscape) {
  .oae-lb2-header {
    margin-bottom: 12px;
    padding: 12px;
  }
  
  .oae-lb2-title {
    font-size: 20px;
  }
  
  .oae-lb2-mobile-card {
    padding: 12px;
  }
}