/* 新ランキングページスタイル */
:root {
  --primary-color: #67f2e2;
  --primary-color-rgb: 103, 242, 226;
  --secondary-color: #ff7b54;
  --secondary-color-rgb: 255, 123, 84;
  --text-color: #1a2a36;
  --text-light: #ffffff;
  --card-bg: #ffffff;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  --medal-gold: #FFD700;
  --medal-gold-rgb: 255, 215, 0;
  --medal-silver: #C0C0C0;
  --medal-silver-rgb: 192, 192, 192;
  --medal-bronze: #CD7F32;
  --medal-bronze-rgb: 205, 127, 50;
}

/* ランキングページ全体のスタイル */
.ranking-page {
  background-color: #f8f9fa;
  padding-bottom: 40px;
}

/* ランキングのメインタイトル */
.ranking-hero {
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.9), rgba(var(--secondary-color-rgb), 0.7));
  padding: 30px 20px;
  text-align: center;
  color: var(--text-light);
  border-radius: 0 0 20px 20px;
  margin-bottom: 30px;
  box-shadow: var(--card-shadow);
}

.ranking-hero h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0 0 10px 0;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ranking-hero p {
  font-size: 1rem;
  margin: 0;
  opacity: 0.9;
}

/* ランキングタブのスタイル強化 */
.ranking-tabs {
  display: flex;
  justify-content: center;
  margin: 0 auto 25px;
  gap: 15px;
  width: 90%;
  max-width: 500px;
  padding: 0 15px;
}

.ranking-tab {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  flex: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.ranking-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  opacity: 0;
  z-index: -1;
  transform: scale(0.9);
  transition: all 0.3s ease;
  border-radius: 30px;
}

.ranking-tab:hover::before {
  opacity: 0.3;
  transform: scale(1);
}

.ranking-tab.active {
  background-color: var(--primary-color);
  color: var(--text-color);
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.4);
  transform: translateY(-2px);
}

/* ランキングカードのスタイル */
.ranking-card {
  background-color: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  transition: transform 0.3s ease;
}

.ranking-card:hover {
  transform: translateY(-5px);
}

.ranking-header {
  background: linear-gradient(to right, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0.05));
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(var(--primary-color-rgb), 0.3);
}

.ranking-header h3 {
  margin: 0;
  color: var(--text-color);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

.ranking-date {
  font-size: 1rem;
  color: #666;
  margin: 0;
  font-weight: 500;
  background-color: rgba(var(--primary-color-rgb), 0.1);
  padding: 5px 12px;
  border-radius: 20px;
}

/* ランキングリストのスタイル強化 */
.ranking-list {
  padding: 20px;
  counter-reset: ranking;
  list-style-type: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  padding: 15px;
  margin-bottom: 12px;
  border-radius: 15px;
  background-color: #f9f9f9;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.ranking-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  background-color: #f5f9ff;
}

.ranking-item:last-child {
  margin-bottom: 0;
}

/* 順位表示のスタイル */
.ranking-position {
  font-weight: 900;
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: #f0f0f0;
  color: #888;
  margin-right: 15px;
}

/* トップ3のメダルスタイル */
.ranking-item.rank-1 .ranking-position {
  background: linear-gradient(135deg, var(--medal-gold), #fff6cc);
  color: #8a7000;
  box-shadow: 0 4px 10px rgba(var(--medal-gold-rgb), 0.5);
}

.ranking-item.rank-2 .ranking-position {
  background: linear-gradient(135deg, var(--medal-silver), #f1f1f1);
  color: #707070;
  box-shadow: 0 4px 10px rgba(var(--medal-silver-rgb), 0.5);
}

.ranking-item.rank-3 .ranking-position {
  background: linear-gradient(135deg, var(--medal-bronze), #e0c0a8);
  color: #7d4b21;
  box-shadow: 0 4px 10px rgba(var(--medal-bronze-rgb), 0.5);
}

/* ユーザー情報 */
.ranking-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name {
  font-weight: 700;
  color: var(--text-color);
  font-size: 1.1rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 20px);
}

.user-level {
  font-size: 0.8rem;
  color: #666;
}

/* スクワットカウント表示 */
.squats-count {
  font-weight: 900;
  color: var(--text-color);
  background-color: rgba(var(--primary-color-rgb), 0.2);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.squats-count::after {
  content: "回";
  font-size: 0.85rem;
  margin-left: 4px;
  opacity: 0.8;
}

/* 現在ユーザーのランキング表示 */
.ranking-item.current-user {
  background-color: rgba(var(--primary-color-rgb), 0.15);
  border: 2px solid var(--primary-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0);
  }
}

/* ログインプロンプトのスタイル改善 */
.login-prompt {
  text-align: center;
  padding: 40px 20px;
  background-color: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  max-width: 500px;
  margin: 0 auto;
}

.login-prompt h3 {
  color: var(--text-color);
  margin-bottom: 20px;
  font-size: 1.6rem;
  font-weight: 700;
}

.login-prompt p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: #555;
}

.login-prompt .action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.login-action {
  background-color: var(--primary-color);
  color: var(--text-color);
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.login-action:hover {
  background-color: #50d8c8;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(var(--primary-color-rgb), 0.3);
}

.register-action {
  background-color: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.register-action:hover {
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .ranking-hero h2 {
    font-size: 1.8rem;
  }
  
  .ranking-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ranking-date {
    margin-top: 10px;
  }
  
  .ranking-item {
    grid-template-columns: 40px 1fr auto;
    padding: 12px 10px;
  }
  
  .squats-count {
    font-size: 1rem;
    padding: 6px 12px;
  }
}

/* アニメーションスタイル */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
