/* Hide controls button */

.hide-controls {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}

.controls.hidden,
.custom.hidden {
  display: none !important;
}

/* Floating fullscreen button */
.floating-fullscreen {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 120ms, box-shadow 120ms;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-fullscreen:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.floating-fullscreen.hidden {
  display: none !important;
}

/* Light theme (default) */
:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --muted: #6c757d;
  --accent: #00bcd4;
  --tile-bg: #f8f9fa;
  --tile-hover: #e9ecef;
  --text: #212529;
  --border: rgba(0,0,0,0.1);
}

/* Dark theme */
body.dark {
  --bg: #0b0b0b;
  --panel: #111;
  --muted: #9aa0a6;
  --accent: #00bcd4;
  --tile-bg: #151515;
  --tile-hover: #1f1f1f;
  --text: #e9eef1;
  --border: rgba(255,255,255,0.03);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;color:var(--text);background:var(--bg);}
.topbar{height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;background:linear-gradient(0deg, var(--border), transparent);border-bottom:1px solid var(--border)}
.brand{font-weight:600}
.controls{display:flex;gap:8px;align-items:center}
.controls input{min-width:220px;padding:8px;border-radius:8px;border:1px solid var(--border);background:var(--bg);color:var(--text)}
.controls button{background:transparent;border:1px solid var(--border);color:var(--text);padding:8px;border-radius:8px;cursor:pointer;transition:background 120ms}
.controls button:hover{background:var(--tile-hover)}

main{padding:16px}
.hero{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.hero-left h1{margin:0;font-size:20px}
.lead{color:var(--muted);margin:4px 0 0}
.hero-right{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.primary{background:var(--accent);color:#000;border:none;padding:12px 18px;border-radius:8px;font-weight:600}
.custom{display:flex;gap:8px}
.custom input{padding:8px;border-radius:8px;border:1px solid var(--border);background:var(--bg);color:var(--text);min-width:260px}

.categories{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.categories button{background:transparent;border:1px solid var(--border);padding:8px 12px;border-radius:16px;color:var(--text);cursor:pointer;transition:background 120ms}
.categories button:hover{background:var(--tile-hover)}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px}
.tile{background:var(--tile-bg);min-height:120px;border-radius:12px;padding:12px;display:flex;align-items:flex-start;gap:10px;cursor:pointer;transition:background 120ms, transform 120ms;position:relative}
.tile:hover{background:var(--tile-hover);transform:translateY(-3px)}
.icon{width:48px;height:48px;flex-shrink:0;object-fit:contain;border-radius:8px;background:var(--tile-bg);border:1px solid var(--border)}

/* Initials display when no icon is available */
.tile.no-icon::before {
  content: attr(data-initials);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #0080a6);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  border-radius: 8px;
  flex-shrink: 0;
}

.meta{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}
.title{font-weight:600;word-wrap:break-word;overflow-wrap:break-word;line-height:1.3;font-size:14px}
.desc{font-size:11px;color:var(--muted);margin-top:4px;word-wrap:break-word;overflow-wrap:break-word;line-height:1.3;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.fav{position:absolute;right:8px;top:8px;color:#ffb400;opacity:0.0;transition:opacity 120ms}
.tile.favorited .fav{opacity:1}

.admin{position:fixed;right:12px;top:72px;width:560px;max-width:calc(100% - 24px);height:70vh;background:var(--panel);border-radius:12px;padding:12px;box-shadow:0 8px 30px rgba(0,0,0,0.6);z-index:50}
.admin.hidden{display:none}
.admin textarea{width:100%;height:58%;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px}
.admin-actions{display:flex;gap:8px;align-items:center;margin-top:8px}

@media (max-width:800px){
  .hero{flex-direction:column;align-items:flex-start}
  .controls input{min-width:140px}
  .custom input{min-width:160px}
}
