/**
 * かんたんギター - 共通スタイル
 * すべてのページで使用する基本スタイル
 */

/* ========================================
   CSS Variables
======================================== */
:root {
  --primary: #53B3A7;
  --primary-light: #7DD3C8;
  --primary-dark: #3D9A8E;
  --accent: #7DD3C8;
  --bg: #F5FAFA;
  --card-bg: #fff;
  --text: #333;
  --text-light: #666;
  --shadow: 0 4px 12px rgba(83,179,167,0.15);
  --shadow-hover: 0 8px 24px rgba(83,179,167,0.25);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ========================================
   Base Styles
======================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: "Zen Maru Gothic", "M PLUS 1 Code", -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   Site Header (共通ヘッダー)
======================================== */
.site-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.site-header .header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header .header-logo {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.site-header .header-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.site-header .header-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-header .header-nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 20px;
  transition: background 0.2s;
  white-space: nowrap;
}

.site-header .header-nav-link:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}

.site-header .header-nav-link.active {
  background: rgba(255,255,255,0.25);
}

/* レガシーヘッダー（後方互換） */
.header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  padding: 20px;
  text-align: center;
}

.header-logo {
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

.header-logo:hover {
  text-decoration: none;
}

/* ========================================
   Site Footer (共通フッター)
======================================== */
.site-footer {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 32px 20px;
  margin-top: 60px;
}

.site-footer .footer-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.site-footer .footer-link {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.site-footer .footer-link:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer .footer-copy {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  margin: 0;
}

/* ========================================
   Hero Section
======================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  padding: 40px 20px 60px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  margin: 0;
}

/* ========================================
   Container
======================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-wide {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ========================================
   Cards
======================================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-elevated {
  margin-top: -30px;
  position: relative;
}

/* ========================================
   Buttons
======================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(83,179,167,0.3);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}

/* ========================================
   Badge
======================================== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-easy {
  background: linear-gradient(135deg, #a8e063, #56ab2f);
  color: #fff;
}

.badge-medium {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #fff;
}

.badge-hard {
  background: linear-gradient(135deg, #f5576c, #f093fb);
  color: #fff;
}

.badge-tag {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

/* ========================================
   Footer
======================================== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 32px 20px;
  margin-top: 60px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
}

.footer-link:hover {
  color: #fff;
  text-decoration: none;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ========================================
   Form Elements
======================================== */
input[type="text"],
input[type="email"],
textarea,
select {
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
  color: #aaa;
}

/* ========================================
   Loading & Empty States
======================================== */
.loading {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.empty-state-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ========================================
   Messages
======================================== */
.message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin: 12px 0;
}

.message-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.message-error {
  background: #ffebee;
  color: #c62828;
}

.message-info {
  background: #e3f2fd;
  color: #1565c0;
}

/* ========================================
   Utilities
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ========================================
   Responsive
======================================== */
@media (max-width: 600px) {
  /* Site Header レスポンシブ */
  .site-header {
    padding: 10px 12px;
  }
  
  .site-header .header-inner {
    flex-direction: column;
    gap: 10px;
  }
  
  .site-header .header-nav {
    justify-content: center;
    gap: 4px;
  }
  
  .site-header .header-nav-link {
    font-size: 12px;
    padding: 5px 8px;
  }
  
  /* Hero レスポンシブ */
  .hero h1 {
    font-size: 24px;
  }
  
  .hero p {
    font-size: 14px;
  }
  
  .container,
  .container-wide {
    padding: 0 12px;
  }
  
  /* Footer レスポンシブ */
  .site-footer {
    padding: 24px 16px;
    margin-top: 40px;
  }
  
  .site-footer .footer-links {
    gap: 8px 16px;
  }
  
  .site-footer .footer-link {
    font-size: 12px;
  }
  
  .footer-links {
    gap: 16px;
  }
}

/* ========================================
   Breadcrumb (パンくずリスト)
======================================== */
.breadcrumb {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 16px;
  font-size: 13px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.breadcrumb-item a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-item a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-light);
  margin: 0 2px;
}

.breadcrumb-current {
  color: var(--text-light);
}

/* ========================================
   Autoscroll Control (オートスクロール)
======================================== */
.autoscroll-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  font-family: "Zen Maru Gothic", sans-serif;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.autoscroll-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.autoscroll-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(83, 179, 167, 0.4);
}

.autoscroll-btn:active {
  transform: scale(0.95);
}

.autoscroll-btn.active {
  background: linear-gradient(135deg, #f5576c, #f093fb);
}

.autoscroll-btn.countdown {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.autoscroll-icon {
  font-size: 14px;
}

.autoscroll-settings {
  display: flex;
  align-items: center;
  gap: 6px;
}

.autoscroll-select {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}

.autoscroll-select:focus {
  outline: none;
  border-color: var(--primary);
}

.autoscroll-countdown {
  font-size: 18px;
  color: var(--primary-dark);
  font-weight: 700;
  min-width: 40px;
}

/* モバイル対応 */
@media (max-width: 600px) {
  .autoscroll-control {
    bottom: 16px;
    right: 16px;
    padding: 6px 10px;
    gap: 6px;
  }

  .autoscroll-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .autoscroll-select {
    padding: 4px 6px;
    font-size: 11px;
  }

  .autoscroll-countdown {
    font-size: 16px;
    min-width: 35px;
  }
}

