/* ===== DelSNS メインスタイル（爽やかライトテーマ） ===== */
:root {
  --primary: #e91e8c;
  --primary-dark: #c2185b;
  --primary-light: #fce4ec;
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-hover: #f0f4ff;
  --border: #e4e8f0;
  --text: #1a1a2e;
  --text-muted: #8896ab;
  --text-link: #e91e8c;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --sidebar-width: 260px;
  --right-sidebar-width: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  min-height: 100vh;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; border-radius: 8px; }

/* ===== レイアウト ===== */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== サイドバー ===== */
.sidebar {
  width: var(--sidebar-width);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bg-card);
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  padding: 10px;
  margin-bottom: 8px;
}

.logo-icon { font-size: 28px; }
.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-links { list-style: none; flex: 1; }
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 50px;
  color: var(--text);
  font-size: 16px;
  transition: background 0.2s;
  text-decoration: none;
}
.nav-links li a:hover { background: var(--bg-hover); color: var(--primary); }
.nav-links li a i { font-size: 20px; width: 24px; text-align: center; }

.nav-links li a.post-btn {
  background: var(--primary);
  color: white;
  margin-top: 8px;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(233,30,140,0.3);
}
.nav-links li a.post-btn:hover { background: var(--primary-dark); color: white; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding-top: 16px;
}
.sidebar-user .user-info { display: flex; flex-direction: column; }
.sidebar-user .display-name { font-weight: bold; font-size: 14px; color: var(--text); }
.sidebar-user .username { font-size: 12px; color: var(--text-muted); }

/* ===== メインコンテンツ ===== */
.main-content {
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}

/* ===== 右サイドバー ===== */
.right-sidebar {
  width: var(--right-sidebar-width);
  padding: 16px;
  flex-shrink: 0;
}

.search-box {
  display: flex;
  margin-bottom: 20px;
}
.search-box form { display: flex; width: 100%; }
.search-box input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px 0 0 50px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-shadow: var(--shadow);
}
.search-box input:focus { border-color: var(--primary); }
.search-box button {
  background: var(--primary);
  border: none;
  border-radius: 0 50px 50px 0;
  padding: 10px 16px;
  color: white;
  cursor: pointer;
}

.right-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.right-section h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }

.suggested-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.suggested-user:last-child { border-bottom: none; }
.suggested-info { flex: 1; }
.suggested-info a { display: block; font-size: 13px; font-weight: bold; color: var(--text); }
.suggested-info span { font-size: 11px; color: var(--text-muted); }

.follow-btn-sm {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.follow-btn-sm:hover { background: var(--primary-dark); }
.follow-btn-sm.following {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

/* ===== アバター ===== */
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-md { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-xl { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid white; box-shadow: var(--shadow); }

/* ===== タブ ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.tab {
  flex: 1;
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab:hover { background: var(--bg-hover); color: var(--primary); }

/* ===== 投稿カード ===== */
.post-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  background: var(--bg-card);
}
.post-card:hover { background: #fdf5fb; }
.post-content { flex: 1; min-width: 0; }
.post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.post-header .display-name { font-weight: bold; font-size: 15px; color: var(--text); }
.post-header .username { color: var(--text-muted); font-size: 13px; }
.post-header .time { color: var(--text-muted); font-size: 12px; margin-left: auto; }

.post-text { font-size: 15px; line-height: 1.6; word-break: break-word; margin-bottom: 8px; color: var(--text); }
.post-link { color: #e91e8c; text-decoration: none; word-break: break-all; }
.post-link:hover { text-decoration: underline; }
.post-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }

.post-actions {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}
.post-action {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 50px;
  transition: all 0.2s;
}
.post-action:hover { color: var(--primary); background: var(--primary-light); }
.post-action.liked { color: var(--primary); }
.post-action i { font-size: 16px; }

/* ===== 投稿フォーム ===== */
.post-form {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.post-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  resize: none;
  outline: none;
  min-height: 80px;
  font-family: inherit;
}
.post-form textarea::placeholder { color: var(--text-muted); }
.post-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}
.post-form-actions { display: flex; gap: 8px; }
.post-form-actions label {
  color: var(--primary);
  cursor: pointer;
  font-size: 20px;
  padding: 6px;
  border-radius: 50%;
}
.post-form-actions label:hover { background: var(--primary-light); }
.btn-post {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 8px 20px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(233,30,140,0.25);
}
.btn-post:hover { background: var(--primary-dark); }
.btn-post:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== プロフィールページ ===== */
.profile-header { position: relative; margin-bottom: 60px; }
.profile-header-img { width: 100%; height: 200px; object-fit: cover; border-radius: 0; }
.profile-header-bg { width: 100%; height: 200px; background: linear-gradient(135deg, #ff6eb4, #e91e8c, #9c27b0); }
.profile-avatar-wrap { position: absolute; bottom: -50px; left: 16px; }
.profile-info { padding: 16px; }
.profile-name { font-size: 22px; font-weight: bold; margin-bottom: 2px; color: var(--text); }
.profile-username { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.profile-bio { font-size: 15px; line-height: 1.6; margin-bottom: 12px; color: var(--text); }
.profile-store {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); border: 1px solid #f8bbd0;
  border-radius: 50px; padding: 4px 12px; font-size: 13px;
  color: var(--primary); margin-bottom: 12px;
}
.profile-stats { display: flex; gap: 24px; font-size: 14px; }
.profile-stats span strong { color: var(--text); }
.profile-stats span { color: var(--text-muted); }
.profile-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ===== ボタン ===== */
.btn {
  padding: 8px 20px; border-radius: 50px; font-size: 14px;
  font-weight: bold; cursor: pointer; border: 2px solid transparent; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(233,30,140,0.25); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #e53935; color: white; border-color: #e53935; }

/* ===== 通知 ===== */
.notification-item {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
  background: var(--bg-card);
}
.notification-item:hover { background: #fdf5fb; }
.notification-item.unread { background: #fff0f7; border-left: 3px solid var(--primary); }
.notif-icon { font-size: 20px; width: 36px; text-align: center; }
.notif-content { font-size: 14px; line-height: 1.5; color: var(--text); }
.notif-time { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ===== DM ===== */
.dm-layout { display: flex; height: calc(100vh - 60px); }
.dm-list { width: 300px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; background: var(--bg-card); }
.dm-conversation { flex: 1; display: flex; flex-direction: column; background: var(--bg); }
.dm-item {
  display: flex; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.dm-item:hover, .dm-item.active { background: #fdf5fb; }
.dm-item-info { flex: 1; min-width: 0; }
.dm-item-name { font-weight: bold; font-size: 14px; color: var(--text); }
.dm-item-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.dm-msg { max-width: 70%; word-break: break-word; }
.dm-msg.mine { align-self: flex-end; }
.dm-msg.theirs { align-self: flex-start; }
.dm-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
.dm-msg.mine .dm-bubble { background: var(--primary); color: white; border-radius: 18px 18px 4px 18px; }
.dm-msg.theirs .dm-bubble { background: white; color: var(--text); border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow); }
.dm-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-align: right; }
.dm-input-area {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-end; background: white;
}
.dm-input-area textarea {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 10px 16px; color: var(--text);
  font-size: 14px; resize: none; outline: none; min-height: 42px;
  max-height: 120px; font-family: inherit;
}
.dm-input-area textarea:focus { border-color: var(--primary); }
.dm-send-btn {
  background: var(--primary); color: white; border: none;
  border-radius: 50%; width: 42px; height: 42px; font-size: 18px; cursor: pointer;
}

/* ===== ページヘッダー ===== */
.page-header {
  position: sticky; top: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 16px; z-index: 10;
}
.page-header h1 { font-size: 18px; font-weight: bold; color: var(--text); }
.back-btn { color: var(--text); font-size: 20px; cursor: pointer; background: none; border: none; }

/* ===== 管理画面 ===== */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  width: 220px; min-height: 100vh; background: white;
  border-right: 1px solid var(--border); padding: 16px; flex-shrink: 0;
}
.admin-content { flex: 1; padding: 24px; }
.admin-sidebar h2 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; margin-top: 20px; letter-spacing: 0.08em; }
.admin-sidebar ul { list-style: none; }
.admin-sidebar ul li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px; text-decoration: none; }
.admin-sidebar ul li a:hover, .admin-sidebar ul li a.active { background: var(--primary-light); color: var(--primary); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-card h3 { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.stat-card .stat-num { font-size: 32px; font-weight: bold; color: var(--primary); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table th { background: var(--bg); color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
table tr:hover td { background: #fdf5fb; }

/* ===== フォーム ===== */
.form-container {
  max-width: 500px; margin: 40px auto; padding: 36px;
  background: white; border-radius: 20px;
  border: 1px solid var(--border); box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.form-container h1 { font-size: 24px; margin-bottom: 6px; color: var(--text); }
.form-container .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; color: var(--text);
  font-size: 15px; outline: none; font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); background: white; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-submit {
  width: 100%; padding: 13px; background: var(--primary); color: white;
  border: none; border-radius: 50px; font-size: 16px; font-weight: bold;
  cursor: pointer; margin-top: 8px; box-shadow: 0 4px 14px rgba(233,30,140,0.3);
  transition: background 0.2s;
}
.form-submit:hover { background: var(--primary-dark); }
.form-footer { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fff5f5; color: #e53935; border: 1px solid #ffcdd2; }
.alert-success { background: #f1f8e9; color: #388e3c; border: 1px solid #c8e6c9; }

/* ===== ローディング・空 ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); background: var(--bg-card); }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; color: #ddd; }

/* ===== モバイルナビ ===== */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: white; border-top: 1px solid var(--border);
  padding: 8px 0; z-index: 100; justify-content: space-around;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.mobile-nav a { color: var(--text-muted); font-size: 20px; padding: 8px 10px; border-radius: 12px; }
.mobile-nav a:hover, .mobile-nav a.active { color: var(--primary); }

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) { .right-sidebar { display: none; } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main-content { padding-bottom: 70px; }
}

/* ===== バッジ ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 50px; font-size: 11px; font-weight: bold; }
.badge-cast { background: #fce4ec; color: #e91e8c; }
.badge-store { background: #fff3e0; color: #f57c00; }
.badge-admin { background: #fce4ec; color: #c62828; }

/* ===== 投稿削除ボタン ===== */
.post-delete-btn {
  background: none;
  border: 1px solid #fca5a5;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ef4444;
  background: #fff5f5;
  transition: all 0.15s;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.post-delete-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
