/* ==========================================================================
   BookTrack - Design Tokens (Baseado na estética Krumer)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Cores Globais */
  --accent:       #f97316;  /* Laranja */
  --accent-text:  #ff9041;
  --accent-hover: #ea6a0a;
  --accent-glow:  rgba(249, 115, 22, 0.25);
  
  /* Raios de borda */
  --radius-sm:    4px;
  --radius:       8px;
  --radius-md:    12px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  
  /* Tipografia */
  --font-main:    'Inter', system-ui, -apple-system, sans-serif;
  
  /* Sombras */
  --shadow-main:  0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-card:  0 4px 12px rgba(0, 0, 0, 0.4);
  
  /* Transições */
  --transition:   all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout Sidebar */
  --sidebar-width-collapsed: 64px;
  --sidebar-width-expanded:  260px;
  --sidebar-active-bg:       rgba(232, 124, 42, 0.10);
  --sidebar-active-bar:      #e87c2a;
  --sidebar-active-text:     rgba(232, 124, 42, 0.90);
  
  /* Layout Grid (Library) */
  --cover-aspect-ratio: 3 / 4;
  --grid-min-card-width: 160px;
  --grid-gap: 24px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TEMA DARK (Padrão)
   ============================================================ */
html, html[data-theme="dark"] {
  --bg-primary:    #111111;
  --bg-secondary:  #161616;
  --bg-sidebar:    #181818;
  --bg-card:       #202020;
  --bg-card-hover: #262626;
  --bg-modal:      #1e1e1e;

  --text-primary:   #f1f1f1;
  --text-secondary: #cccccc;
  --text-muted:     #888888;

  --border:       #2e2e2e;
  --border-light: #3a3a3a;
  
  --sidebar-bg:         #1c1c1e;
  --sidebar-border:     rgba(255, 255, 255, 0.06);
  --sidebar-text:       rgba(255, 255, 255, 0.50);
  --sidebar-text-hover: rgba(255, 255, 255, 0.90);
  --sidebar-section:    rgba(255, 255, 255, 0.50);
}

/* App Root */
#app-root {
  display: flex;
  flex: 1;
  height: 100vh;
  overflow: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Modals Globally */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 1.2rem; cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

/* Forms Globally */
.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-group input, .form-group select, .form-group textarea {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-md);
    font-family: inherit;
}
.btn-save {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: var(--transition);
}
.btn-save:hover { background: var(--accent-hover); }

/* Primary Button */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 10px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px var(--accent-glow);
}
