/* ============================================================
   FB統計情報提供システム - スタイルシート
   ============================================================ */

/* --- リセット・基本設定 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Meiryo', sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* --- ユーティリティ --- */
.hidden {
  display: none !important;
}

/* --- ヘッダー --- */
.header {
  background: #232f3e;
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.header h1 {
  font-size: 18px;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  font-size: 14px;
  color: #adb5bd;
}

.btn-logout {
  background: #ff9900;
  color: #232f3e;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-logout:hover {
  background: #ec7211;
}

/* --- お知らせバナー --- */
.notification-banner {
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  padding: 12px 24px;
  text-align: center;
  font-size: 14px;
  color: #856404;
  line-height: 1.5;
}

.notification-banner.info {
  background: #d1ecf1;
  border-bottom-color: #bee5eb;
  color: #0c5460;
}

.notification-banner.warning {
  background: #fff3cd;
  border-bottom-color: #ffc107;
  color: #856404;
}

.notification-banner.error {
  background: #f8d7da;
  border-bottom-color: #f5c6cb;
  color: #721c24;
}

/* --- ログイン画面 --- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-box h2 {
  margin-bottom: 16px;
  color: #232f3e;
  font-size: 22px;
}

.login-box p {
  margin-bottom: 24px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.btn-login {
  background: #ff9900;
  color: #232f3e;
  border: none;
  padding: 12px 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.btn-login:hover {
  background: #ec7211;
}

/* --- ダッシュボード選択UI --- */
.dashboard-selector {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-selector label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.dashboard-selector select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  min-width: 300px;
  max-width: 500px;
  background: white;
  cursor: pointer;
}

.dashboard-selector select:focus {
  outline: none;
  border-color: #ff9900;
  box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

/* --- ダッシュボードコンテナ --- */
.dashboard-container {
  padding: 0;
  position: relative;
}

#dashboard-embed-container {
  width: 100%;
  height: calc(100vh - 56px);
}

/* ダッシュボード選択UI表示時の高さ調整 */
.dashboard-selector-visible #dashboard-embed-container {
  height: calc(100vh - 56px - 52px);
}

/* お知らせバナー表示時の高さ調整 */
.notification-visible #dashboard-embed-container {
  height: calc(100vh - 56px - 44px);
}

/* 両方表示時の高さ調整 */
.notification-visible.dashboard-selector-visible #dashboard-embed-container {
  height: calc(100vh - 56px - 44px - 52px);
}

/* --- ローディング・エラー表示 --- */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.loading::after {
  content: '';
  display: block;
  margin: 16px auto 0;
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #ff9900;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  text-align: center;
  padding: 40px;
  color: #d32f2f;
  font-size: 16px;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 768px) {
  .header {
    padding: 10px 16px;
  }

  .header h1 {
    font-size: 16px;
  }

  .header-right {
    gap: 8px;
  }

  .user-info {
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-logout {
    padding: 6px 12px;
    font-size: 12px;
  }

  .dashboard-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 16px;
  }

  .dashboard-selector select {
    min-width: 100%;
    max-width: 100%;
  }

  .login-box {
    padding: 24px;
  }
}
