/* 考査村 共通CSS */

/* ===== リセット・ベーススタイル ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
  color: #333;
  background: #f8f9fa;
}

/* ===== 共通変数 ===== */
:root {
  --primary-color: #0071e3;
  --primary-hover: #0051a3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --accent: #0071e3;
  --border-radius: 8px;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* ===== ヘッダー共通スタイル ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.header-title {
  display: flex;
  gap: 19px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0071e3;
  display: inline-block;
}

.site-subtitle {
  font-size: 0.9rem;
  color: #6e6e73;
}

/* ===== ナビゲーション共通スタイル ===== */
nav {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

nav li {
  margin: 0;
}

nav a {
  display: block;
  padding: 8px 16px;
  color: #1d1d20;
  text-decoration: none;
  border-bottom: 1px solid #ccc;
  transition: background 0.2s;
  flex-shrink: 0;
  font-size: 0.95rem;
  background: transparent;
}

nav a:hover {
  background: #e8ecf2;
}

nav a.active {
  background: #d0e4fd;
  border-bottom: 3px solid var(--accent);
}

/* ===== フリーモードステータス ===== */
.free-mode-status {
  min-width: 120px;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: 6px;
  margin-left: 24px;
  margin-right: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  box-sizing: border-box;
}

.free-mode-status.free {
  background: #00d084;
  color: #fff;
}

.free-mode-status.ad {
  background: #e0e0e0;
  color: #444;
}

/* ===== メインコンテンツ共通スタイル ===== */
main {
  max-width: 1200px;
  margin: 96px auto 0;
  padding: 2rem 20px;
  min-height: auto;
}

h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gray-800);
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 3rem;
  font-weight: bold;
  color: var(--gray-800);
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--gray-600);
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== カード共通スタイル ===== */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

/* ===== ボタン共通スタイル ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  justify-content: center;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

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

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

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

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

/* ===== フォーム共通スタイル ===== */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* ===== テーブル共通スタイル ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
}

tr:hover {
  background: var(--gray-50);
}

/* ===== ユーティリティクラス ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ===== レスポンシブ対応 ===== */
@media (max-width: 700px) {
  .header-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .site-title {
    font-size: 1.6rem;
  }
  
  .site-subtitle {
    font-size: 0.85rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 1.5%;
  }
  
  .header-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  
  nav a {
    font-size: 0.97rem;
    padding: 8px 8px;
    border-bottom: 1px solid #eee;
  }
  
  .site-title {
    font-size: 1.4rem;
  }
  
  .site-subtitle {
    font-size: 0.8rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
}

/* ===== アニメーション ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ===== ローディング ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--gray-300);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* ===== コピーライト ===== */
.copyright-note {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9rem;
  padding: 1rem 0;
  border-top: 1px solid var(--gray-200);
  margin-top: 0.5rem;
} 