/* リセットとベーススタイル */
* {
  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.5;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ヘッダー */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 16px;
}

.logo a {
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: #f1f5f9;
}

.icon-button i {
  font-size: 1.25rem;
  color: #64748b;
}

/* ドロップダウンメニュー */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 8px 0;
  margin-top: 8px;
  display: none;
  z-index: 20;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 8px 16px;
  font-weight: 600;
  color: #64748b;
}

.dropdown-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 8px 0;
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f1f5f9;
}

/* メインコンテンツ */
.main {
  flex: 1;
  padding: 16px;
}

@media (min-width: 768px) {
  .main {
    padding: 32px;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.refresh-button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
}

.refresh-button i {
  font-size: 0.875rem;
}

.refresh-button.refreshing i {
  animation: spin 1s linear infinite;
}

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

.page-header h1 {
  font-size: 1.5rem;
  font-weight: bold;
}

.operation-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* バッジ */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0 10px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background-color: #22c55e;
  color: white;
}

.badge-danger {
  background-color: #ef4444;
  color: white;
}

/* トグルスイッチ */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch input {
  display: none;
}

.toggle-switch label {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  transition: all 0.3s;
  cursor: pointer;
}

.toggle-switch label::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: all 0.3s;
}

.toggle-switch input:checked + label {
  background-color: #22c55e;
}

.toggle-switch input:checked + label::after {
  left: 22px;
}

.toggle-label {
  font-size: 0.875rem;
}

/* 統計情報グリッド */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* カード */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-header h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  margin: 0;
}

.card-header p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

.card-header i {
  color: #94a3b8;
  font-size: 1rem;
}

.card-content {
  padding: 16px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-description {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* タブ */
.tabs {
  margin-top: 24px;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.tab-button {
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: #64748b;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-button.active {
  color: #0f172a;
  border-bottom-color: #3b82f6;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* カードグリッド */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ボタン */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.button-primary {
  background-color: #3b82f6;
  color: white;
}

.button-primary:hover {
  background-color: #2563eb;
}

.button-primary:disabled {
  background-color: #93c5fd;
  cursor: not-allowed;
}

.button-outline {
  background-color: transparent;
  border-color: #e2e8f0;
  color: #64748b;
}

.button-outline:hover {
  background-color: #f8fafc;
}

.full-width {
  width: 100%;
}

/* ファイルアップロード */
.file-upload {
  margin-top: 16px;
}

.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 128px;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 16px;
}

.file-upload-area:hover {
  background-color: #f8fafc;
}

.file-upload-area i {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.file-upload-area p {
  color: #64748b;
  text-align: center;
  margin: 4px 0;
}

.file-upload-area p.small {
  font-size: 0.75rem;
}

.file-name {
  font-size: 0.875rem;
  color: #64748b;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
  margin: 16px 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background-color: #e2e8f0;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

/* プラン情報 */
.plan-info {
  margin-bottom: 16px;
}

.plan-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.plan-value {
  font-weight: 500;
}

/* フォロー制限情報 */
.follow-limit-info {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.follow-limit-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.follow-limit-value {
  font-weight: 600;
  color: #3b82f6;
}

.follow-limit-note {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: right;
  margin-top: 4px;
}

/* 空の状態 */
.empty-state {
  padding: 32px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.full-width {
  width: 100%;
}
