/* ===================================
   GIGSPLAY DASHBOARD - CORE STYLES v10
   Layout, Sidebar, Header, Loader
   FINAL FIX FOR REAL MOBILE
   =================================== */

/* Dashboard Layout */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
  background: #f8f9fb;
  font-family: Arial, sans-serif;
}

.dashboard-content {
  flex: 1;
  padding: 20px;
  width: 100%;
  max-width: 100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: #fff;
  border-right: 1px solid #e5e5e5;
  padding: 25px 0;
  width: 240px;
  min-height: 100%;
  transition: all 0.3s ease;
}

.sidebar .user-profile {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 25px;
}

.sidebar .user-profile img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-right: 10px;
}

.sidebar .user-profile .info {
  flex: 1;
}

.sidebar .user-profile .name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .user-profile .edit-profile {
  font-size: 11px;
  color: #555;
  text-decoration: none;
  border: 1px solid #ddd;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-block;
  margin-top: 4px;
}

.sidebar .user-profile .edit-profile:hover {
  background: #f4f4f4;
  border-color: #999;
  color: #000;
}

.sidebar .menu-label {
  font-size: 12px;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
  letter-spacing: 0.6px;
  margin: 20px 25px 10px;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 10px 25px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  margin: 4px 10px;
  transition: all 0.25s ease;
}

.sidebar a i {
  font-size: 18px;
  margin-right: 12px;
  color: #333;
  transition: transform 0.25s ease, color 0.25s ease;
}

.sidebar a:hover {
  background: #f4f4f4;
  color: #000;
}

.sidebar a:hover i {
  transform: scale(1.2);
  color: #000;
}

.sidebar a.active {
  background: #eaf3ff;
  color: #000;
  font-weight: 600;
}

.sidebar a.active i {
  color: #0073aa;
  transform: scale(1.15);
}

.sidebar-close {
  display: none;
}

/* ===== DASHBOARD HEADER ===== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 16px 22px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.dashboard-header:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.dashboard-header .welcome {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-header .search {
  position: relative;
  display: flex;
  align-items: center;
  background: #f4f6f8;
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.dashboard-header .search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #333;
  width: 160px;
  position: relative;
  z-index: 2;
}

/* Dashboard Search Dropdown */
.dashboard-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid #eee;
  overflow: hidden;
  display: none;
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}

.dashboard-search-dropdown.active {
  display: block;
}

.dashboard-search-dropdown .dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
}

.dashboard-search-dropdown .dropdown-item:last-child {
  border-bottom: none;
}

.dashboard-search-dropdown .dropdown-item:hover {
  background: #f4f6f8;
}

.dashboard-search-dropdown .no-result {
  padding: 12px 14px;
  color: #999;
  font-size: 13px;
  text-align: center;
}

.dashboard-header .cart-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f8;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #444;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
}

.dashboard-header .cart-link:hover {
  background: #e4e8eb;
  color: #111;
  transform: scale(1.05);
}

.dashboard-header .cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f44336;
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 50%;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-wrapper {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f44336;
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 50%;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-badge.bounce {
  animation: bounceCart 0.6s ease;
}

@keyframes bounceCart {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.3); }
  60% { transform: scale(0.9); }
}

/* ===== DASHBOARD LOADER ===== */
#dashboard-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#dashboard-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
}

.loader-logo {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.loader-logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0073aa;
  animation: bounce 1.2s infinite ease-in-out;
}

.loader-logo .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-logo .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

#dashboard-loader p {
  font-size: 13px;
  color: #666;
}

body.loading-dashboard #gigsplay-dashboard {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

body.loaded-dashboard #gigsplay-dashboard {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}

/* ===== COMMON BOX ===== */
.point-history-box {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.point-history-box h4 {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  color: #222;
  gap: 10px;
  margin-bottom: 6px;
}

.point-history-box h4 i {
  background: #eef2f5;
  color: #2196f3;
  border-radius: 10px;
  padding: 8px;
  font-size: 18px;
}

.point-history-box .subtitle {
  font-size: 17px;
  color: #777;
  margin-bottom: 15px;
}

/* ===== RESPONSIVE - MOBILE ===== */
.dashboard-sidebar-toggle {
  display: none;
}

@media screen and (max-width: 992px) {
  /* Reset everything */
  html, body {
    overflow-x: hidden !important;
    background: #f8f9fb;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  /* Force single column layout */
  .dashboard-wrapper {
    display: block !important;
    flex-direction: column !important;
    position: static !important;
    z-index: auto !important;
    transform: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .dashboard-content {
    display: block !important;
    position: static !important;
    z-index: auto !important;
    transform: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 15px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  
  /* ===== SIDEBAR MOBILE v10 FIXED ===== */
  .sidebar {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 75vw !important;
    max-width: 280px !important;
    height: 100vh !important;
    background: #ffffff !important;
    box-shadow: 2px 0 15px rgba(0,0,0,0.12) !important;
    border-right: 1px solid #e5e5e5 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .sidebar.active {
    display: block !important;
    transform: translateX(0) !important;
  }
  
  /* Scrollbar */
  .sidebar::-webkit-scrollbar {
    width: 5px;
  }
  
  .sidebar::-webkit-scrollbar-track {
    background: #f8f8f8;
  }
  
  .sidebar::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
  }
  
  .sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
  }

  /* Menu items */
  .sidebar a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    margin: 4px 8px;
    background: transparent;
    transition: all 0.25s ease;
  }
  
  .sidebar a:hover {
    background: #f4f4f4;
    color: #000;
  }
  
  .sidebar a.active {
    background: #eaf3ff;
    color: #000;
    font-weight: 600;
  }
  
  .sidebar a i {
    font-size: 18px;
    margin-right: 10px;
    color: #333;
    flex-shrink: 0;
  }
  
  .sidebar a.active i {
    color: #0073aa;
  }

  /* Menu labels */
  .sidebar .menu-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.6px;
    margin: 15px 20px 10px;
    padding: 0;
    display: block;
    background: transparent;
  }
  
  .sidebar .menu-label.first-label {
    margin-top: 12px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
  }
  
  .sidebar .menu-label.first-label .sidebar-close-inline {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
    display: block;
    flex-shrink: 0;
  }

  /* Last menu item */
  .sidebar > a:last-of-type,
  .sidebar .logout-link {
    margin-bottom: 50px;
  }

  .sidebar-close {
    display: none;
  }

  /* Overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1999;
    display: none;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    display: block;
  }

  .sidebar .user-profile {
    display: none;
  }

  /* Header */
  .dashboard-header {
    position: relative;
    z-index: 2500;
    padding: 12px 15px;
    margin-bottom: 15px;
  }

  .dashboard-sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: #f4f6f8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 2200;
    flex-shrink: 0;
  }

  .dashboard-sidebar-toggle span {
    width: 18px;
    height: 2px;
    background: #222;
    margin: 3px 0;
    display: block;
    border-radius: 2px;
  }

  .dashboard-header .welcome {
    font-size: 14px;
    margin-left: 10px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
  }
  
  /* Search Mobile */
  .dashboard-header .search {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-right: 8px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }
  
  .dashboard-header .search i {
    font-size: 16px;
    color: #444;
    cursor: pointer;
    display: block;
    transition: color 0.2s ease;
  }
  
  .dashboard-header .search i:hover {
    color: #111;
  }
  
  .dashboard-header .search input {
    display: none;
  }
  
  .dashboard-header .search.active {
    position: absolute;
    left: 15px;
    right: 60px;
    width: auto;
    height: 40px;
    background: #fff;
    border-radius: 20px;
    padding: 0 40px 0 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 3000;
  }
  
  .dashboard-header .search.active input {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
  }
  
  .dashboard-header .search.active i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3001;
  }
  
  .dashboard-search-dropdown {
    position: absolute;
    top: 50px;
    left: 15px;
    right: 60px;
    width: auto;
    max-height: 250px;
    z-index: 3000;
  }
  
  .search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 2999;
    display: none;
  }
  
  .search-overlay.active {
    display: block;
  }
  
  /* Cart */
  .dashboard-header .cart-link {
    width: 36px;
    height: 36px;
    font-size: 16px;
    flex-shrink: 0;
  }
  
  .dashboard-header .cart-badge {
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    padding: 2px 5px;
  }

  body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
  
  body.search-open {
    overflow: hidden;
  }
  
  /* Point History Box */
  .point-history-box {
    padding: 15px;
    margin-top: 15px;
  }
  
  .point-history-box h4 {
    font-size: 16px;
    margin-bottom: 4px;
  }
  
  .point-history-box h4 i {
    padding: 6px;
    font-size: 16px;
  }
  
  .point-history-box .subtitle {
    font-size: 13px;
    margin-bottom: 12px;
  }
}

@media screen and (min-width: 993px) {
  .sidebar-close {
    display: none;
  }
  
  .sidebar-overlay {
    display: none !important;
  }
}

/* Extra small mobile - sidebar lebih kecil */
@media screen and (max-width: 400px) {
  .sidebar {
    width: 80vw !important;
    max-width: 260px !important;
  }
  
  .sidebar .menu-label,
  .sidebar a {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .sidebar .menu-label.first-label {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .sidebar a {
    margin: 4px 6px;
  }
  
  .sidebar .menu-label {
    margin-left: 15px;
    margin-right: 15px;
    font-size: 10px;
  }
}
@media screen and (max-width: 992px) {
  /* Reset everything */
  html, body {
    overflow-x: hidden !important;
    background: #f8f9fb;
    margin: 0;
    padding: 0;
    width: 100%;
    position: relative;
  }

  /* Force single column layout */
  .dashboard-wrapper {
    display: block !important;
    flex-direction: column !important;
    position: static !important;
    z-index: auto !important;
    transform: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh;
  }
  
  .dashboard-content {
    display: block !important;
    position: static !important;
    z-index: auto !important;
    transform: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    margin: 0 auto !important;
    padding: 15px !important;
    width: 100% !important;
    max-width: 100vw !important;
    flex: none !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure all child elements are properly contained */
  .dashboard-content > * {
    max-width: 100%;
    box-sizing: border-box;
  }