/* Modern UI Styling for User Portal */


@font-face {
  font-family: "SuperHuman";
  src: url("/font/CosmicSuperHumanRegular-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Global box-sizing for all elements */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Root variables for consistent theming */
:root {
  --primary-blue: #007bff;
  --primary-dark: #004085;
  --danger-red: #dc3545;
  --success-green: #28a745;
  --warning-yellow: #ffc107;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --dark-gray: #343a40;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
  --transition-speed: 0.3s;
}

/*
html {
    margin: 0;
    height: 100%;
}
*/

body {
    background: url('/img/SuperappSprites/SE_GEN_BKGTile.png') repeat fixed;
    /*
    background-size: 100% 100%;
    min-height: 100vh;

    //background-attachment: fixed;
    //margin:0;      
    //padding:0;

    backdrop-filter: blur(4px) contrast(10%) saturate(500%);
        */
    margin: 0;
    height: 100%;
    /* background-size: 100vw 98vh; */
    background-repeat: repeat;
    background-color: black;
    font-family: "SuperHuman", sans-serif;
}


.viewport {
  display: flex;
  width: 100vw;
  min-height: 100dvh;
 /*
  justify-content: center;
  align-items: center;

 */
}

.leftPanel {
  flex: 1;                 /* fill leftover space */
  background-image: url("/img/Frame/SM_App_Frame_Left.png");
  background-size: auto 100%;
  background-position-x: 100%;
  margin-right: 8px;
}

.rightPanel {
  flex: 1;                 /* fill leftover space */
  background-image: url("/img/Frame/SM_App_Frame_Right.png");
  background-size: auto 100%;
  margin-left: 8px;
}

.centerPanel {
  height: 100vh;           /* fills view vertically */
  height: 100dvh;           /* fills view vertically */
  aspect-ratio: 1313 / 2622;
  background-image: url("/img/Frame/SM_App_Frame_Center.png");
  background-size: cover;      /* or contain */
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

@media (orientation: landscape) {
  .centerPanel {
    height: 100vh;           /* fills view vertically */
    height: 100dvh;           /* fills view vertically */
    aspect-ratio: 1 / 1;
    background-image: url("/img/Frame/SM_App_Frame_Center.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.scan-button {
  /* size */
  max-width: 640px;

  /* text */
  color: white;
  font-size: clamp(14px, 3vw, 30px);
  font-weight: 600;
  text-align: center;
  width: 100%;

  /* reset default button styles */
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: transparent;

  /* center text */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* polish */
  transition: background-image 0.15s ease, transform 0.05s ease;
}

.scan-child {
/*
  max-width: 100%;
  max-height: 80%;

  height: auto;
  width: auto;
*/
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 80%;
  max-width: 100%;
}

.scan-child img {
  position: absolute;
  inset: 0;
  max-width: 80%;
  max-height: 80%;

  object-fit: contain;
  /* reset default button styles */
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: transparent;
}

.scan-hover {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.scan-button:hover .scan-hover {
  opacity: 1;
}


.nav-button {
  /* size */
  width: 100%;
  height: 20%;
  /* max-width: 640px; */
  max-height: 20vh;
  aspect-ratio : 973 / 345;

  /* background image */
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;

  /* text */
  color: white;
  font-size: clamp(18px, 2.5vw, 30px);
  font-weight: 600;
  text-align: center;

  /* reset default button styles */
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: transparent;

  /* center text */
  display: flex;
  align-items: center;
  justify-content: center;

  /* polish */
  transition: background-image 0.15s ease, transform 0.05s ease;
}

@media (orientation: landscape) {
  .nav-button  {
    height: 18%;
    aspect-ratio : 4 / 1;
    background-size: 80% 100%;
  }
}

.nav-button:active {
  transform: translateY(1px); /* subtle press */
}

.nav-button-data {
  background-image: url("/img/SuperappSprites/SE_MM_Data.png");
}
.nav-button-data:hover {
  background-image: url("/img/SuperappSprites/SE_MM_Data_Select.png");
}

.nav-button-photos {
  background-image: url("/img/SuperappSprites/SE_MM_Photos.png");
}
.nav-button-photos:hover {
  background-image: url("/img/SuperappSprites/SE_MM_Photos_Select.png");
}

.nav-button-shard {
  background-image: url("/img/SuperappSprites/SE_MM_Shard.png");
}
.nav-button-shard:hover {
  background-image: url("/img/SuperappSprites/SE_MM_Shard_Select.png");
}

.nav-button-stats {
  background-image: url("/img/SuperappSprites/SE_MM_Stats.png");
}
.nav-button-stats:hover {
  background-image: url("/img/SuperappSprites/SE_MM_Stats_Select.png");
}


.nav-button-board {
  background-image: url("/img/TeamStats/SE_TS_Leaderboard.png");
}
.nav-button-board:hover, .nav-button-board.is-active {
  background-image: url("/img/TeamStats/SE_TS_Leaderboard_Select.png");
}
.nav-button-teams {
  background-image: url("/img/TeamStats/SE_TS_YourTeams.png");
}
.nav-button-teams:hover, .nav-button-teams.is-active {
  background-image: url("/img/TeamStats/SE_TS_YourTeams_Select.png");
}
.nav-button-daily {
  background-image: url("/img/TeamStats/SE_TS_Daily.png");
}
.nav-button-daily:hover, .nav-button-daily.is-active {
  background-image: url("/img/TeamStats/SE_TS_Daily_Select.png");
}
.nav-button-weekly {
  background-image: url("/img/TeamStats/SE_TS_Weekly.png");
}
.nav-button-weekly:hover, .nav-button-weekly.is-active {
  background-image: url("/img/TeamStats/SE_TS_Weekly_Select.png");
}
.nav-button-alltime {
  background-image: url("/img/TeamStats/SE_TS_AllTime.png");
}
.nav-button-alltime:hover, .nav-button-alltime.is-active {
  background-image: url("/img/TeamStats/SE_TS_AllTime_Select.png");
}


/* Modern button styles */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-danger {
  background-color: var(--danger-red);
  color: white;
}

.btn-secondary {
  background-color: var(--medium-gray);
  color: white;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.btn-outline:hover {
  background-color: var(--primary-blue);
  color: white;
}

/* Modern card styling */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 12px;
  margin: 16px 0;
  transition: all var(--transition-speed) ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--light-gray);
}

/* Modern modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 110;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal-overlay-noblur {
  position: fixed;
  top: 0%;
  left: 2vw;
  width: 96vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 110;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  position: relative;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--light-gray);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background: var(--light-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  color: var(--medium-gray);
  transition: all var(--transition-speed) ease;
  font-family: Arial, sans-serif;
  font-weight: normal;
  padding-bottom: 2px;
}

.modal-close:hover {
  background: var(--danger-red);
  color: white;
  transform: rotate(90deg);
}

/* Modern dropdown menu */
.dropdown-menu {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 200px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dark-gray);
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: var(--light-gray);
  padding-left: 24px;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--light-gray);
  margin: 8px 0;
}

/* Modern header */
.modern-header {
  position: absolute;
  top: 11.5%;
  left: 0%;
  right: 0%;
  height: 6vh;
  /* background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1); */
  display: flex;
  z-index: 100;
}

.modern-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 20px;
  font-weight: 600;
}

.modern-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modern-header .menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.modern-header .menu-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Scanner modal specific */
.scanner-modal {
  min-width: 400px;
  min-height: 500px;
}

.scanner-modal .modal-header {
  text-align: center;
  color: var(--primary-blue);
}

.scanner-instructions {
  text-align: center;
  color: var(--medium-gray);
  margin: 20px 0;
  font-style: italic;
}

#scanner {
  border-radius: var(--border-radius);
  overflow: hidden;
  margin: 20px auto;
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-speed) ease;
  z-index: 90;
}

.fab:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.fab:active {
  transform: scale(0.95);
}

.fab img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}

/* Form improvements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--dark-gray);
}

.form-value {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--light-gray);
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  transition: all var(--transition-speed) ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 10px;
  }
  
  .scanner-modal {
    min-width: unset;
    width: 100%;
  }
  
  .modern-header {
    padding: 0 12px;
  }
}

/* Mobile Navigation Tabs */
.mobile-nav-tabs {
  position: absolute;
  bottom: 1.7%;
  left: 10%;
  right: 10%;
  height: 8vh;
  /* background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1); */
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  /* border-top: 1px solid var(--light-gray); */
}

.img-swap {
  align-items: center; 
  justify-content: center; 
  display: flex; 
  flex-direction: column; 
  width: 25%;
}

.img-swap img {
  width: 100%;
  display: block;
}

.img-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.img-swap:hover .img-hover {
  opacity: 1;
}

.nav-tab {
  /* size */
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  object-fit: contain;

  /* reset default button styles */
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: transparent;
}

.nav-tab-help {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Help.png");
}
.nav-tab-help.active {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Help_Select.png");
}
.nav-tab-help:hover {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Help_Select.png");
}

.nav-tab-profile {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Profile.png");
}
.nav-tab-profile.active {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Profile_Select.png");
}
.nav-tab-profile:hover {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Profile_Select.png");
}

.nav-tab-shard {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Shard.png");
}
.nav-tab-shard.active {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Shard_Select.png");
}
.nav-tab-shard:hover {
  content: url("/img/SuperappSprites/SE_GEN_Nav_Shard_Select.png");
}

.nav-tab-scan {
  content: url("/img/SuperappSprites/SE_MM_ScanShield.png");
  max-height: 8vh;
}
.nav-tab-scan.active {
  content: url("/img/SuperappSprites/SE_MM_ScanShield_Select.png");
}
.nav-tab-scan:hover {
  content: url("/img/SuperappSprites/SE_MM_ScanShield_Select.png");
}


.tab-content {
  padding-bottom: 80px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

/* Show mobile nav on mobile devices */
@media (max-width: 768px) {
  .mobile-nav-tabs {
    display: flex;
  }
  
  .fab {
    bottom: 88px; /* Above bottom nav */
  }
  
  /* Hide duplicate navigation elements on mobile */
  .card.clickable[onclick*="location.assign"] {
    display: none;
  }
  
}

/* Smooth transitions for all interactive elements */
* {
  -webkit-tap-highlight-color: transparent;
}

button, a, .clickable {
  user-select: none;
}