/* スマホ専用スタイル - Studio kulam 出席管理システム */

:root {
  --primary-color: #4a90e2;
  --secondary-color: #50c878;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --text-color: #333;
  --bg-color: #f5f7fa;
  --white: #ffffff;
  --border-color: #e1e8ed;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo,
    sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 100%;
  padding: 20px;
  min-height: 100vh;
}

/* ログインページ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
}

.login-box {
  background: var(--white);
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo h1 {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.logo p {
  font-size: 14px;
  color: #666;
}

/* フォーム */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:active {
  background-color: #3a7bc8;
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:active {
  background-color: #40b868;
  transform: scale(0.98);
}

.btn-danger {
  background-color: var(--danger-color);
  color: var(--white);
}

.btn-danger:active {
  background-color: #c0392b;
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
  display: block;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ヘッダー */
.header {
  background: var(--white);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 20px;
  color: var(--primary-color);
}

.header .user-info {
  font-size: 14px;
  color: #666;
}

/* カード */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

/* レッスンリスト */
.lesson-list {
  list-style: none;
}

.lesson-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.lesson-item:last-child {
  border-bottom: none;
}

.lesson-item:active {
  background-color: #f8f9fa;
}

.lesson-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
}

.lesson-info {
  font-size: 14px;
  color: #666;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lesson-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 生徒リスト */
.student-list {
  list-style: none;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.student-item:last-child {
  border-bottom: none;
}

.student-name {
  font-size: 16px;
  font-weight: 500;
}

.student-item.attended {
  background-color: #e8f5e9;
}

/* チケット選択 */
.ticket-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.ticket-option {
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.ticket-option:active {
  transform: scale(0.95);
}

.ticket-option.selected {
  border-color: var(--primary-color);
  background-color: #e3f2fd;
  color: var(--primary-color);
}

/* メッセージ */
.error-message {
  background-color: #ffebee;
  color: var(--danger-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.success-message {
  background-color: #e8f5e9;
  color: var(--secondary-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

/* ローディング */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* バッジ */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background-color: #e3f2fd;
  color: var(--primary-color);
}

.badge-success {
  background-color: #e8f5e9;
  color: var(--secondary-color);
}

.badge-warning {
  background-color: #fff3e0;
  color: var(--warning-color);
}

/* ユーティリティ */
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.mb-3 {
  margin-bottom: 24px;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

/* レスポンシブ調整 */
@media (min-width: 768px) {
  .container {
    max-width: 768px;
    margin: 0 auto;
  }
}

/* クリック可能な生徒アイテム */
.student-item.clickable {
  transition: background-color 0.2s;
}

.student-item.clickable:hover {
  background-color: #f0f7ff;
}

.student-item.clickable:active {
  background-color: #e3f2fd;
}

/* =========================================
   管理者ページ用スタイル (PC対応)
   ========================================= */

/* 管理者ページのコンテナ幅を拡張 */
.admin-page .admin-container {
  max-width: 1200px;
}

/* 統計情報のグリッド */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  background: #f8f9fa;
  transition: transform 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* 統計カードの色分け */
.stat-item.blue { background: #e3f2fd; color: #1565c0; }
.stat-item.blue .stat-value { color: #1565c0; }

.stat-item.green { background: #e8f5e9; color: #2e7d32; }
.stat-item.green .stat-value { color: #2e7d32; }

.stat-item.orange { background: #fff3e0; color: #ef6c00; }
.stat-item.orange .stat-value { color: #ef6c00; }

.stat-item.pink { background: #fce4ec; color: #c2185b; }
.stat-item.pink .stat-value { color: #c2185b; }

/* PC向けレイアウト (768px以上) */
@media (min-width: 768px) {
  .admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
  }

  .admin-sidebar {
    position: sticky;
    top: 80px;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ボタンのスタイル調整 */
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

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

.text-left {
  text-align: left;
}
