/* Improved style.css - LINE入退クラウド UI Enhancement */

:root {
  /* 基本カラーパレット */
  --primary-color: #84c0d9;
  --primary-light: #a5d4e7;
  --primary-dark: #6aa8c4;
  --secondary-color: #f8bba6;
  --secondary-light: #ffd4c4;
  --secondary-dark: #e6a694;
  
  /* グレースケール */
  --white: #ffffff;
  --light-gray: #f8fcff;
  --medium-gray: #e2e8f0;
  --dark-gray: #64748b;
  --text-primary: #2c3e50;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* グラデーション */
  --bg-gradient: linear-gradient(135deg, #f8fcff 0%, rgba(132, 192, 217, 0.05) 100%);
  --header-gradient: linear-gradient(90deg, #84c0d9 0%, #6aa8c4 100%);
  --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 252, 255, 0.95) 100%);
  --button-gradient: linear-gradient(135deg, #84c0d9 0%, #6aa8c4 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  
  /* シャドウ */
  --card-shadow: 0 6px 15px rgba(132, 192, 217, 0.12);
  --button-shadow: 0 4px 8px rgba(132, 192, 217, 0.2);
  --hover-shadow: 0 8px 25px rgba(132, 192, 217, 0.15);
  
  /* ボーダー */
  --border-color: #e2e8f0;
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --border-radius-lg: 24px;
}

/* 基本設定 */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

/* 背景装飾要素 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(248, 187, 166, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(132, 192, 217, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(248, 187, 166, 0.08) 0%, transparent 30%);
  pointer-events: none;
  z-index: -1;
}

/* ナビゲーションバー */
.navbar {
  background: var(--header-gradient);
  box-shadow: 0 4px 20px rgba(132, 192, 217, 0.15);
  backdrop-filter: blur(10px);
  border: none;
  padding: 1rem 0;
  position: relative;
  z-index: 1000;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
}

.navbar-brand {
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: translateY(-1px);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  padding: 0.75rem 1rem !important;
  border-radius: var(--border-radius-sm);
  transition: all 0.3s ease;
  position: relative;
  margin: 0 0.25rem;
}

.nav-link:hover {
  color: var(--white) !important;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--white) !important;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-sm);
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=UTF8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2.5' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* カード */
.card {
  background: var(--card-gradient);
  border: 1px solid rgba(226, 232, 240, 0.3);
  box-shadow: var(--card-shadow);
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

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

.card-header {
  background: linear-gradient(135deg, rgba(132, 192, 217, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-bottom: 1px solid rgba(132, 192, 217, 0.15);
  padding: 1.5rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
}

.card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(132, 192, 217, 0.3) 50%, transparent 100%);
}

.card-title {
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
  font-size: 1.25rem;
}

.card-body {
  padding: 2rem;
}

/* ボタン */
.btn {
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--button-shadow);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--button-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(132, 192, 217, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
  color: var(--white);
}

.btn-success {
  background: var(--success-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: var(--danger-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: var(--warning-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: none;
}

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

.btn-outline-secondary {
  background: transparent;
  color: var(--dark-gray);
  border: 2px solid var(--medium-gray);
  box-shadow: none;
}

.btn-outline-danger {
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
  box-shadow: none;
}

.btn-outline-danger:hover {
  background: #ef4444;
  color: var(--white);
  border-color: #ef4444;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: 12px;
}

/* フォーム */
.form-control {
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(132, 192, 217, 0.15);
  outline: none;
}

.form-control-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

.form-select {
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background: var(--white);
  color: var(--text-primary);
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(132, 192, 217, 0.15);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-group {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* テーブル */
.table {
  background: var(--white);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
}

.table th {
  background: linear-gradient(135deg, var(--light-gray) 0%, rgba(132, 192, 217, 0.05) 100%);
  border: none;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 1rem;
  font-size: 0.875rem;
}

.table td {
  padding: 0.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: rgba(132, 192, 217, 0.02);
}

.table-responsive {
  border-radius: var(--border-radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* バッジ */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge.bg-success {
  background: var(--success-gradient) !important;
}

.badge.bg-danger {
  background: var(--danger-gradient) !important;
}

.badge.bg-warning {
  background: var(--warning-gradient) !important;
}

.badge.bg-primary {
  background: var(--button-gradient) !important;
}

.badge.bg-secondary {
  background: linear-gradient(135deg, var(--dark-gray) 0%, var(--text-muted) 100%) !important;
}

/* アラート */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: #059669;
}

.alert-success::before {
  background: #10b981;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  color: #dc2626;
}

.alert-danger::before {
  background: #ef4444;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  color: #d97706;
}

.alert-warning::before {
  background: #f59e0b;
}

.alert-info {
  background: linear-gradient(135deg, rgba(132, 192, 217, 0.1) 0%, rgba(132, 192, 217, 0.05) 100%);
  color: var(--primary-dark);
}

.alert-info::before {
  background: var(--primary-color);
}

/* ステータス表示 */
.status-success {
  color: #059669;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.status-error {
  color: #dc2626;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.status-warning {
  color: #d97706;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.status-waiting {
  color: var(--primary-dark);
  background: linear-gradient(135deg, rgba(132, 192, 217, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 2rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 4px 12px rgba(132, 192, 217, 0.15);
}

/* コンテナ */
.container {
  padding: 0 1rem;
}

#status-container {
  margin-bottom: 2rem;
  min-height: 80px;
  position: relative;
  overflow: hidden;
}

#status-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
}

/* QRコード関連 */
#scan-area {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  border: 4px solid var(--medium-gray);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all 0.3s ease;
  background: var(--light-gray);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

#scan-area.success {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

#scan-area.error {
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

#qr-video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: calc(var(--border-radius) - 4px);
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* フッター */
.footer {
  background: linear-gradient(135deg, var(--light-gray) 0%, rgba(132, 192, 217, 0.03) 100%);
  border-top: 1px solid rgba(132, 192, 217, 0.15);
  padding: 2rem 0;
  margin-top: auto;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(132, 192, 217, 0.3) 50%, transparent 100%);
}

/* ページネーション */
.pagination .page-link {
  border: 2px solid var(--medium-gray);
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  margin: 0 0.25rem;
  border-radius: var(--border-radius-sm);
  background: var(--white);
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(132, 192, 217, 0.2);
}

.pagination .page-item.active .page-link {
  background: var(--button-gradient);
  border-color: var(--primary-color);
  color: var(--white);
  box-shadow: 0 4px 8px rgba(132, 192, 217, 0.2);
}

/* モーダル */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  background: var(--card-gradient);
}

.modal-header {
  border-bottom: 1px solid rgba(132, 192, 217, 0.15);
  background: linear-gradient(135deg, rgba(132, 192, 217, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
  border-top: 1px solid rgba(132, 192, 217, 0.15);
  background: rgba(248, 252, 255, 0.5);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* セクション見出し */
.section-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(132, 192, 217, 0.2);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--primary-color);
}

/* テキストスタイル */
.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

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

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

/* モバイル対応 */
@media (max-width: 1400px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    max-width: 95%;
  }
}

@media (max-width: 1200px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl {
    max-width: 95%;
  }
}

@media (max-width: 900px) {
  .container, .container-sm {
    max-width: 95%;
    padding: 0 0.75rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .card-header {
    padding: 1.25rem;
  }
  
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  .input-group {
    flex-wrap: nowrap;
  }
  
  .btn-group-sm > .btn, .btn-sm {
    width: 17vw;
    min-width: 80px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .form-control-sm {
    width: 35vw !important;
    min-width: 120px;
  }
  
  .table th, .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  .tdsmall {
    max-width: 100px;
    font-size: 0.8rem;
  }
  
  .control-buttons {
    gap: 0.5rem;
  }
  
  .control-buttons .btn {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 1rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .btn-sm {
    width: auto;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .control-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .control-buttons .btn {
    width: 100%;
    max-width: 200px;
  }
}

/* 特定ページ用スタイル */
.tdsmall {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-section {
  margin-bottom: 2rem;
}

.qr-container {
  text-align: center;
  padding: 2rem;
}

.qr-image {
  max-width: 300px;
  margin: 0 auto;
  display: block;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow);
}

.qr-info {
  margin-top: 1rem;
  font-size: 1.125rem;
}

/* 印刷対応 */
@media print {
  body * {
    visibility: hidden;
  }
  .qr-container, .qr-container * {
    visibility: visible;
  }
  .qr-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .no-print {
    display: none !important;
  }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* フォーカス時のアクセシビリティ */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn:focus, .form-control:focus, .form-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(132, 192, 217, 0.25);
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0066cc;
    --text-primary: #000000;
    --text-secondary: #333333;
  }
}