/* Global Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Reset spacing and use border-box for consistent sizing */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Profile Card Container */
article[data-testid="test-profile-card"] {
  background-color: #f9f9f9; 
  max-width: 650px;
  border-radius: 16px; /* Rounded corners */
  padding: 30px;
  box-shadow: 0px 8px 20px rgba(0,0,0,0.2); 
  transition: transform 0.2s ease-in-out; 
}

/* Layout: Profile Section Grid */
.Profile-grid-display {
  display: grid;
  grid-template-columns: 170px 1fr; /* Avatar on left, details on right */
}

/* Profile Picture (Avatar) Styling */
figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-right: 1.8rem;
  margin-right: 1.6rem;
  border-right: 2px solid hsl(0, 0%, 90%);
}

figure img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #2a5298;
  padding: 4px;
}

/* Timestamp below avatar */
span[data-testid="test-user-time"] {
  background-color: hsl(0, 0%, 94%);
  width: 97%;
  font-size: 0.8rem;
  text-align: center;
  font-style: oblique;
  letter-spacing: .05em;
  color: hsl(0, 0%, 47%);
  padding: 7px 0;
  border: 1px solid hsl(0, 0%, 80%);
  border-radius: 8px;
}

/* Header (Name & Role) */
header h2 {
  font-size: 2.3rem;
  font-weight: 700;
  color: #222;
}

header [data-testid="test-user-role"] {
  margin: 0;
  padding: 8px 0 7px;
  color: hsla(0, 0%, 40%);
}

/* Bio Section */
p[data-testid="test-user-bio"] {
  font-size: 1rem;
  color: #444;
  line-height: 1.4; /* Improve readability */
  /* padding: 15px 0; (disabled for cleaner layout) */
}

/* Social Links */
nav[data-testid="test-user-social-links"] {
  display: flex;
  gap: 15px;
  margin: 20px 0;
}

nav a {
  text-decoration: none;
  color: #2a5298;
  font-size: .8em;
  font-weight: 600;
  text-align: center;
  padding: 5px 7px;
  border: 1px solid hsl(0, 0%, 80%);
  border-radius: 8px;
  transition: .2s ease-in-out;
}

/* Hover/focus state for links */
nav a:hover,
nav a:focus {
  background-color: hsl(0, 0%, 90%);
  color: #1e3c72;
  border: 1px solid hsl(219, 58%, 38%);
}

/* Hobbies & Dislikes Section */
.Hobbies,
.Dislikes {
  background: #fff;
  border-radius: 10px;
  padding: 12px 15px;
  margin-top: 1.5rem;
  width: 100%;
  box-shadow: 0 0 5px hsl(0, 0%, 95%);
}

section h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #333;
}

/* Grid layout for list items */
ul {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  list-style-type: none;
  color: #555;
}

li {
  width: 100%;
  margin-bottom: 4px;
  background-color: hsl(0, 0%, 94%);
  border-radius: .9rem;
  padding: 10px 18px;
  border: 1px solid hsl(0, 0%, 86%);
}

/* Responsive Design (Tablets) */
@media screen and (max-width: 716px) {
  article[data-testid="test-profile-card"] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .Profile-grid-display {
    grid-template-columns: 1fr;
    justify-content: center;
    align-items: center;
  }

  figure {
    border: none;
    padding: 0;
    margin: 0;
  }

  span[data-testid="test-user-time"] {
    width: 37%; 
  }

  header h2 {
    margin-top: 13px;
  }

  nav[data-testid="test-user-social-links"] {
    justify-content: center;
  }

  ul {
    grid-template-columns: repeat(3, 1fr);
  }

  .Hobbies,
  .Dislikes {
    text-align: left;
  }
}

/* Responsive Design (Mobile) */
@media screen and (max-width: 498px) {
  body {
    background-color: #f9f9f9; /* Remove gradient for simplicity */
    padding: 0;
  }

  article[data-testid="test-profile-card"] {
    padding: 40px 10px;
    border-radius: 0;
  }

  figure img {
    width: 100px;
    height: 100px;
  }

  span[data-testid="test-user-time"] {
    width: 50%;
  }
  
  header h2 {
    font-size: 1.4rem;
  }

  .Hobbies,
  .Dislikes {
    text-align: inherit; /* Reset text alignment */
  }

  ul {
    grid-template-columns: repeat(2, 1fr);
  }
}
