/* --- Global Resets & Variables --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0c0f;
  --bg-primary-rgb: 10, 12, 15;
  --bg-secondary: #14171c;
  --bg-tertiary: #20252c;
  --bg-tertiary-rgb: 32, 37, 44;
  --border-color: #2c3138;
  --border-highlight: rgba(0, 242, 234, 0.3);

  --text-primary: #e0e6eb;
  --text-secondary: #9ba4b0;
  --accent-primary: #00f2ea;
  --accent-secondary: #ff40a1;
  --accent-glow: rgba(0, 242, 234, 0.2);
  --accent-secondary-glow: rgba(255, 64, 161, 0.2);

  --success-color: #33ff99;
  --warning-color: #ffcc33;

  --font-main: 'Inter', sans-serif;
  --font-display: 'Orbitron', sans-serif;

  --border-radius-sm: 5px;
  --border-radius-md: 10px;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.3);

  --transition-fast: 0.2s ease-in-out;
  --transition-medium: 0.3s ease-in-out;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(45deg, rgba(var(--bg-primary-rgb), 0.95) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(var(--bg-primary-rgb), 0.95) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(var(--bg-primary-rgb), 0.95) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(var(--bg-primary-rgb), 0.95) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.container {
  width: 90%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 8px var(--accent-secondary-glow);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Animations --- */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtlePulse {

  0%,
  100% {
    box-shadow: 0 0 5px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 10px var(--accent-glow), 0 0 15px var(--accent-glow);
  }
}

/* --- Site Header --- */
.site-header {
  background-color: rgba(var(--bg-primary-rgb), 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: inline-block;
  vertical-align: middle;
  transition: transform var(--transition-fast);
}

.logo img {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.logo:hover {
  transform: scale(1.05);
}

.user-actions {
  display: flex;
  align-items: center;
}

.header-user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 0 8px var(--accent-glow);
  vertical-align: middle;
}

.header-user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--accent-glow), 0 0 5px var(--accent-primary);
}

.profile-page {
  padding-top: 70px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: calc(100vh - 70px - 71px);
}

.profile-car-bg {
  background-image: url('images/friend1bkg.jpg');
}

.profile-edge-bg {
  background-image: url('images/friend2bkg.jpg');
}

.profile-Negatron-bg {
  background-image: url('images/friend3bkg.jpg');
}

.profile-YourDream-bg {
  background-image: url('images/friend4bkg.jpg');
}

.profile-petertodd-bg {
  background-image: url('images/friend5bkg.jpg');
}

.profile-milfInTraining-bg {
  background-image: url('images/friend6bkg.jpg');
}

/* --- New Profile Header Info --- */
.profile-header-info-container {
  padding-top: 40px;
  padding-bottom: 40px;
  background-color: rgba(var(--bg-primary-rgb), 0.65);
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.profile-header-content {
  display: flex;
  align-items: flex-end;
  gap: 25px;
}

.profile-picture-container {
  border: 5px solid var(--bg-secondary);
  border-radius: 50%;
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
}

.profile-picture {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  animation: subtlePulse 4s infinite ease-in-out;
}

.profile-info {
  flex-grow: 1;
  color: var(--text-primary);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);
}

.profile-name {
  font-family: var(--font-display);
  font-size: 2.5em;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.profile-tagline {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-style: italic;
}

.profile-actions .btn {
  padding: 12px 25px;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
}

.profile-actions .btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn-friend-request {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  border: none;
}

.btn-friend-request:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-primary) 90%, white), color-mix(in srgb, var(--accent-secondary) 90%, white));
}

.btn-friend-request.request-sent {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: default;
  opacity: 0.7;
  box-shadow: none !important;
  transform: none !important;
}

.btn-friend-request.request-sent:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* --- Profile Main Content Grid --- */
.profile-main-content {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: 30px;
  margin-top: 0;
}

/* --- Content Cards --- */
.content-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  animation: fadeInSlideUp 0.5s ease-out forwards;
  opacity: 0;
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
}

.content-card:nth-child(1) {
  animation-delay: 0.1s;
}

.content-card:nth-child(2) {
  animation-delay: 0.2s;
}

.content-card:nth-child(3) {
  animation-delay: 0.3s;
}

.content-card:nth-child(4) {
  animation-delay: 0.4s;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-highlight);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.4em;
  color: var(--accent-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 1px;
  text-shadow: 0 0 5px var(--accent-glow);
}

/* Sidebar specific */
.profile-sidebar-left .readme-content p {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}

.condensed-friends-list {
  list-style: none;
}

.condensed-friends-list li a {
  display: flex;
  align-items: center;
  padding: 10px 5px;
  color: var(--text-secondary);
  font-size: 0.95em;
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast);
}

.condensed-friends-list li a:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding-left: 10px;
}

.condensed-friends-list img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  border: 2px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

.condensed-friends-list li a:hover img {
  border-color: var(--accent-primary);
}

/* Feed specific */
.music-player-card .music-player-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.album-art-feed {
  width: 110px;
  height: 110px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-medium);
}

.music-player-card:hover .album-art-feed {
  transform: rotate(-3deg) scale(1.05);
}

.song-details {
  flex-grow: 1;
}

.song-title-feed {
  font-weight: 600;
  font-size: 1.15em;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.artist-name-feed {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.audio-player-feed {
  width: 100%;
  filter: contrast(1.2) brightness(0.85) hue-rotate(10deg) saturate(1.5);
  border-radius: var(--border-radius-sm);
}

/* --- Trade Terminal Redesign --- */
.item-trade-card .trade-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.item-trade-card .trade-section-feed {
  width: 100%;
}

.item-trade-card .trade-section-feed h3 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.1em;
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-main);
}

.item-trade-card .trade-section-feed h3::before {
  display: inline-block;
  /* content: ""; Removed */
  /* margin-right: 8px; Removed */
  font-size: 1.2em;
  /* Can be removed if no other ::before content */
  vertical-align: middle;
  transition: transform var(--transition-fast);
}

.item-trade-card .trade-section-feed:hover h3::before {
  transform: scale(1.15) rotate(-4deg);
  /* May look odd without content, consider adjusting */
}

.trade-swap-arrow-container {
  text-align: center;
  margin: 15px 0;
}

.trade-swap-icon {
  /* Class for the img tag */
  display: block;
  margin: 10px auto;
  width: 50px;
  /* Adjust as needed */
  height: auto;
  transform: rotate(90deg);
  filter: drop-shadow(0 0 6px var(--accent-glow));
  animation: subtleImagePulse 2.5s infinite ease-in-out;
}

@keyframes subtleImagePulse {

  0%,
  100% {
    transform: rotate(90deg) scale(1);
    opacity: 0.85;
  }

  50% {
    transform: rotate(90deg) scale(1.1);
    opacity: 1;
  }
}

.item-trade-card .trade-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-left: 0;
  font-size: 0.9em;
}

.item-trade-card .trade-list li {
  display: flex;
  align-items: center;
  background-color: rgba(var(--bg-tertiary-rgb), 0.8);
  padding: 12px 15px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--border-color);
  transition: all var(--transition-fast);
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow-sm);
}

.item-trade-card .trade-list li:hover {
  border-left-color: var(--accent-secondary);
  transform: translateX(4px) scale(1.02);
  background-color: var(--border-color);
}

.item-trade-card .trade-list img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-right: 12px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* --- "Make Trade" Button Styling --- */
.btn-make-trade {
  display: block;
  width: 70%;
  max-width: 280px;
  margin: 0 auto;
  padding: 12px 25px;
  font-size: 1.1em;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), 0 0 10px var(--accent-glow);
  transition: all var(--transition-medium);
  cursor: pointer;
  text-align: center;
}

.btn-make-trade:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 15px var(--accent-glow), 0 0 8px var(--accent-secondary-glow);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-primary) 90%, white), color-mix(in srgb, var(--accent-secondary) 90%, white));
}

.btn-make-trade:disabled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: wait;
  opacity: 0.6;
  box-shadow: var(--shadow-inset);
  transform: none;
}

.profile-feed .post-timestamp {
  font-size: 0.85em;
  color: var(--text-secondary);
  display: block;
  margin-top: 12px;
  text-align: right;
}

.profile-feed .content-card p {
  line-height: 1.7;
}

/* --- Added for Steam Login --- */
#steamLoginButton {
  background-color: #5c7e10;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-transform: none;
}

#steamLoginButton:hover {
  background-color: #7ea32e;
  filter: brightness(1.1);
}

#logoutButton {
  background-color: #c94c4c;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-transform: none;
}

#logoutButton:hover {
  background-color: #e06666;
  filter: brightness(1.1);
}

#steamInfoDisplay {
  font-weight: 500;
  vertical-align: middle;
}

#steamLoginButton,
#logoutButton {
  line-height: normal;
  vertical-align: middle;
}

/* --- Site Footer --- */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 25px 0;
  text-align: center;
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-top: 50px;
}

.site-footer p {
  opacity: 0.7;
}

.trade-status-backdrop {
    position: fixed;   /* Cover the entire viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Black with 70% opacity */
    z-index: 9999;     /* IMPORTANT: Should be lower than the popup image's z-index, but higher than page content */
    display: block;    /* Ensure it takes up space */
}

/* Ensure your popup image style has a higher z-index */
.trade-status-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;  /* MUST be higher than .trade-status-backdrop's z-index */

    display: block;
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    /* Optional styling from before can remain */
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .profile-main-content {
    grid-template-columns: minmax(250px, 280px) 1fr;
  }

  .profile-picture {
    width: 140px;
    height: 140px;
  }

  .profile-name {
    font-size: 2.2em;
  }
}

@media (max-width: 768px) {
  .site-header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .profile-page {
    padding-top: 70px;
    min-height: calc(100vh - 70px - 65px);
  }

  .profile-header-info-container {
    padding-top: 25px;
    padding-bottom: 25px;
  }

  .profile-header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-picture-container {
    margin-bottom: 15px;
  }

  .profile-info {
    margin-bottom: 15px;
  }

  .profile-actions {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .profile-actions .btn {
    margin-left: 0;
  }

  .profile-main-content {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-sidebar-left .content-card,
  .profile-feed .content-card {
    margin-bottom: 20px;
    border-radius: var(--border-radius-md);
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .logo img {
    height: 35px;
  }

  .header-user-avatar {
    width: 40px;
    height: 40px;
  }

  #steamLoginButton,
  #logoutButton {
    padding: 6px 10px;
    font-size: 0.9em;
  }

  #steamInfoDisplay {
    font-size: 0.85em;
  }

  .profile-header-info-container {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .profile-picture {
    width: 120px;
    height: 120px;
  }

  .profile-name {
    font-size: 2em;
  }

  .profile-tagline {
    font-size: 1em;
  }

  .btn-friend-request {
    padding: 10px 20px;
    font-size: 0.85em;
  }

  .card-title {
    font-size: 1.25em;
  }

  .content-card {
    padding: 20px;
  }

  .album-art-feed {
    width: 90px;
    height: 90px;
  }
}