/* =============================================
   WYD_X - MOBILE COMPONENTS OPTIMIZATION
   Estilos específicos para componentes
   ============================================= */

/* =============================================
   NEWS COMPONENT - MOBILE
   ============================================= */
@media (max-width: 768px) {
  /* News container */
  #tab-buttons {
    padding: 0 10px !important;
    gap: 8px !important;
  }
  
  .tab-button {
    padding: 10px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }
  
  /* News content cards */
  .tab-content > div[style*="display: flex"] {
    flex-direction: column !important;
  }
  
  .tab-content img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    height: 200px !important;
    object-fit: cover !important;
  }
  
  .tab-content > div > div[style*="padding"] {
    padding: 15px !important;
  }
  
  .tab-content h2 {
    font-size: 20px !important;
    margin-bottom: 10px !important;
  }
  
  .tab-content p {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  
  .tab-content a[style*="Carregar mais"] {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto !important;
    padding: 12px 20px !important;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .tab-button {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
  
  .tab-content img {
    height: 180px !important;
  }
  
  .tab-content h2 {
    font-size: 18px !important;
  }
  
  .tab-content p {
    font-size: 13px !important;
  }
}

/* =============================================
   RANKING COMPONENT - MOBILE
   ============================================= */
@media (max-width: 768px) {
  /* Ranking table wrapper */
  .rankBlock {
    padding: 15px !important;
  }
  
  .tableRank {
    min-width: 100% !important;
    font-size: 13px !important;
  }
  
  .tableRank thead h1 {
    font-size: 22px !important;
    margin: 15px 0 !important;
  }
  
  .tableRank td {
    padding: 10px 6px !important;
    font-size: 12px !important;
  }
  
  .tableRank img {
    max-width: 30px !important;
    height: auto !important;
  }
  
  .tableRank .w-50 {
    max-width: 25px !important;
  }
  
  /* Cities images - make them smaller on mobile */
  .tableRank tbody img[src*="img_guilds"] {
    max-width: 40px !important;
    height: auto !important;
  }
  
  /* Hide less important columns on very small screens */
  .tableRank td:nth-child(3),
  .tableRank th:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .tableRank {
    font-size: 11px !important;
  }
  
  .tableRank thead h1 {
    font-size: 18px !important;
  }
  
  .tableRank td {
    padding: 8px 4px !important;
    font-size: 11px !important;
  }
  
  .tableRank img {
    max-width: 25px !important;
  }
  
  /* Hide evolution column on very small screens */
  .tableRank td:nth-child(6),
  .tableRank th:nth-child(6) {
    display: none;
  }
}

/* Mobile card view for ranking */
@media (max-width: 768px) {
  .ranking-mobile-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .ranking-mobile-card-rank {
    font-size: 24px;
    font-weight: 800;
    color: #f97316;
    min-width: 40px;
    text-align: center;
  }
  
  .ranking-mobile-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
  }
  
  .ranking-mobile-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .ranking-mobile-card-info {
    flex: 1;
  }
  
  .ranking-mobile-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
  }
  
  .ranking-mobile-card-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #bbb;
  }
  
  .ranking-mobile-card-level {
    color: #f97316;
    font-weight: 600;
  }
}

/* =============================================
   DISCORD WIDGET - MOBILE
   ============================================= */
@media (max-width: 768px) {
  iframe[src*="discord.com/widget"] {
    width: 100% !important;
    max-width: 350px !important;
    height: 450px !important;
  }
}

@media (max-width: 480px) {
  iframe[src*="discord.com/widget"] {
    width: 100% !important;
    max-width: 100% !important;
    height: 400px !important;
  }
}

/* =============================================
   CASES SYSTEM - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  /* Case list */
  .cases-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 15px;
  }
  
  .case-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
    border: 2px solid rgba(249, 115, 22, 0.3);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
  }
  
  .case-card:active {
    transform: scale(0.95);
  }
  
  .case-card-image {
    width: 100%;
    max-width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 12px auto;
  }
  
  .case-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
  }
  
  .case-card-price {
    font-size: 16px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 12px;
  }
  
  .case-card-button {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f97316, #ff8c00);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .case-card-button:active {
    transform: scale(0.95);
  }
  
  /* Case opening view */
  .case-opening-header {
    padding: 15px;
    text-align: center;
  }
  
  .case-opening-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
  }
  
  .case-opening-balance {
    font-size: 16px;
    color: #f97316;
    font-weight: 600;
  }
  
  /* 3D Canvas container */
  .case-3d-container {
    width: 100%;
    height: 250px;
    margin: 20px 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 100%);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
  }
  
  .case-3d-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
  }
  
  /* Case items list */
  .case-items-header {
    padding: 20px 15px 10px 15px;
    text-align: center;
  }
  
  .case-items-title {
    font-size: 18px;
    font-weight: 700;
    color: #f97316;
    margin-bottom: 15px;
  }
  
  .case-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    padding: 0 15px 20px 15px;
  }
  
  .case-item {
    background: rgba(249, 115, 22, 0.05);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
  }
  
  .case-item-img {
    width: 100%;
    max-width: 70px;
    height: 70px;
    object-fit: contain;
    margin: 0 auto 8px auto;
  }
  
  .case-item-name {
    font-size: 11px;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .case-item-chance {
    font-size: 10px;
    color: #f97316;
    font-weight: 600;
  }
  
  /* Open button */
  .case-open-button {
    position: fixed;
    bottom: 20px;
    left: 15px;
    right: 15px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f97316, #ff8c00);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
  }
  
  .case-open-button:active {
    transform: scale(0.95);
  }
  
  .case-open-button:disabled {
    background: linear-gradient(135deg, #666, #444);
    box-shadow: none;
    cursor: not-allowed;
  }
}

@media (max-width: 480px) {
  .cases-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .case-card-image {
    max-width: 100px;
    height: 100px;
  }
  
  .case-3d-container {
    height: 200px;
  }
  
  .case-items-list {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
  }
  
  .case-item-img {
    max-width: 60px;
    height: 60px;
  }
}

/* =============================================
   MY ITEMS - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .my-items-container {
    padding: 15px;
  }
  
  .my-items-header {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .my-items-title {
    font-size: 24px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 8px;
  }
  
  .my-items-subtitle {
    font-size: 14px;
    color: #bbb;
  }
  
  .my-items-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }
  
  .my-items-filter-btn {
    padding: 10px 16px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .my-items-filter-btn.active {
    background: linear-gradient(135deg, #f97316, #ff8c00);
    border-color: #f97316;
  }
  
  .my-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }
  
  .my-item-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
  }
  
  .my-item-card:active {
    transform: scale(0.95);
  }
  
  .my-item-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #fff;
  }
  
  .my-item-status.used {
    background: #ef4444;
  }
  
  .my-item-image {
    width: 100%;
    max-width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 10px auto;
  }
  
  .my-item-name {
    font-size: 12px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .my-item-date {
    font-size: 10px;
    color: #888;
    margin-bottom: 10px;
  }
  
  .my-item-actions {
    display: flex;
    gap: 6px;
  }
  
  .my-item-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .my-item-btn-use {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
  }
  
  .my-item-btn-use:active {
    transform: scale(0.95);
  }
  
  .my-item-btn-use:disabled {
    background: linear-gradient(135deg, #666, #444);
    cursor: not-allowed;
  }
  
  .my-item-btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
  }
  
  .my-item-btn-delete:active {
    transform: scale(0.95);
  }
}

@media (max-width: 480px) {
  .my-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 10px;
  }
  
  .my-item-image {
    max-width: 70px;
    height: 70px;
  }
  
  .my-item-name {
    font-size: 11px;
  }
}

/* =============================================
   STORE - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .store-container {
    padding: 15px;
  }
  
  .store-header {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .store-title {
    font-size: 28px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 10px;
  }
  
  .store-balance {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
  }
  
  .store-balance-amount {
    color: #10b981;
  }
  
  .store-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }
  
  .store-category-btn {
    padding: 10px 18px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .store-category-btn.active {
    background: linear-gradient(135deg, #f97316, #ff8c00);
    border-color: #f97316;
  }
  
  .store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .store-item {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
  }
  
  .store-item:active {
    transform: scale(0.95);
  }
  
  .store-item-image {
    width: 100%;
    max-width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 10px auto;
  }
  
  .store-item-name {
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .store-item-price {
    font-size: 16px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 10px;
  }
  
  .store-item-buy-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #f97316, #ff8c00);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .store-item-buy-btn:active {
    transform: scale(0.95);
  }
}

@media (max-width: 480px) {
  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .store-item-image {
    max-width: 90px;
    height: 90px;
  }
}

/* =============================================
   SUPPORT TICKETS - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .support-container {
    padding: 15px;
  }
  
  .support-header {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .support-title {
    font-size: 24px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 15px;
  }
  
  .support-new-ticket-btn {
    width: 100%;
    max-width: 300px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #f97316, #ff8c00);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .support-new-ticket-btn:active {
    transform: scale(0.95);
  }
  
  .support-tickets-list {
    margin-top: 20px;
  }
  
  .support-ticket-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
  }
  
  .support-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
  }
  
  .support-ticket-id {
    font-size: 12px;
    color: #888;
  }
  
  .support-ticket-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }
  
  .support-ticket-status.open {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
  }
  
  .support-ticket-status.pending {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    border: 1px solid #f97316;
  }
  
  .support-ticket-status.closed {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
    border: 1px solid #6b7280;
  }
  
  .support-ticket-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
  }
  
  .support-ticket-preview {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 10px;
    line-height: 1.4;
  }
  
  .support-ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #888;
  }
  
  .support-ticket-view-btn {
    padding: 8px 16px;
    background: rgba(249, 115, 22, 0.2);
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-radius: 8px;
    color: #f97316;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .support-ticket-view-btn:active {
    transform: scale(0.95);
  }
}

/* =============================================
   GUILDMARK - MOBILE OPTIMIZATION
   ============================================= */
@media (max-width: 768px) {
  .guildmark-container {
    padding: 15px;
  }
  
  .guildmark-upload-area {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border: 2px dashed rgba(249, 115, 22, 0.3);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
  }
  
  .guildmark-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
  }
  
  .guildmark-upload-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
  }
  
  .guildmark-upload-subtitle {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 15px;
  }
  
  .guildmark-upload-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #f97316, #ff8c00);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
  }
  
  .guildmark-preview {
    background: rgba(249, 115, 22, 0.05);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
  }
  
  .guildmark-preview-image {
    max-width: 150px;
    height: auto;
    margin: 0 auto 15px auto;
    border-radius: 8px;
  }
  
  .guildmark-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
  }
}

/* =============================================
   END OF MOBILE COMPONENTS OPTIMIZATION
   ============================================= */

