/* =========================================
   COMPETITIVE PROGRAMMING SECTION STYLES
   ========================================= */

/* --- Main Dashboard Container --- */
.cp-dashboard {
  max-width: 1200px; /* Maximized width */
  margin: 20px auto; /* Reduced margin */
  display: flex;
  flex-direction: row;
  gap: 15px; /* Reduced gap */
  padding: 0; /* Minimal padding */
  align-items: stretch;
}

/* --- General Card Styles --- */
.cp-card {
  flex: 1;
  background-color: #1e1e1e;
  border-radius: 12px;
  padding: 15px; /* Compact padding */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.card-header {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.card-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
}

/* --- Problems Solved Section (Side-by-Side Layout) --- */
.problems-grid {
  display: flex;
  gap: 10px; /* Minimal gap */
  justify-content: space-between;
  height: 100%;
}

/* Individual Box Styles */
.problem-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px; /* Compact padding */
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, background 0.2s;
}

.problem-box:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 242, 255, 0.2);
}

.box-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Stats List Styling */
.stats-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px; /* Tight spacing */
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 0.85rem;
  color: #b0b0b0;
  font-weight: 500;
}

.stat-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

/* --- Contest Rankings Section --- */
.rankings-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  justify-content: space-around;
}

.stats-list.centered {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  /* max-width removed to fill container */
}

.ranking-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  width: 100%;
}

.ranking-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px 15px; /* Compact padding */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

.rating-line {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 8px;
  width: 100%;
  /* max-width removed to fill container */
  justify-content: center;
}

.rating-label {
  color: #a0a0a0;
  font-weight: 600;
  font-size: 0.85rem;
}

.rating-val {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.star-icon {
  color: #ffd700;
  font-size: 0.9rem;
}

.max-rating {
  font-size: 0.75rem;
  color: #666;
  margin-left: 5px;
}

/* --- Utility Classes --- */
.cyan-text { color: #00f2ff !important; }
.green-text { color: #00b894; }
.yellow-text { color: #fdcb6e; }
.red-text { color: #d63031; }

/* --- Responsive Design --- */
@media screen and (max-width: 900px) {
  .cp-dashboard {
    flex-direction: column;
    max-width: 700px;
  }
  
  .problems-grid {
    flex-direction: row;
  }
}

@media screen and (max-width: 600px) {
  .problems-grid {
    flex-direction: column;
  }
}

/* =========================================
   COMPETITIVE PROGRAMMING STYLES (Moved from style.css)
   ========================================= */

/* CP Section Container */
.cp-section {
  margin: 60px 0; /* Removed side margins to maximize width */
  position: relative;
  z-index: 1;
}

.cp-container {
  max-width: 100%;
}

/* Stats Overview Cards */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0 40px 0;
}

.stat-card {
  background: rgba(42, 42, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #3a3a3a;
  border-radius: 16px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: #00f2ff;
  box-shadow: 0 5px 20px rgba(0, 242, 255, 0.2);
}

.stat-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #00f2ff;
  margin-bottom: 5px;
}

.stat-label {
  color: #a0a0a0;
  font-size: 0.9rem;
  margin: 0;
}

/* Platform Cards Grid */
.platform-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  margin: 40px 0;
}

.platform-card {
  background: rgba(42, 42, 42, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  padding: 20px; /* Reduced padding */
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.platform-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00f2ff, #0099cc);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.platform-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 242, 255, 0.3);
  border-color: #00f2ff;
}

.platform-card:hover::before {
  opacity: 1;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.platform-icon {
  width: 40px;
  height: 40px;
  filter: invert(84%) sepia(22%) saturate(7247%) hue-rotate(154deg)
    brightness(107%) contrast(105%);
}

.platform-header h3 {
  font-size: 1.5rem;
  color: #e0e0e0;
  margin: 0;
}

.platform-stats {
  margin: 20px 0;
  text-align: center;
}

.stats-image {
  width: 100%;
  border-radius: 12px;
  background: #1e1e1e;
  padding: 10px;
}

/* Rating Circle for Codeforces */
.rating-circle {
  width: 150px;
  height: 150px;
  margin: 20px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2ff 0%, #0099cc 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0, 242, 255, 0.4);
}

.rating-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1e1e1e;
}

.rating-rank {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e1e1e;
  margin-top: 5px;
}

/* Stars Display for HackerRank */
.stars-display {
  font-size: 2.5rem;
  letter-spacing: 5px;
  margin: 20px 0;
  color: #ffd700;
}

.stars-label {
  color: #a0a0a0;
  font-size: 1rem;
  margin: 10px 0;
}

/* Platform Info Rows */
.platform-info {
  margin: 20px 0;
  padding: 15px;
  background: rgba(30, 30, 30, 0.5);
  border-radius: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(58, 58, 58, 0.5);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #a0a0a0;
  font-size: 0.9rem;
}

.info-value {
  color: #e0e0e0;
  font-weight: 600;
}

.rating-3star {
  color: #00f2ff;
}

/* Badges */
.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 242, 255, 0.1);
  color: #00f2ff;
  border: 1px solid rgba(0, 242, 255, 0.3);
}

.badge-easy {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.3);
}

.badge-medium {
  background: rgba(255, 187, 0, 0.1);
  color: #ffbb00;
  border-color: rgba(255, 187, 0, 0.3);
}

.badge-hard {
  background: rgba(255, 47, 47, 0.1);
  color: #ff2f2f;
  border-color: rgba(255, 47, 47, 0.3);
}

.badge-gold {
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.3);
}

.badge-silver {
  background: rgba(192, 192, 192, 0.1);
  color: #c0c0c0;
  border-color: rgba(192, 192, 192, 0.3);
}

/* Platform Link */
.platform-link {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: transparent;
  border: 2px solid #00f2ff;
  color: #00f2ff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.platform-link:hover {
  background: #00f2ff;
  color: #1e1e1e;
  transform: translateX(5px);
}

/* Skills Chart */
.skills-chart-container {
  margin: 50px 0;
  background: rgba(42, 42, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  padding: 30px;
}

.chart-heading {
  font-size: 1.5rem;
  color: #e0e0e0;
  margin-bottom: 25px;
  text-align: center;
}

.chart-wrapper {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Recent Activity Timeline */
.activity-section {
  margin: 50px 0;
  background: rgba(42, 42, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  padding: 30px;
}

.activity-timeline {
  position: relative;
  padding-left: 30px;
}

.activity-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #00f2ff, transparent);
}

.activity-item {
  position: relative;
  margin-bottom: 25px;
  padding-left: 25px;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: #00f2ff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.activity-date {
  color: #a0a0a0;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.activity-content p {
  color: #e0e0e0;
  margin: 5px 0 0 0;
}

.activity-platform {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.activity-platform.leetcode {
  background: rgba(255, 187, 0, 0.2);
  color: #ffbb00;
}

.activity-platform.codechef {
  background: rgba(150, 75, 0, 0.2);
  color: #ff9933;
}

.activity-platform.codeforces {
  background: rgba(47, 128, 237, 0.2);
  color: #2f80ed;
}

/* Problem Stats Progress Bars */
.problem-stats {
  margin: 50px 0;
  background: rgba(42, 42, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  padding: 30px;
}

.progress-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-item {
  width: 100%;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #e0e0e0;
  font-size: 0.95rem;
}

.progress-percent {
  color: #00f2ff;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2ff, #0099cc);
  border-radius: 10px;
  transition: width 1s ease;
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}
