/* ========================================
   無料音楽サイト - メインスタイル
======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.15);
  --header-height: 80px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-light);
  line-height: 1.6;
  padding-top: var(--header-height);
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========================================
   固定ヘッダー
======================================== */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-color);
  box-shadow: var(--shadow);
  z-index: 1000;
  height: var(--header-height);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-container h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
}

.header-container h1 a {
  transition: opacity 0.3s;
}

.header-container h1 a:hover {
  opacity: 0.8;
}

/* ヘッダーボタングループ */
.header-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 言語メニュー */
.language-menu {
  position: relative;
}

.lang-btn {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.lang-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.language-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-color);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  min-width: 180px;
  overflow: hidden;
  animation: slideDown 0.3s ease;
  z-index: 1000;
}

.language-dropdown.show {
  display: block;
}

.language-dropdown a {
  display: block;
  padding: 14px 20px;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border-color);
}

.language-dropdown a:last-child {
  border-bottom: none;
}

.language-dropdown a:hover {
  background: var(--bg-light);
  padding-left: 30px;
  color: var(--secondary-color);
}

/* カテゴリメニュー */
.category-menu {
  position: relative;
}

.menu-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.menu-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.category-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-color);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  min-width: 220px;
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

.category-dropdown.show {
  display: block;
}

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

.category-dropdown a {
  display: block;
  padding: 14px 20px;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border-color);
}

.category-dropdown a:last-child {
  border-bottom: none;
}

.category-dropdown a:hover {
  background: var(--bg-light);
  padding-left: 30px;
  color: var(--primary-color);
}

/* ========================================
   コンテナ
======================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ========================================
   ヒーローセクション
======================================== */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 20px;
  margin-bottom: 60px;
  box-shadow: var(--shadow-hover);
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
}

/* ========================================
   カテゴリグリッド
======================================== */
.categories h3 {
  font-size: 2rem;
  margin-bottom: 32px;
  color: var(--text-color);
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.category-card {
  background: var(--bg-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.category-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.category-icon {
  font-size: 4rem;
}

.category-card h4 {
  padding: 20px 20px 8px;
  font-size: 1.3rem;
  color: var(--text-color);
  font-weight: 600;
}

.category-card p {
  padding: 0 20px 20px;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ========================================
   音楽グリッド
======================================== */
.music-container {
  padding-top: 20px;
}

.category-title {
  font-size: 2.2rem;
  margin-bottom: 40px;
  color: var(--text-color);
  font-weight: 700;
  text-align: center;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
  margin-bottom: 60px;
}

.music-card {
  background: var(--bg-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.music-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.music-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-light);
  position: relative;
  overflow: hidden;
}

.music-thumbnail iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.music-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-info {
  padding: 20px;
}

.music-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-color);
}

.music-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.music-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  background: var(--bg-light);
  color: var(--text-color);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.music-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-download {
  width: 100%;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s;
  font-size: 0.95rem;
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow);
}

.btn-download:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* エラー・空メッセージ */
.error,
.no-music {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 1.2rem;
}

/* ========================================
   フッター
======================================== */
footer {
  background: var(--text-color);
  color: white;
  text-align: center;
  padding: 32px 20px;
  margin-top: 80px;
}

footer p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ========================================
   レスポンシブデザイン
======================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .header-container h1 {
    font-size: 1.1rem;
  }

  .header-buttons {
    gap: 8px;
  }

  .menu-btn,
  .lang-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .categories h3,
  .category-title {
    font-size: 1.6rem;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .music-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .music-actions {
    flex-direction: column;
  }

  .btn-download,
  .btn-youtube {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 12px;
    flex-wrap: wrap;
  }

  .header-container h1 {
    font-size: 0.95rem;
    flex: 1 1 100%;
    margin-bottom: 8px;
    text-align: center;
  }

  .header-buttons {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .menu-btn,
  .lang-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.9rem;
  }
}
