/* MineCore Store – Global Styles */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface2:     #1c2128;
  --surface3:     #22272e;
  --border:       #30363d;
  --border2:      #3d444d;
  --text:         #e6edf3;
  --text-muted:   #7d8590;
  --text-light:   #b1bac4;
  --accent:       #5865f2;
  --accent-dark:  #4752c4;
  --accent-light: #7289da;
  --success:      #2da44e;
  --success-bg:   #1a3a25;
  --warning:      #d29922;
  --warning-bg:   #3a2e0a;
  --danger:       #f85149;
  --danger-bg:    #3a1515;
  --info:         #388bfd;
  --info-bg:      #0d2044;
  --mc:           #5865f2;
  --sw:           #00b4d8;
  --dl:           #f97316;
  --ai:           #a855f7;
  --radius:       8px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --shadow:       0 4px 24px rgba(0,0,0,.5);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.35);
  --shadow-lg:    0 8px 48px rgba(0,0,0,.6);
  --transition:   0.2s ease;
  --header-h:     68px;
  --glass:        rgba(22,27,34,.7);
  --glass-border: rgba(255,255,255,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

body[data-page="account"],
body[data-page="orders"],
body[data-page="downloads"],
body[data-page="wishlist"],
body[data-page="tickets"],
body[data-page="ticket-detail"] {
  visibility: hidden;
}
body[data-page].auth-ready { visibility: visible !important; }

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* === HEADER === */
.store-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.header-logo .logo-text {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text);
}
.header-logo .logo-text em {
  color: var(--accent-light);
  font-style: normal;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.header-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.header-nav a:hover, .header-nav a.active {
  background: var(--surface2);
  color: var(--text);
}
.header-nav a.active { color: var(--accent-light); }

.header-search {
  position: relative;
  flex: 0 1 320px;
}
.header-search input {
  width: 100%;
  height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 16px 0 36px;
  color: var(--text);
  font-size: .875rem;
  outline: none;
  transition: var(--transition);
}
.header-search input:focus {
  border-color: var(--accent);
  background: var(--surface3);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-muted);
  pointer-events: none; flex-shrink: 0;
}
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.search-dropdown.show { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.search-result-item:hover { background: var(--surface2); }
.search-result-item img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.search-result-item .name { font-size: .875rem; font-weight: 500; }
.search-result-item .price { font-size: .8rem; color: var(--text-muted); }

.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn svg { width: 20px; }

.badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.user-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  font-size: .85rem; font-weight: 600;
  color: var(--text-muted);
}
.user-avatar-btn:hover { border-color: var(--accent); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* === USER DROPDOWN === */
.user-menu {
  position: relative;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-header .name { font-weight: 600; font-size: .9rem; }
.user-dropdown-header .email { font-size: .8rem; color: var(--text-muted); }
.user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  color: var(--text-light);
  font-size: .875rem;
  text-decoration: none;
  transition: var(--transition);
}
.user-dropdown a:hover { background: var(--surface2); color: var(--text); }
.user-dropdown a svg { width: 16px; }
.user-dropdown .separator { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown .logout { color: var(--danger); }
.user-dropdown .logout:hover { background: var(--danger-bg); }

/* === MAIN LAYOUT === */
.store-main { min-height: calc(100vh - var(--header-h)); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* === FOOTER === */
.store-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: .875rem; line-height: 1.7; }
.footer-col h4 { font-size: .875rem; font-weight: 600; margin-bottom: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.footer-col a { display: block; color: var(--text-muted); font-size: .875rem; margin-bottom: 8px; transition: var(--transition); }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: var(--text-muted); font-size: .8rem; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px;
  height: 38px;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d73a3a; text-decoration: none; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #259040; text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--accent-light); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; text-decoration: none; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { height: 30px; padding: 0 12px; font-size: .8rem; }
.btn-full { width: 100%; }
.btn svg { width: 16px; flex-shrink: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 24px; }

/* === GLASS CARD === */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
}

/* === FORM === */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .875rem; font-weight: 500; color: var(--text-light); margin-bottom: 6px; }
.form-control {
  width: 100%;
  height: 42px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--text);
  font-size: .875rem;
  outline: none;
  transition: var(--transition);
}
.form-control:focus { border-color: var(--accent); background: var(--surface3); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { height: auto; padding: 12px 14px; resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 4px; }

/* === ALERT === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert svg { width: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(45,164,78,.2); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(248,81,73,.2); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(56,139,253,.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(210,153,34,.2); }

/* === BADGE/TAG === */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.tag-accent  { background: rgba(88,101,242,.15); color: var(--accent-light); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger  { background: var(--danger-bg);  color: var(--danger); }
.tag-muted   { background: var(--surface3);   color: var(--text-muted); }
.tag-info    { background: var(--info-bg);    color: var(--info); }

/* === SPINNER === */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px; gap: 16px; color: var(--text-muted);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-light); }
.empty-state p { font-size: .875rem; }

/* === TOAST === */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  min-width: 260px; max-width: 360px;
  animation: slideIn .2s ease;
}
.toast svg { width: 18px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success svg { color: var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-error   svg { color: var(--danger); }
.toast-info    { border-left: 3px solid var(--info); }
.toast-info    svg { color: var(--info); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn .15s ease;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-close svg { width: 20px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* === ACCOUNT LAYOUT === */
.account-layout {
  display: flex; min-height: calc(100vh - var(--header-h));
}
.account-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.account-sidebar .sidebar-section { padding: 0 12px; margin-bottom: 4px; }
.account-sidebar .section-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 8px 12px 4px; }
.account-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: .875rem; color: var(--text-light);
  text-decoration: none; transition: var(--transition);
}
.account-sidebar a:hover { background: var(--surface2); color: var(--text); }
.account-sidebar a.active { background: rgba(88,101,242,.15); color: var(--accent-light); }
.account-sidebar a svg { width: 16px; flex-shrink: 0; }
.account-content { flex: 1; padding: 32px; overflow-x: hidden; }
.account-content h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-nav { display: none; }
}
@media (max-width: 768px) {
  .store-header { padding: 0 16px; }
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .account-sidebar { display: none; }
  .account-content { padding: 20px 16px; }
  .header-search { flex: 0 1 180px; }
}
@media (max-width: 480px) {
  .header-search { display: none; }
}
