/* KempKidsPortal — Shared Styles */

:root {
  --primary: #2c3e50;
  --accent: #3498db;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --border: #dcdde1;
  --success: #27ae60;
  --warning: #f39c12;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
.portal-header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-header .greeting {
  font-size: 0.9rem;
  opacity: 0.85;
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.25); }

/* ─── Main Layout ─── */
.portal-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Section Grid ─── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ─── Cards ─── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.card-header .card-icon {
  font-size: 1.3rem;
}

.card-body {
  padding: 1.25rem;
}

.card-body.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1.25rem;
  font-style: italic;
}

/* ─── Messages ─── */
.message {
  padding: 1rem;
  border-left: 4px solid var(--accent);
  margin-bottom: 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg);
}
.message:last-child { margin-bottom: 0; }

.message .msg-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.message .msg-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.message .msg-body {
  font-size: 0.92rem;
  line-height: 1.5;
}

.message[data-type="encouragement"] { border-left-color: var(--success); }
.message[data-type="scripture"]     { border-left-color: #9b59b6; }
.message[data-type="fun"]           { border-left-color: #e67e22; }
.message[data-type="assignment"]    { border-left-color: var(--warning); }
.message[data-type="announcement"]  { border-left-color: var(--accent); }

/* ─── Resource List ─── */
.resource-list {
  list-style: none;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.resource-item:last-child { border-bottom: none; }

.resource-item .res-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.resource-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.resource-item a:hover { text-decoration: underline; }

.resource-item .res-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Games Grid ─── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, transform 0.15s;
}
.game-card:hover {
  background: var(--border);
  transform: scale(1.03);
}

.game-card .game-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.game-card .game-title {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── Customization Panel ─── */
.customize-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: flex-end;
}
.customize-overlay.open { display: flex; }

.customize-panel {
  background: var(--card-bg);
  width: min(380px, 90vw);
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.customize-panel h2 {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customize-group {
  margin-bottom: 1.25rem;
}

.customize-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.customize-group input[type="color"] {
  width: 48px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
}

.customize-group select,
.customize-group input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
}

.color-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.color-row .color-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.color-row .color-pick span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

/* ─── Footer ─── */
.portal-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .portal-header { padding: 0.75rem 1rem; }
  .portal-header h1 { font-size: 1.15rem; }
  .portal-main { padding: 1rem; }
  .section-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}
