/* Profile Page Styles */
:root {
  /* Color Palette */
  --dark-blue: #1a1e4b;
  --medium-blue: #242873;
  --bright-blue: #4549e0;
  --light-blue: #6f74f7;
  --yellow: #f7b928;
  --green: #10b981;
  --red: #ef4444;
  --white: #ffffff;
  --light-gray: #f3f4f6;
  --gray: #9ca3af;

  /* Specific UI Colors */
  --background: #1a1e4b;
  --card-bg: #242873;
  --card-bg-darker: #1f2266;
  --card-bg-lighter: #2e3291;
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--bright-blue);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--light-blue);
}

.back-link i {
  margin-right: 0.5rem;
}

/* Profile Layout */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .profile-layout {
    grid-template-columns: 1fr 1.5fr;
  }
}

.profile-main-container {
  display: flex;
  flex-direction: column;
}

/* Profile Card */
.profile-card {
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
}

.profile-header {
  background: linear-gradient(135deg, var(--card-bg), var(--card-bg-darker));
  padding: 2rem;
  text-align: center;
  position: relative;
}

/* Profile Avatar with Initials */
.profile-avatar-container {
  position: relative;
  width: 120px;
  margin: 0 auto 1.5rem;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  background-color: var(--card-bg-darker);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  background-color: var(--bright-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 600;
}

/* Fix for the text "Profile" showing up */
.profile-avatar::before,
.profile-avatar::after {
  content: none !important;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: -15px;
  background-color: var(--bright-blue);
  color: var(--white);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 1.2rem;
  z-index: 2;
}

.avatar-edit-btn:hover {
  background-color: var(--light-blue);
  transform: scale(1.1);
}

/* Profile Name with Edit Button */
.profile-name-container {
  margin-bottom: 0.75rem;
}

.profile-name {
  color: var(--white);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-edit-name {
  background: none;
  border: none;
  color: var(--light-gray);
  opacity: 0.7;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-name:hover {
  color: var(--white);
  opacity: 1;
}

.edit-name-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.edit-name-form .form-control {
  background-color: var(--card-bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  width: auto;
  max-width: 200px;
  text-align: center;
}

.edit-name-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-save-name,
.btn-cancel-name {
  background-color: var(--card-bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  border-radius: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save-name {
  background-color: var(--green);
}

.btn-save-name:hover {
  background-color: #0da271;
}

.btn-cancel-name {
  background-color: var(--red);
}

.btn-cancel-name:hover {
  background-color: #dc2626;
}

.profile-info {
  color: var(--white);
  opacity: 0.8;
  margin-bottom: 0;
  font-size: 1rem;
}

.profile-body {
  padding: 1.5rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-stat {
  text-align: center;
  padding: 1rem;
  background-color: var(--card-bg-darker);
  border-radius: 0.5rem;
}

.profile-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.profile-stat .stat-label {
  font-size: 0.875rem;
  color: var(--light-gray);
  opacity: 0.8;
}

.profile-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Add Funds Button */
.add-funds-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.btn-add-funds {
  background: linear-gradient(to right, var(--yellow), #e6a800);
  color: var(--dark-blue);
  border: none;
  border-radius: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-add-funds:hover {
  background: linear-gradient(to right, #e6a800, var(--yellow));
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
  color: var(--dark-blue);
}

/* Activity Container */
.activity-container {
  display: flex;
  flex-direction: column;
}

.activity-card {
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.activity-header {
  background: linear-gradient(135deg, var(--card-bg), var(--card-bg-darker));
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-title {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.activity-subtitle {
  color: var(--white);
  opacity: 0.8;
  font-size: 1rem;
  margin-bottom: 0;
}

.activity-body {
  padding: 1.5rem;
  flex-grow: 1;
  overflow: hidden;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom scrollbar for activity list */
.activity-list::-webkit-scrollbar {
  width: 6px;
}

.activity-list::-webkit-scrollbar-track {
  background: var(--card-bg-darker);
  border-radius: 3px;
}

.activity-list::-webkit-scrollbar-thumb {
  background: var(--bright-blue);
  border-radius: 3px;
}

.activity-list::-webkit-scrollbar-thumb:hover {
  background: var(--light-blue);
}

.activity-item {
  display: flex;
  justify-content: space-between;
  padding: 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
  background-color: rgba(46, 50, 145, 0.3);
}

.activity-item:hover {
  background-color: rgba(46, 50, 145, 0.5);
  transform: translateY(-2px);
}

.activity-details {
  flex-grow: 1;
}

.activity-type {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  font-size: 1.125rem;
}

.activity-type i {
  margin-right: 0.5rem;
}

.activity-meta {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  color: var(--white);
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.tournament-name {
  font-weight: 500;
  color: var(--light-blue);
}

.bet-details {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  color: var(--white);
  opacity: 0.9;
}

.bet-details strong {
  color: var(--yellow);
  font-weight: 600;
}

.activity-date {
  font-size: 0.75rem;
  color: var(--white);
  opacity: 0.6;
  margin-top: 0.5rem;
}

.activity-amount {
  font-weight: 700;
  font-size: 1.25rem;
  padding-left: 1rem;
}

.activity-amount.positive {
  color: var(--green);
}

.activity-amount.negative {
  color: var(--red);
}

/* Form Controls */
.form-label {
  color: var(--white);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control {
  background-color: var(--card-bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.form-control:focus {
  background-color: var(--card-bg-darker);
  border-color: var(--bright-blue);
  color: var(--white);
  box-shadow: 0 0 0 0.25rem rgba(79, 73, 224, 0.25);
}

/* Buttons */
.btn {
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-blue {
  background: linear-gradient(to right, var(--bright-blue), var(--light-blue));
  border: none;
  color: var(--white);
}

.btn-blue:hover {
  background: linear-gradient(to right, var(--light-blue), var(--bright-blue));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-yellow {
  background: linear-gradient(to right, var(--yellow), #e6a800);
  border: none;
  color: var(--dark-blue);
}

.btn-yellow:hover {
  background: linear-gradient(to right, #e6a800, var(--yellow));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

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

/* Spinner styles */
.spinner-border {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: text-bottom;
  border: 0.2em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .activity-list {
    max-height: 300px;
  }
}

@media (max-width: 576px) {
  .profile-header {
    padding: 1.5rem;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-avatar-container {
    width: 100px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .activity-list {
    max-height: 250px;
  }
}

/* Existing bet modal styles */
.existing-bet-modal {
  max-width: 500px;
}

.existing-bet-icon {
  font-size: 3rem;
  color: var(--yellow);
  margin: 1rem 0;
}

.existing-bet-info {
  text-align: left;
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-radius: 0.5rem;
  padding: 1rem !important;
  color: var(--white) !important;
}

.existing-bet-info p {
  margin-bottom: 0.5rem;
}

.existing-bet-info strong {
  color: var(--light-blue);
}
