:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #f1f5f9;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --dark-color: #1e293b;
  --light-color: #f8fafc;
  --border-color: #e2e8f0;
  --text-color: #334155;
  --text-muted: #64748b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --border-radius: 12px;
  --border-radius-sm: 8px;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-color);
  line-height: 1.6;
}

/* ログイン画面スタイル */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 400px;
  width: 100%;
}

.login-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: 2rem;
  text-align: center;
}

.login-header h4 {
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
}

.login-body {
  padding: 2rem;
}

/* モダンなナビゲーション */
.modern-navbar {
  background: var(--dark-color) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.modern-navbar .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: white !important;
}

.modern-navbar .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.modern-navbar .nav-link:hover {
  color: white !important;
}

/* モダンなカード */
.modern-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.modern-card .card-header {
  background: var(--light-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.modern-card .card-body {
  padding: 1.5rem;
}

/* UX優先のボタン */
.btn-modern {
  padding: 12px 24px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  min-height: 44px;
  justify-content: center;
}

.btn-modern-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-modern-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: white;
  transform: none;
}

.btn-modern-primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-modern-secondary {
  background: white;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-modern-secondary:hover {
  background: var(--light-color);
  border-color: #94a3b8;
  color: var(--text-color);
  transform: none;
}

.btn-modern-secondary:active {
  transform: translateY(1px);
}

/* ボタンサイズバリエーション */
.btn-modern-sm {
  padding: 8px 16px;
  font-size: 13px;
  min-height: 36px;
}

.btn-modern-lg {
  padding: 16px 32px;
  font-size: 16px;
  min-height: 52px;
}

.btn-modern-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-modern-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-modern-info {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

/* UX優先のフォーム */
.modern-form-control {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.5;
  transition: all 0.2s ease;
  background: white;
  width: 100%;
  box-sizing: border-box;
}

.modern-form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  outline: none;
  transform: none;
}

.modern-form-control:hover {
  border-color: #94a3b8;
}

.modern-form-control::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.modern-form-label {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 6px;
  display: block;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

/* テキストエリア特別対応 */
textarea.modern-form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* モダンなテーブル */
.modern-table {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.modern-table table {
  border: none;
  margin-bottom: 0;
}

.modern-table thead th {
  background: var(--light-color);
  border: none;
  font-weight: 600;
  color: var(--text-color);
  padding: 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.modern-table tbody td {
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

.modern-table tbody tr:hover {
  background: var(--light-color);
}

/* テーブル内のバッジ */
.modern-table .badge {
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* ボタングループの調整 */
.modern-table .btn-group-sm .btn,
.modern-table .btn-sm {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.modern-table .d-flex.gap-1 {
  gap: 0.25rem !important;
}

/* モダンなバッジ */
.modern-badge {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
}

.modern-badge-youtube {
  background: #ff0000;
  color: white;
}

.modern-badge-upload {
  background: var(--primary-color);
  color: white;
}

/* モダンなアラート */
.modern-alert {
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.modern-alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-left: 4px solid var(--success-color);
}

.modern-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-left: 4px solid var(--danger-color);
}

/* モダンなモーダル */
.modern-modal .modal-content {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.modern-modal .modal-header {
  background: var(--light-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modern-modal .modal-title {
  font-weight: 600;
  color: var(--text-color);
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease;
}

/* UX改善されたスイッチ */
.modern-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  min-width: 52px;
}

.modern-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.modern-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.3s ease;
  border-radius: 28px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modern-switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.modern-switch:hover .modern-switch-slider {
  background-color: #9ca3af;
}

.modern-switch input:checked + .modern-switch-slider {
  background-color: var(--primary-color);
}

.modern-switch input:checked:hover + .modern-switch-slider {
  background-color: var(--primary-dark);
}

.modern-switch input:checked + .modern-switch-slider:before {
  transform: translateX(24px);
}

.modern-switch input:focus + .modern-switch-slider {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1),
    0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* スイッチのラベルコンテナ */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

/* 追加のUX改善スタイル */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  z-index: 2;
}

.modern-form-control.with-icon {
  padding-left: 40px;
}

/* ラジオボタン改善 */
.radio-group {
  display: flex;
  gap: 20px;
  margin: 12px 0;
}

.radio-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s ease;
  flex: 1;
}

.radio-item:hover {
  border-color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.05);
}

.radio-item input[type="radio"] {
  margin-right: 8px;
  accent-color: var(--primary-color);
}

.radio-item.selected {
  border-color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.1);
}

/* レスポンシブ */
@media (max-width: 768px) {
  .login-container {
    padding: 1rem;
  }

  .modern-card .card-body {
    padding: 1.25rem;
  }

  .btn-modern {
    padding: 12px 16px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }

  .btn-modern-sm {
    padding: 10px 14px;
    font-size: 13px;
  }

  .radio-group {
    flex-direction: column;
    gap: 12px;
  }

  .switch-container {
    padding: 16px 0;
  }

  .modern-form-control {
    font-size: 16px; /* iOS zoom prevention */
  }
}

/* カラー設定のレスポンシブスタイル */
.shadow-color-input,
.title-text-color-input {
  width: 150px;
  min-width: 120px;
}

/* モバイル対応: カラー設定 */
@media (max-width: 768px) {
  .shadow-color-container,
  .title-text-color-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .shadow-color-container .form-control-color,
  .title-text-color-container .form-control-color {
    width: 60px !important;
    height: 45px !important;
    align-self: flex-start;
  }

  .shadow-color-input,
  .title-text-color-input {
    width: 100% !important;
    margin-left: 0 !important;
  }
}
