:root {
  --bg-primary: #0f141a;
  --bg-secondary: #1a2230;
  --text: #e0e0e0;
  --text-secondary: #a0a8c0;
  --accent: #8ab4f8;
  --border: #3a5080;
  --card-bg: rgba(26, 35, 55, 0.7);
  --card-border: rgba(70, 90, 130, 0.3);
}

.light-mode {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --text: #2d3243;
  --text-secondary: #5a647a;
  --accent: #5a75c5;
  --border: #d0d6f9;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: #e0e6ff;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.8;
  background-image: url('https://images.unsplash.com/photo-1560909528-134544207282?q=80&fm=jpg&w=1600&h=900&fit=crop');
  background-size: cover;
  background-attachment: fixed;
  background-position: center top;
  min-height: 100vh;
  position: relative;
  transition: filter 0.5s ease;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: -1;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--card-border);
  width: 90%;
  max-width: 400px;
}

.modal input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  background: rgba(26,35,55,0.5);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}

.container {
  max-width: 900px;
  margin: 50px auto;
  padding: 30px;
  position: relative;
  z-index: 1;
}

.controls {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.btn {
  background: rgba(26, 35, 55, 0.8);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.3s;
}

.btn:hover {
  background: rgba(40, 50, 80, 0.9);
}

h1 {
  color: #d0d6f9;
  font-weight: 500;
  font-size: 2.2em;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
  text-align: center;
}

.intro {
  text-align: center;
  color: #a0a8c0;
  font-style: italic;
  margin-bottom: 40px;
  font-size: 1.1em;
}

.quote-of-day {
  text-align: center;
  color: #ffd970;
  margin: 20px 0;
  padding: 15px;
  background: rgba(30, 40, 70, 0.4);
  border-radius: 10px;
  border: 1px solid rgba(240, 201, 135, 0.2);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.book-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.book-card:hover {
  transform: translateY(-5px);
}

.book-card h3 {
  color: var(--accent);
  margin-bottom: 5px;
}

.book-card p {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.book-reader {
  background: rgba(20, 30, 50, 0.7);
  color: #e0e6ff;
  padding: 25px;
  margin: 20px 0;
  border-radius: 12px;
  font-size: 1.1em;
  line-height: 1.8;
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.note-form, .quote-form {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  margin-bottom: 30px;
}

.note-form input, .note-form textarea,
.quote-form input, .quote-form textarea {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  background: rgba(26,35,55,0.5);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
}

.note-item, .quote-item {
  background: var(--card-bg);
  padding: 15px;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--card-border);
}

/* Header */
.header {
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.header h1 {
  font-size: 1.8em;
  margin: 0;
}

.btn-primary.small {
  font-size: 0.9em;
  padding: 8px 16px;
  width: auto;
}

/* Footer навигация */
.footer-nav {
  text-align: center;
  margin-top: 50px;
  padding: 20px 0;
  color: var(--text-secondary);
  font-size: 0.9em;
  border-top: 1px solid var(--border);
}

.footer-nav a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 10px;
}

.footer-nav a:hover {
  text-decoration: underline;
}