:root {
  --bg: #faf8f6;
  --text: #222;
  --card-bg: #fff;
  --card-shadow: 0 1px 6px rgba(0,0,0,0.06);
  --border: #ddd;
  --accent: #222;
  --muted: #888;
  --footer: #bbb;
}
body.dark {
  --bg: #18191c;
  --text: #f3f3f3;
  --card-bg: #23242a;
  --card-shadow: 0 1px 8px rgba(0,0,0,0.25);
  --border: #333;
  --accent: #fff;
  --muted: #aaa;
  --footer: #666;
}
body {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  direction: rtl;
  transition: background 0.3s, color 0.3s;
}
#lang-switch {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--card-bg);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 1000;
  border: 1px solid var(--border);
  padding: 0.3rem;
  align-items: center;
}

/* Search Modal Styles */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.search-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 600px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal.active .search-container {
  transform: translate(-50%, -50%) scale(1);
}

.search-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--muted);
  font-size: 1.1rem;
}

#search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 3rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  font-family: inherit;
  outline: none;
  border-radius: 8px;
  transition: background 0.2s;
}

#search-input:focus {
  background: var(--bg);
}

#search-input::placeholder {
  color: var(--muted);
}

.search-close {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.search-close:hover {
  background: var(--bg);
  color: var(--text);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
}

.search-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.search-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.search-placeholder p {
  margin: 0;
  font-size: 1.1rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.search-result-item:hover {
  background: var(--bg);
  transform: translateX(-4px);
}

.search-result-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--card-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  font-size: 1.1rem;
}

.search-result-content {
  flex: 1;
}

.search-result-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.search-result-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-result-preview {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
  border-left: 3px solid var(--accent);
}

.search-result-preview i {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0.3rem;
}

.search-result-preview span {
  font-style: italic;
}

.search-highlight {
  background: rgba(255, 255, 0, 0.3);
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.no-results i {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.lang-btn, #theme-toggle, #search-btn {
  margin: 0.2rem 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.lang-btn, #search-btn {
  border: none;
  background: none;
  color: var(--text);
  padding: 0;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: background 0.18s, color 0.18s;
}
.lang-btn.active {
  background: var(--accent);
  color: var(--card-bg);
}
.lang-btn:not(.active):hover, .lang-btn:not(.active):focus,
#search-btn:hover, #search-btn:focus {
  background: var(--bg);
  color: var(--accent);
}
/* Remove old #lang-toggle styles */
#lang-toggle { display: none !important; }

/* Comments page styles */
#comments-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Poems sorting styles */
#poems-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Bookmarks styles */
#bookmarks-container {
  max-width: 800px;
  margin: 0 auto;
}

.bookmarks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.bookmarks-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--accent);
}

.bookmarks-stats {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
}

.bookmarks-placeholder {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.bookmarks-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.bookmarks-placeholder p {
  margin: 0 0 1.5rem 0;
  font-size: 1.2rem;
}

.browse-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: var(--card-bg);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.browse-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bookmark-indicator {
  display: flex;
  align-items: center;
  color: #6366f1;
  font-size: 0.9rem;
}

.poems-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.poems-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--accent);
}

.poems-sort select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.poems-sort select:hover,
.poems-sort select:focus {
  border-color: var(--accent);
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.comments-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--accent);
}

.comments-stats {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
}

.comments-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.comments-filters select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.comments-filters select:hover,
.comments-filters select:focus {
  border-color: var(--accent);
}

.comment-item {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  margin-bottom: 1rem !important;
  background: var(--card-bg) !important;
  transition: box-shadow 0.2s, transform 0.2s;
}

.comment-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: bold;
  color: var(--accent) !important;
}

.comment-date {
  font-size: 0.9em;
  color: var(--muted) !important;
}

.comment-poem {
  font-size: 0.9em;
  color: var(--accent) !important;
  margin-bottom: 0.5rem;
}

.comment-poem a {
  color: inherit !important;
  text-decoration: none !important;
  transition: opacity 0.2s;
}

.comment-poem a:hover {
  opacity: 0.8;
}

.comment-content {
  line-height: 1.6;
  color: var(--text) !important;
  word-wrap: break-word;
}

@media (max-width: 600px) {
  .comments-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .comments-filters {
    flex-direction: column;
  }
  
  .comments-filters select {
    width: 100%;
  }
  
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .poems-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .poems-sort select {
    width: 100%;
  }
  
  .bookmarks-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .bookmarks-placeholder {
    padding: 2rem 1rem;
  }
  
  .bookmarks-placeholder i {
    font-size: 3rem;
  }
  
  .bookmarks-placeholder p {
    font-size: 1.1rem;
  }
  
  .browse-link {
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
  }
  
  .search-container {
    width: 95%;
    margin: 1rem;
  }
  
  .search-header {
    padding: 1rem;
  }
  
  #search-input {
    font-size: 1rem;
    padding: 0.8rem 2.5rem 0.8rem 2.5rem;
  }
  
  .search-results {
    max-height: 300px;
  }
}

header {
  background: var(--card-bg);
  padding: 2rem 1rem 1rem 1rem;
  box-shadow: var(--card-shadow);
  text-align: center;
}
header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.2rem;
  letter-spacing: 0.02em;
}
header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.site-nav {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--accent);
  color: var(--card-bg);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
main {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}
#poems-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.poem-card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 1.2rem 1rem;
  transition: box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.poem-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.poem-title {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  font-weight: bold;
  color: var(--text);
}
.poem-date {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.poem-author {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.poem-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  justify-content: center;
}

.poem-views {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.poem-views i {
  font-size: 0.8rem;
}
footer {
  text-align: center;
  color: var(--footer);
  font-size: 0.95rem;
  margin: 2rem 0 1rem 0;
}
.poem-content {
  font-size: 1.35rem;
  line-height: 2.2;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.poem-title, .poem-date, .poem-author, .poem-content {
  text-align: center;
}
.poem-content {
  margin-left: auto;
  margin-right: auto;
}
#theme-toggle {
  border: none;
  background: none;
  color: var(--text);
  font-size: 1.2rem;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  outline: none;
  transition: background 0.18s, color 0.18s;
  border-radius: 999px;
}
#theme-toggle:hover, #theme-toggle:focus {
  background: var(--bg);
  color: var(--accent);
}
#admin-content {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem 1rem;
  margin-bottom: 2rem;
}
/* .admin-form button, .login-form button styles are overridden in admin.html for modern look */
.like-btn {
  background: none;
  border: none;
  color: #e11d48;
  font-size: 1.25em;
  cursor: pointer;
  padding: 0.3em 1.1em;
  border-radius: 999px;
  transition: background 0.18s, color 0.18s, transform 0.13s;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.like-btn.liked, .like-btn:active {
  color: #fff;
  background: #e11d48;
  transform: scale(1.08);
}
.like-btn:hover {
  background: #f43f5e;
  color: #fff;
}

.bookmark-btn {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 1.25em;
  cursor: pointer;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  transition: background 0.18s, color 0.18s, transform 0.13s;
  display: inline-flex;
  align-items: center;
  margin-left: 0.5em;
}

.bookmark-btn.bookmarked {
  color: #6366f1;
}

.bookmark-btn:hover {
  background: #6366f1;
  color: #fff;
  transform: scale(1.08);
}
.share-btn {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 1.15em;
  cursor: pointer;
  margin: 0 0.15em;
  border-radius: 50%;
  padding: 0.35em 0.5em;
  transition: background 0.18s, color 0.18s, transform 0.13s;
}
.share-btn:hover {
  background: #6366f1;
  color: #fff;
  transform: scale(1.13);
}
.comment-btn {
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6em 1.5em;
  font-size: 1.01em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
  margin-top: 0.2em;
}
.comment-btn:hover {
  background: linear-gradient(90deg, #818cf8 0%, #6366f1 100%);
  box-shadow: 0 2px 8px #6366f1aa;
  transform: scale(1.04);
}
#comments-list {
  margin-top: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 1.1em;
}
.comment-item {
  background: rgba(30,30,30,0.92);
  border-radius: 8px;
  padding: 0.7em 1em;
  color: #fff;
  border: 1px solid #6366f1;
  box-shadow: 0 1px 4px #6366f1aa;
  font-size: 1.01em;
}
.comment-meta {
  color: #a5b4fc;
  font-size: 0.93em;
  margin-bottom: 0.2em;
}
@media (max-width: 900px) {
  main {
    max-width: 98vw;
    padding: 0 0.5rem;
  }
  header {
    padding: 1.2rem 0.5rem 0.7rem 0.5rem;
  }
}
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }
  main {
    margin: 1rem 0;
    padding: 0 0.2rem;
    max-width: 100vw;
  }
  header h1 {
    font-size: 1.1rem;
    word-break: break-word;
  }
  #lang-switch {
    bottom: 1rem;
    right: 1rem;
    flex-direction: row;
    gap: 0.3rem;
    padding: 0.2rem;
    border-radius: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  }
  .lang-btn, #theme-toggle, #search-btn {
    width: 36px;
    height: 36px;
    margin: 0;
    font-size: 0.8rem;
  }
  .poem-card {
    padding: 0.7rem 0.4rem;
    font-size: 0.98rem;
  }
  
  .poem-stats {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
  .poem-title {
    font-size: 1.05rem;
  }
  .poem-content {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1.8;
  }
  .admin-form, .login-form {
    padding: 1rem 0.5rem;
    border-radius: 7px;
    font-size: 1rem;
  }
  .admin-form input, .admin-form textarea, .login-form input {
    font-size: 1rem;
    padding: 0.45rem;
  }
  .admin-form button, .login-form button {
    font-size: 1rem;
    padding: 0.6rem 1.1rem;
  }
}
body, html {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Additional mobile optimizations for very small screens */
@media (max-width: 480px) {
  #lang-switch {
    bottom: 0.8rem;
    right: 0.8rem;
    gap: 0.25rem;
    padding: 0.15rem;
  }
  .lang-btn, #theme-toggle, #search-btn {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }
  
  .bookmarks-header h2 {
    font-size: 1.5rem;
  }
  
  .bookmarks-stats {
    font-size: 1rem;
  }
  
  .bookmarks-placeholder {
    padding: 1.5rem 0.5rem;
  }
  
  .bookmarks-placeholder i {
    font-size: 2.5rem;
  }
  
  .bookmarks-placeholder p {
    font-size: 1rem;
  }
  
  .browse-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .poem-content {
    font-size: 1.75rem;
    line-height: 1.9;
  }
}

/* Ensure touch targets are large enough for mobile */
@media (hover: none) and (pointer: coarse) {
  .lang-btn, #theme-toggle, #search-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Admin page styles */
#admin-content {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border);
}

.login-form, .admin-form {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border);
}

.login-form label, .admin-form label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.login-form input, .admin-form input, .admin-form textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.login-form input:focus, .admin-form input:focus, .admin-form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.login-form input::placeholder, .admin-form input::placeholder, .admin-form textarea::placeholder {
  color: var(--muted);
}

.login-form input[type="password"] {
  direction: ltr;
  text-align: left;
}

.login-form button, .admin-form button {
  background: var(--accent);
  color: var(--card-bg);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  min-width: 120px;
}

.login-form button:hover, .admin-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.login-form button:disabled, .admin-form button:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.message {
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-weight: 500;
  text-align: center;
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid #22c55e;
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.poem-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.poem-actions button {
  background: var(--accent);
  color: var(--card-bg);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
  outline: none;
  min-width: 80px;
}

.poem-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.poem-actions .delete-btn {
  background: #ef4444;
  color: white;
}

.poem-actions .delete-btn:hover {
  background: #dc2626;
}

.poem-actions .edit-btn {
  background: #10b981;
  color: white;
}

.poem-actions .edit-btn:hover {
  background: #059669;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--card-bg);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  margin-left: auto;
  margin-right: 0;
  transition: all 0.2s;
  outline: none;
}

.logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 600px) {
  #admin-content {
    padding: 1rem;
    margin: 1rem;
  }
  
  .login-form, .admin-form {
    padding: 1rem;
    gap: 0.8rem;
  }
  
  .poem-actions {
    gap: 0.3rem;
  }
  
  .poem-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    min-width: 70px;
  }
  
  .logout-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }
}

/* Edit Modal Styles */
.edit-modal {
  animation: modalFadeIn 0.3s ease-out;
}

.edit-modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

.edit-modal-close:hover {
  background: var(--border) !important;
  color: var(--text) !important;
}

.edit-cancel-btn:hover {
  background: var(--border) !important;
  transform: translateY(-1px);
}

.edit-save-btn:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

.edit-preview {
  font-family: inherit;
}

.edit-preview h1,
.edit-preview h2,
.edit-preview h3,
.edit-preview h4,
.edit-preview h5,
.edit-preview h6 {
  color: var(--text);
  margin: 1rem 0 0.5rem 0;
}

.edit-preview p {
  margin: 0.5rem 0;
}

.edit-preview strong {
  font-weight: 600;
}

.edit-preview em {
  font-style: italic;
}

.edit-preview code {
  background: var(--bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.edit-preview pre {
  background: var(--bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.edit-preview pre code {
  background: none;
  padding: 0;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { 
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .edit-modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  .edit-modal-actions {
    flex-direction: column;
  }
  
  .edit-cancel-btn,
  .edit-save-btn {
    width: 100%;
  }
}

/* Reading Progress Bar Styles */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

body.dark .reading-progress {
  background: rgba(255, 255, 255, 0.1);
}

/* Enhanced Search Styles */
.search-modal.active .search-container {
  animation: searchSlideIn 0.3s ease-out;
}

@keyframes searchSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 120px;
}

.search-filter-group label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.search-filter-select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.search-filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.search-clear-btn {
  background: var(--muted);
  color: var(--card-bg);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.search-clear-btn:hover {
  background: var(--accent);
  color: var(--card-bg);
}

.search-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.search-results-count {
  font-size: 0.9rem;
  color: var(--muted);
}

.search-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-sort label {
  font-size: 0.85rem;
  color: var(--muted);
}

.search-sort select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.85rem;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: var(--card-bg);
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

.search-result-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
  line-height: 1.4;
}

.search-result-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.search-result-preview {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  margin-top: 0.5rem;
}

.search-result-preview i {
  color: var(--accent);
  margin: 0 0.25rem;
}

.search-highlight {
  background: linear-gradient(120deg, #fef3c7 0%, #fde68a 100%);
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
  font-weight: 600;
}

body.dark .search-highlight {
  background: linear-gradient(120deg, #451a03 0%, #78350f 100%);
  color: #fbbf24;
}

.search-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.search-no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--muted);
}

.search-loading .loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Enhanced search modal responsiveness */
@media (max-width: 768px) {
  .search-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-filter-group {
    min-width: auto;
  }
  
  .search-stats {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .search-result-item {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .search-result-icon {
    align-self: flex-start;
  }
} 