/* Enhanced Profile Page Styles */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f0f4f8 0%, #e6eef7 100%);
  width: 100%;
  height: 100%;
  color: #2d3748;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Enhanced Navbar - Matched with Explore Page */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  background: linear-gradient(90deg, rgba(0, 84, 180, 0.9) 0%, rgba(0, 122, 255, 0.9) 100%);
  height: 4rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  height: 100%;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.03);
}

.logo a img {
  height: 4rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: transparent;
  border-radius: 2%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: rgba(255, 255, 255, 0.8);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: #dbeafe;
}

/* Enhanced Profile Header */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: white;
  padding: 2.5rem;
  margin-top: 2rem;
  box-shadow: 0 6px 20px rgba(0, 84, 180, 0.15);
  border-radius: 12px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, rgba(0, 84, 180, 0.9) 0%, rgba(64, 156, 255, 0.9) 100%);
}

.profile-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  min-width: 280px;
}

.profile-pic {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-right: 1.5rem;
  border: 3px solid rgba(0, 122, 255, 0.9);
  box-shadow: 0 4px 10px rgba(0, 84, 180, 0.3);
  transition: transform 0.3s ease;
}

.profile-pic:hover {
  transform: scale(1.05);
}

.profile-right {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  min-width: 280px;
}

.stat-box {
  text-align: center;
  background: #f8f9fd;
  padding: 1rem;
  border-radius: 10px;
  min-width: 100px;
  flex: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 84, 180, 0.2);
}

.stat-box h3 {
  color: rgba(0, 122, 255, 0.9);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.stat-box p {
  font-weight: bold;
  font-size: 1.3rem;
  color: #2d3748;
}

/* Enhanced Profile Layout */
.profile-container {
  display: flex;
  margin: 2rem auto;
  width: 90%;
  max-width: 1100px;
  gap: 1.5rem;
  flex-direction: row;
  flex-wrap: wrap;
}

/* Enhanced Sidebar */
.sidebar {
  width: 250px;
  background: white;
  box-shadow: 0 6px 20px rgba(0, 84, 180, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 12px 15px;
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar li.active,
.sidebar li:hover {
  background: linear-gradient(90deg, #5b9bd5 0%, #4a89c7 100%);
  color: white;
  transform: translateX(5px);
}

/* Enhanced Content Area */
.content {
  flex-grow: 1;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(91, 155, 213, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-width: 280px;
}

.content h2, .content h3 {
  color: #5b9bd5;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 1.5rem;
}

.content h2::after, .content h3::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, #5b9bd5 0%, #ffd166 100%);
  border-radius: 3px;
}

/* Enhanced Profile Stats */
.profile-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.info-box {
  text-align: center;
  background: #f8f9fd;
  padding: 1.5rem;
  border-radius: 10px;
  flex: 1;
  min-width: 130px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.info-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(91, 155, 213, 0.2);
}

.info-box h3, .info-box h4 {
  color: #5b9bd5;
  margin-bottom: 0.5rem;
}

.info-box p {
  font-weight: bold;
  font-size: 1.2rem;
  color: #2d3748;
}

/* Enhanced Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-start;
  margin-top: 1.5rem;
}

.badge {
  background: linear-gradient(135deg, #5b9bd5 0%, #4a89c7 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(91, 155, 213, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge:hover {
  background: linear-gradient(135deg, #4a89c7 0%, #3a78b6 100%);
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 20px rgba(91, 155, 213, 0.4);
}

.badge i {
  font-size: 1.2rem;
}

/* Enhanced Badge Popup */
.badge-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  z-index: 1000;
  display: none;
  max-width: 500px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-popup h2 {
  color: #5b9bd5;
  margin-bottom: 1rem;
}

.badge-popup p {
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.badge-popup button {
  margin-top: 1rem;
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff5252 0%, #e04848 100%);
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
}

.badge-popup button:hover {
  background: linear-gradient(135deg, #e04848 0%, #c03939 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 82, 82, 0.4);
}

/* Enhanced Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  width: 100%;
}

.settings-form label {
  font-weight: 500;
  color: #4a5568;
  margin-bottom: -8px;
}

.settings-form input {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.settings-form input:focus {
  border-color: #5b9bd5;
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
  outline: none;
}

.settings-form button {
  background: linear-gradient(135deg, #ffd166 0%, #ffb347 100%);
  border: none;
  padding: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  color: #2d3748;
  margin-top: 1rem;
  box-shadow: 0 4px 10px rgba(255, 179, 71, 0.3);
}

.settings-form button:hover {
  background: linear-gradient(135deg, #ffb347 0%, #ff9a3f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 179, 71, 0.4);
}

/* Enhanced Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(90deg, rgba(0, 84, 180, 0.9) 0%, rgba(0, 122, 255, 0.9) 100%);
  color: white;
  margin-top: auto;
  width: 100%;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
}

.footer p {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Animation for content sections */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-section {
  animation: fadeIn 0.6s ease-out forwards;
}

.hidden {
  display: none;
}

/* Contest Table Responsive */
.contest-table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

.submission-list {
  padding-left: 0;
  list-style-type: none;
}

/* Mobile Menu Toggle (will be shown on small screens) */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive Design Media Queries */
@media (max-width: 1024px) {
  .profile-header, .profile-container {
    width: 95%;
  }
  
  .sidebar {
    width: 200px;
  }
}

@media (max-width: 900px) {
  .profile-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    margin-bottom: 1.5rem;
  }
  
  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .sidebar li {
    flex: 1;
    min-width: 120px;
    text-align: center;
    margin-bottom: 0.5rem;
  }
  
  .sidebar li.active,
  .sidebar li:hover {
    transform: translateY(-3px);
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }
  
  .profile-header {
    flex-direction: column;
    padding: 1.5rem;
    margin-top: 1rem;
  }
  
  .profile-left, .profile-right {
    width: 100%;
    justify-content: center;
  }
  
  .profile-right {
    margin-top: 1.5rem;
  }
  
  .content {
    padding: 1.5rem;
  }
  
  .stat-box {
    min-width: 80px;
    padding: 0.8rem;
  }
  
  .info-box {
    min-width: 100px;
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 4rem;
    left: 0;
    width: 100%;
    background: rgba(0, 84, 180, 0.95);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 9;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
  
  .nav-links.active {
    transform: translateY(0);
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .user-info {
    text-align: center;
    margin-top: 1rem;
  }
  
  .profile-left {
    flex-direction: column;
    align-items: center;
  }
  
  .profile-pic-section {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .stat-box {
    min-width: 120px;
  }
  
  .profile-stats {
    flex-direction: column;
    align-items: center;
  }
  
  .info-box {
    width: 100%;
    max-width: 250px;
  }
  
  .settings-form {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .profile-header {
    padding: 1rem;
  }
  
  .content {
    padding: 1rem;
  }
  
  .profile-right {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
  }
  
  .stat-box {
    width: 100%;
  }
}