/* ============================================================================
   MODERN & CLASSY DESIGN - Global Styles
   ============================================================================ */

:root {
  --primary-color: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  min-height: 100vh;
  padding: 1.5rem;
}

body {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 1.5rem 0 0.75rem 0;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 2rem 0;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

nav {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  display: flex;
  align-items: center;
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-md);
}

nav h1 {
  flex: auto;
  margin: 0;
  color: white;
  font-size: 1.75rem;
}

nav h1 a {
  color: white;
}

nav h1 a:hover {
  text-decoration: none;
  opacity: 0.9;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  align-items: center;
}

nav ul li a,
nav ul li span {
  display: block;
  padding: 0.65rem 1.25rem;
  color: white;
  border-radius: 6px;
  transition: var(--transition);
  font-size: 0.95rem;
  font-weight: 500;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
  backdrop-filter: blur(10px);
}

nav ul li span {
  padding: 0.65rem 1.25rem;
  opacity: 0.95;
}

/* ============================================================================
   CONTENT & SECTIONS
   ============================================================================ */

.content {
  padding: 2.5rem 2.5rem;
}

.content > header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.content > header h1 {
  flex: auto;
  margin: 0;
}

header .action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gray-100);
  transition: var(--transition);
  cursor: pointer;
  font-size: 1.25rem;
}

header .action:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================================
   FLASH MESSAGES
   ============================================================================ */

.flash {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================================================
   CARDS - Posts & Books
   ============================================================================ */

.post,
.book {
  padding: 1.75rem;
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.post:hover,
.book:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post > header,
.book > header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.post > header > div:first-of-type,
.book > header > div:first-of-type {
  flex: auto;
}

.post > header h1,
.book > header h1 {
  font-size: 1.375rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.post .about,
.book .about {
  color: var(--gray-500);
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.post .body {
  white-space: pre-line;
  color: var(--gray-700);
  line-height: 1.6;
}

.book .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.content form {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.content label {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--gray-700);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content input,
.content textarea,
.content select {
  padding: 0.875rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background: white;
  color: var(--gray-900);
}

.content input:focus,
.content textarea:focus,
.content select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--gray-50);
}

.content textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

input[type='submit'],
input[type='button'] {
  align-self: flex-start;
  min-width: 120px;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  margin-right: 0.75rem;
  margin-bottom: 1rem;
}

input[type='submit']:hover,
input[type='button']:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

input[type='submit']:active,
input[type='button']:active {
  transform: translateY(0);
}

input.danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
  color: white;
}

input.danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, var(--danger-color) 100%);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ============================================================================
   TAG LIST STYLES
   ============================================================================ */

#lst_tags ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#lst_tags li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

#lst_tags a {
  color: white;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
  padding: 0 0.25rem;
}

#lst_tags a:hover {
  text-decoration: none;
  opacity: 0.8;
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  html {
    padding: 0.5rem;
  }

  body {
    border-radius: 0;
  }

  .content {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
  }

  nav h1 {
    width: 100%;
    text-align: center;
  }

  nav ul {
    width: 100%;
    flex-direction: column;
    gap: 0;
  }

  nav ul li a,
  nav ul li span {
    width: 100%;
    text-align: center;
  }

  .content > header {
    flex-direction: column;
    align-items: flex-start;
  }

  input[type='submit'],
  input[type='button'] {
    width: 100%;
    margin-right: 0;
  }
}