/* ===== MOBILE-FIRST RESPONSIVE DESIGN FOR MYSTICMS ===== */

/* Touch-friendly optimizations */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Ensure touch targets are at least 44px */
.btn, .navbar-item, .job-filter-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Enhanced Mobile Navigation */
@media (max-width: 991px) {
  .navbar-toggler {
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
  }
  
  .navbar-collapse {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  
  .navbar-nav {
    gap: 0.5rem;
  }
  
  .navbar-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    width: 100%;
    justify-content: flex-start;
    background: rgba(102, 126, 234, 0.05);
    transition: all 0.3s ease;
  }
  
  .navbar-item:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
  }
  
  .dropdown-menu {
    border: none;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-top: 0.5rem;
  }
  
  .dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-radius: 8px;
    margin: 0.25rem;
  }
}

/* Mobile Styles (up to 768px) */
@media (max-width: 768px) {
  /* Body adjustments */
  body {
    background-attachment: scroll;
    font-size: 14px;
    line-height: 1.6;
  }
  
  /* Container improvements */
  .container, .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Top bar mobile optimization */
  .topbar {
    padding: 0.5rem 0;
  }
  
  .topbar .row {
    align-items: center;
  }
    .hot-weekend-container {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
  }
    .hot-weekend-container .marquee-text {
    font-size: 0.75rem;
    animation-duration: 125s;
  }
  
  .discord-rectangle-parent {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
  }
  
  .discord-rectangle-parent .menu2 a {
    font-size: 0.8rem;
  }
  
  /* Logo section mobile */
  .logo-section {
    padding: 1rem 0;
  }
  
  .hero-logo {
    max-width: 240px;
    height: auto;
  }
  
  /* Hero section mobile optimization */
  .hero-section {
    padding: 2rem 1rem;
    margin: 0.5rem;
    text-align: center;
    min-height: auto;
  }
  
  .hero-section .row {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-section .col-lg-6 {
    width: 100%;
    max-width: none;
  }
  
  .hero-content {
    margin-bottom: 2rem;
  }
  
  .hero-badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
  }
  
  .hero-title {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 1rem;
  }
  
  .hero-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
  }  
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: transparent;
    border-radius: 12px;
    backdrop-filter: blur(5px);
  }
  
  .hero-stats .stat-item {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
  }
  
  .hero-stats .stat-icon {
    margin-right: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .hero-stats .stat-content {
    flex: 1;
  }
  
  .hero-stats .stat-number {
    font-size: 1.25rem;
    font-weight: bold;
    display: block;
  }
  
  .hero-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
  }
  
  .hero-stats .stat-description {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
  }
  
  .hero-stats .stat-label {
    margin-top: 0.25rem;
    display: block;
  }
  
  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
  
  .hero-actions .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  
  /* Server status card mobile */
  .server-status-card {
    margin-top: 0;
    padding: 1.25rem;
    border-radius: 15px;
    width: 100%;
    max-width: 100%;
  }
  
  .status-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .status-indicator {
    width: 10px;
    height: 10px;
  }
  
  .server-info .info-row {
    font-size: 0.9rem;
    padding: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .quick-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
  }
  
  .quick-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem;
  }
  
  /* Stats section mobile */
  .stats-section {
    padding: 2rem 1rem;
  }
  
  .stats-section .row {
    gap: 1rem;
    justify-content: center;
  }
  
  .stat-card {
    padding: 1.5rem 1rem;
    text-align: center;
    border-radius: 12px;
    transition: transform 0.3s ease;
  }
  
  .stat-card:hover {
    transform: translateY(-3px);
  }
  
  .stat-icon {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  .stat-content .stat-number {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-content .stat-label {
    font-size: 0.9rem;
  }
  
  /* Features section mobile */
  .features-section {
    padding: 2rem 1rem;
  }
  
  .section-header {
    margin-bottom: 2rem;
    text-align: center;
  }
  
  .section-badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .section-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
  }
  
  .section-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
  }
  
  .features-grid .row {
    gap: 1rem;
  }
  
  .feature-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: auto;
    border-radius: 15px;
  }
  
  .feature-icon {
    max-width: 60px;
    max-height: 60px;
  }
  
  .feature-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }
  
  .feature-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  /* Rankings section mobile optimization */
  .rankings-section {
    padding: 2rem 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    max-width: 100vw;
  }
  
  .rankings-section .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .rankings-container {
    margin: 0;
    padding: 1rem;
    border-radius: 15px;
    width: 100%;
  }
  
  .rankings-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }
  
  .rankings-header h3 {
    font-size: 1.25rem;
    margin: 0;
  }
  
  .rankings-header .btn {
    align-self: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .table-responsive {
    border-radius: 12px;
    margin: 0;
  }
  
  .rankings-table {
    font-size: 0.9rem;
  }
  
  .rankings-table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
  }
  
  .rankings-table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    vertical-align: middle;
  }
  
  .player-info {
    text-align: left;
  }
  
  .player-name {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.25rem;
  }
  
  .player-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  
  .level-badge {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
  }
    .rank-medal {
    font-size: 2rem !important;
    height: auto !important;
    width: auto !important;
  }
  
  .rank-medal-small {
    font-size: 1.5rem !important;
    height: auto !important;
    width: auto !important;
  }
  
  .job-icon {
    font-size: 1rem !important;
  }
  
  .rank-number-container {
    width: 30px;
    height: 30px;
  }
  
  .rank-number {
    font-size: 0.9rem;
  }
  
  .guild-name {
    font-size: 0.8rem;
  }
  
  /* Ranking page specific styles */
  .ranking-container {
    margin: 1rem 0.5rem;
    border-radius: 15px;
  }
  
  .select-job-image-base {
    margin: 1rem;
    padding: 1.5rem;
    border-radius: 15px;
  }
  
  .ranking-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }
  
  .job-filters {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
    .job-filter-btn {
    padding: 0.5rem 0.75rem;
    min-width: 60px;
    font-size: 0.8rem;
    border-radius: 8px;
    text-align: center;
  }
  
  .job-filter-icon {
    width: 18px;
    height: 18px;
  }
  
  .rank-info {
    padding: 0 1rem 2rem 1rem;
  }
  
  .rank-info .table-responsive {
    border-radius: 12px;
  }
  
  .rank-info .ranking-table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
  .rank-info .ranking-table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
    /* Job icon responsive styles */
  .job-icon-img {
    width: 20px;
    height: 20px;
  }
  
  .job-icon-img-small {
    width: 14px;
    height: 14px;
  }
    /* Guild icon responsive styles */
  .guild-icon {
    width: 14px;
    height: 14px;
  }
  
  /* Discord section mobile */
  .discord-section {
    padding: 2rem 1rem;
  }
  
  .discord-info .row {
    flex-direction: column;
  }
  
  .discord-features .feature-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    flex-direction: column;
    text-align: center;
  }
  
  .discord-features .feature-icon {
    width: 50px;
    height: 50px;
    margin-right: 0;
    margin-bottom: 1rem;
    border-radius: 12px;
  }
  
  .discord-features .feature-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .discord-features .feature-content p {
    font-size: 0.95rem;
    margin: 0;
  }
  
  .discord-actions {
    margin-top: 1.5rem;
    text-align: center;
  }
  
  .discord-actions .btn {
    width: 100%;
    max-width: 280px;
    margin-bottom: 0.75rem;
    display: block;
  }
  
  .discord-widget-container {
    margin-top: 2rem;
    border-radius: 15px;
  }
  
  .discord-iframe {
    height: 350px;
    border-radius: 15px;
  }
  
  /* CTA section mobile */
  .cta-section {
    padding: 2rem 1rem;
  }
  
  .cta-content {
    text-align: center;
  }
  
  .cta-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
  }
  
  .cta-icon i {
    font-size: 2.25rem;
  }
  
  .cta-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
  }
  
  .cta-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 100%;
    line-height: 1.6;
  }
  
  .cta-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }
  
  .cta-actions .btn {
    width: 100%;
    max-width: 280px;
  }
    /* Footer mobile */
  .footer {
    padding: 1rem 0;
  }
  
  .footer .row > div {
    margin-bottom: 0.75rem;
    text-align: center;
  }
  
  .footer .d-flex {
    flex-direction: column;
    align-items: center !important;
    gap: 0.5rem;
  }
  
  .footer .justify-content-md-end {
    justify-content: center !important;
  }
  
  .footer .social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
  }
}

/* Small mobile devices (up to 575px) */
@media (max-width: 575px) {
  .container, .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .hero-section {
    padding: 1.5rem 0.75rem;
    margin: 0.25rem;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
    .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .hero-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
  }
  
  .hero-stats .stat-icon {
    margin-right: 0.75rem;
    margin-bottom: 0;
    order: 1;
  }
  
  .hero-stats .stat-content {
    order: 2;
    text-align: left;
  }
  
  .hero-stats .stat-number {
    font-size: 1.1rem;
  }
  
  .hero-stats .stat-label {
    font-size: 0.8rem;
  }
  
  .server-status-card {
    padding: 1rem;
  }
  
  .info-row {
    font-size: 0.85rem;
    padding: 0.375rem 0;
  }
  
  .stats-section {
    padding: 1.5rem 0.75rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .section-description {
    font-size: 0.9rem;
  }
  
  .rankings-section .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .rankings-container {
    padding: 0.75rem;
  }
  
  .rankings-table thead th {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .rankings-table tbody td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .player-name {
    font-size: 0.85rem;
  }
  
  .level-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
  }
  
  .ranking-container {
    margin: 0.5rem 0.25rem;
  }
  
  .select-job-image-base {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .ranking-title {
    font-size: 1.1rem;
  }    .job-filter-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-width: 50px;
  }
  
  .job-filter-icon {
    width: 16px;
    height: 16px;
  }
    /* Avatar column for small screens */
  .rank-info {
    padding: 0 0.5rem 1rem 0.5rem;
  }
  
  .discord-features .feature-item {
    padding: 0.75rem;
  }
  
  .cta-title {
    font-size: 1.6rem;
  }
  
  .cta-description {
    font-size: 0.95rem;
  }
  
  .cta-actions .btn {
    max-width: 260px;
  }
}

/* Extra small devices (up to 400px) */
@media (max-width: 400px) {
  .hero-section {
    padding: 1rem 0.5rem;
  }
  
  .hero-title {
    font-size: 1.6rem;
  }
  
  .hero-actions .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .server-status-card {
    padding: 0.75rem;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
  
  .feature-card {
    padding: 1rem;
  }
  
  .rankings-container {
    padding: 0.5rem;
  }
  
  .select-job-image-base {
    padding: 0.75rem;
  }
  
  .ranking-title {
    font-size: 1rem;
  }
    .job-filter-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    min-width: 45px;
  }
  
  .job-filter-icon {
    width: 14px;
    height: 14px;
  }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: 1rem;
    min-height: auto;
  }
  
  .hero-section .row {
    align-items: flex-start;
  }
  
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .server-status-card {
    padding: 1rem;
  }
  
  .stats-section {
    padding: 1.5rem 1rem;
  }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
  /* Reduce animations on mobile for better performance */
  /* Exclude marquee and floating animations from the speed reduction */
  *:not(.marquee-text):not(.cta-boat-wrapper):not(.boat__spinner):not(.boat__anim1):not(.boat__anim2):not(.floating-cloud):not(.floating-creature), 
  *::before, 
  *::after {
    animation-duration: 0.5s !important;
    animation-delay: 0s !important;
  }
  
  /* Keep marquee readable on mobile */
  .marquee-text {
    animation-duration: 25s !important;
  }
  
  /* Keep floating animations smooth on mobile */
  .cta-boat-wrapper {
    animation-duration: 6s !important;
  }
  
  .boat__spinner {
    animation-duration: 3s !important;
  }
  
  .boat__anim1, .boat__anim2 {
    animation-duration: 1s !important;
  }
  
  .floating-cloud {
    animation-duration: 90s !important;
  }
  
  /* Optimize transforms for mobile */
  .feature-card-info:hover {
    transform: translateY(-3px) scale(1.01);
  }
  
  .stat-card:hover {
    transform: translateY(-2px);
  }
  
  .ranking-row:hover {
    transform: none;
  }
}

/* ===== FONT AWESOME ICON MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Rank icons mobile sizing */
  .rank-icon {
    font-size: 1rem !important;
    margin-right: 0.375rem;
    margin-left: 0.25rem;
  }
  
  /* Job icons mobile sizing */
  .job-icon {
    font-size: 0.9rem !important;
    margin-right: 0.25rem;
    margin-left: 0.125rem;
  }
  
  /* Ranking table mobile adjustments */
  .ranking-table .rank-icon {
    font-size: 0.9rem !important;
    margin-right: 0.25rem;
  }
  
  .ranking-table .job-icon {
    font-size: 0.8rem !important;
    margin-right: 0.2rem;
  }
  
  /* Mobile rank display optimization */
  .rank-position {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  
  /* Ensure icons don't break layout on very small screens */
  @media (max-width: 480px) {
    .rank-icon {
      font-size: 0.85rem !important;
      margin-right: 0.25rem;
    }
    
    .job-icon {
      font-size: 0.75rem !important;
      margin-right: 0.2rem;
    }
    
    /* Stack icons vertically if needed on very small screens */
    .ranking-table td {
      padding: 0.5rem 0.25rem;
    }
  }
  
  /* Touch interaction improvements for icons */
  .rank-icon, .job-icon {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }
}
