/* ===== PomPom — Main Styles ===== */

:root {
  /* Dark mode (default) */
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface-light: #1f2b4d;
  --accent: #e94560;
  --accent-glow: rgba(233, 69, 96, 0.3);
  --secondary: #533483;
  --secondary-light: #6b44a8;
  --text: #eee;
  --text-dim: #888;
  --text-muted: #555;
  --border: #2f2f5a;
  --success: #2ecc71;
  --warning: #f39c12;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

[data-theme="light"] {
  --bg: #faf3e0;
  --surface: #fff;
  --surface-light: #f0e8d8;
  --accent: #e94560;
  --accent-glow: rgba(233, 69, 96, 0.15);
  --secondary: #7c4dff;
  --secondary-light: #9c7cff;
  --text: #333;
  --text-dim: #777;
  --text-muted: #aaa;
  --border: #e0d5c5;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Top Bar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.project-badge {
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}

.project-badge:active { transform: scale(0.95); }

.topbar-right { display: flex; gap: 8px; }

.icon-btn {
  background: var(--surface-light);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.icon-btn:active { background: var(--border); }

/* ===== Main Area ===== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  gap: 12px;
  overflow: hidden;
  min-height: 0;
}

/* ===== Note Section ===== */
.note-section {
  flex-shrink: 0;
  padding: 0 20px 8px;
}

.note-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.note-input:focus {
  border-color: var(--accent);
}

.note-input::placeholder { color: var(--text-muted); }

/* ===== Panels ===== */
.panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow);
  z-index: 100;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:not([hidden]) {
  transform: translateY(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.panel-header h2 { font-size: 15px; font-weight: 600; }

/* ===== Overlay ===== */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.panel-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .main-area {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }

  .timer-section {
    flex: 1 1 300px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .pom-section {
    flex: 0 0 256px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .logo { font-size: 14px; }
  .project-badge { font-size: 11px; padding: 3px 8px; }
  .icon-btn { width: 36px; height: 36px; font-size: 16px; }
}

/* Landscape-only enforcement */
@media (orientation: portrait) {
  body::after {
    content: '🐱 Please rotate to landscape';
    position: fixed;
    inset: 0;
    background: var(--bg);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 9999;
  }
  .topbar, .main-area, .note-section, .panel { display: none !important; }
}
