* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0f1115;
  background-image: url('bg.png');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: #e8e8e8;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  /* Darken the background image */
  z-index: -1;
}

.wrap {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  margin: 15px 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Header & Nav */
.main-header {
  background: rgba(23, 26, 33, 0.9);
  border: 1px solid #3c4454;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.main-header h1 {
  margin-top: 0;
  text-align: center;
  color: #00d9ff;
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* Fixed Header Styles */
.fixed-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(15, 17, 21, 0.95);
  border-bottom: 1px solid #3c4454;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  z-index: 1000;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
}

.header-center h1 {
  margin: 0;
  font-size: 1.2rem;
  color: #00d9ff;
  text-shadow: 0 0 5px rgba(0, 217, 255, 0.5);
}

.header-right {
  gap: 15px;
  font-size: 0.9rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #333;
  color: #ccc;
  white-space: nowrap;
}

.username-link {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  margin-right: 10px;
}

.nav-dropdown {
  position: absolute;
  top: 60px;
  left: 0;
  background: #171a21;
  border: 1px solid #3c4454;
  border-top: none;
  border-radius: 0 0 5px 0;
  width: 200px;
  display: none;
  /* Hidden by default */
  flex-direction: column;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
  max-height: 80vh;
  overflow-y: auto;
}

.nav-dropdown.show {
  display: flex;
}

.nav-dropdown a {
  padding: 12px 15px;
  color: #ccc;
  text-decoration: none;
  border-bottom: 1px solid #2a2f3a;
  transition: background 0.2s;
}

.nav-dropdown a:hover {
  background: #252a35;
  color: #fff;
  padding-left: 20px;
  /* Slide effect */
}

/* Utilities */
.stat-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 5px;
}

.flex-responsive {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Mobile Header Optimizations */
@media (max-width: 600px) {
  .header-center h1 {
    display: none;
    /* Hide title on mobile to save space */
  }

  .stat-max {
    display: none;
    /* Hide / Max value on mobile */
  }

  .fixed-top-bar {
    padding: 0 10px;
    justify-content: space-between;
  }

  .header-right {
    gap: 8px;
    font-size: 0.8rem;
    flex: 1;
    justify-content: flex-end;
  }

  .stat-box {
    padding: 3px 6px;
  }

  .stat-icon {
    margin-right: 2px;
    width: 20px;
    height: 20px;
  }
}

/* Common Components */
.card {
  background: rgba(23, 26, 33, 0.95);
  border: 1px solid #252a35;
  border-radius: 10px;
  padding: 15px;
  margin: 10px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

button,
.button {
  background: linear-gradient(to bottom, #2b323f, #1e232c);
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  border: 1px solid #3c4454;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-family: inherit;
  line-height: normal;
  /* Ensure consistent height with flex items */
  box-sizing: border-box;
  /* Ensure padding doesn't affect width in weird ways */
}

button:hover,
.button:hover {
  background: linear-gradient(to bottom, #364152, #252a35);
  border-color: #00d9ff;
  color: #fff;
  text-decoration: none;
}

a {
  color: #9bdcff;
  text-decoration: none;
}

a:hover {
  color: #fff;
  text-decoration: underline;
}

.alert {
  background: rgba(59, 27, 27, 0.9);
  border: 1px solid #ff4444;
  color: #ffbdbd;
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
  text-align: center;
}

input,
select {
  box-sizing: border-box;
  background: #0f1115;
  border: 1px solid #3c4454;
  color: #fff;
  padding: 8px;
  border-radius: 5px;
}

input:focus,
select:focus {
  border-color: #00d9ff;
  outline: none;
}

/* Footer */
.main-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px;
  font-size: 0.8em;
  color: #666;
  border-top: 1px solid #252a35;
}

.main-footer strong,
.main-footer b {
  color: #888;
}