/* ============================================
   Letterrolls — Polished Design System
   ============================================ */

/* ---------- Base ---------- */
body, html {
  height: 100%;
  font-size: 16px;
  background: #fafafa;
  font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
  color: #2c2c2c;
  line-height: 1.6;
}

a {
  color: #4a5568;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2d3748;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }

.poem-text p {
  font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: #333;
  margin: 20px 0;
}

/* ---------- Navbar ---------- */
.w3-top {
  z-index: 1000;
}

.w3-bar {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  border: none;
}

.w3-bar .w3-button {
  font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0;
  color: #fff !important;
}

.w3-bar .w3-button:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.w3-bar .w3-xxlarge {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.w3-dropdown-content {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
  border: none;
}

.w3-dropdown-content .w3-button {
  color: #2d3748 !important;
  background: #fff !important;
}

.w3-dropdown-content .w3-button:hover {
  background-color: #edf2f7 !important;
  color: #2d3748 !important;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -1px;
  padding: 12px 24px !important;
}

.logo-icon {
  font-size: 2rem;
  color: #fff;
}

.logo-text {
  color: #fff !important;
  font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
}

/* ---------- Bottom Nav ---------- */
.nav-bottom {
  margin-top: 8px;
  margin-left: 20px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  margin: 0 4px !important;
  font-size: 0.95rem !important;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

/* ---------- Top Right Nav Links (Poetry, Write, Help) ---------- */
.top-nav-link {
  color: rgba(255, 255, 255, 0.95) !important;
  padding: 10px 16px !important;
  border-radius: 8px !important;
  margin: 0 6px !important;
  font-size: 0.95rem !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(4px);
}

.top-nav-link:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* ---------- User Menu Button ---------- */
.user-menu-btn {
  color: #fff !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  margin-left: 8px !important;
  font-size: 0.95rem !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(4px);
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.user-menu-btn i.fa-caret-down {
  font-size: 0.8rem;
  margin-left: 2px;
}

/* ---------- User Dropdown Menu ---------- */
.user-dropdown {
  border-radius: 10px !important;
  overflow: hidden;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12) !important;
}

.user-dropdown .w3-button {
  padding: 10px 16px !important;
  font-size: 0.95rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.user-dropdown .w3-button:last-child {
  border-bottom: none !important;
}

/* ---------- Buttons ---------- */
.w3-button.w3-blue {
  background-color: #4299e1 !important;
  border-color: #4299e1 !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.w3-button.w3-blue:hover {
  background-color: #3182ce !important;
  border-color: #3182ce !important;
  transform: translateY(-1px);
}

.w3-button.w3-teal {
  background-color: #48bb78 !important;
  border-color: #48bb78 !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.w3-button.w3-teal:hover {
  background-color: #38a169 !important;
  border-color: #38a169 !important;
  transform: translateY(-1px);
}

.w3-button.w3-dark-grey {
  background-color: #718096 !important;
  border-color: #718096 !important;
}

.w3-button.w3-border {
  border-width: 2px;
}

/* ---------- Forms ---------- */
.w3-container form {
  max-width: 600px;
  margin: 0 auto;
}

.fieldWrapper {
  margin-bottom: 20px;
}

.fieldWrapper label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d3748;
  font-size: 1rem;
}

.fieldWrapper span.w3-input,
.fieldWrapper input.w3-input,
.fieldWrapper textarea.w3-input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.fieldWrapper span.w3-input:focus,
.fieldWrapper input.w3-input:focus,
.fieldWrapper textarea.w3-input:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.fieldWrapper .w3-text-blue {
  color: #4299e1 !important;
}

ul.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

ul.messages li {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

ul.messages li.success {
  background: #c6f6d5;
  color: #22543d;
  border-left: 4px solid #48bb78;
}

ul.messages li.error {
  background: #fed7d7;
  color: #c53030;
  border-left: 4px solid #fc8181;
}

ul.messages li.message {
  background: #e2e8f0;
  color: #2d3748;
  border-left: 4px solid #a0aec0;
}

/* ---------- Poem Cards ---------- */
.poem-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.poem-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e0;
}

.poem-card .poem-text {
  flex: 1;
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.poem-card .poem-text p {
  margin: 0;
  font-size: 1.05rem;
  color: #4a5568;
}

.poem-card header {
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 24px;
}

.poem-card header h4 {
  margin: 0;
  font-size: 1.25rem;
  color: #1a202c;
}

.poem-card .poem-footer {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f7fafc;
  border-top: 1px solid #e2e8f0;
}

.poem-card .likebtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.poem-card .likebtn:active {
  transform: scale(0.96);
}

.poem-card .likebtn.w3-dark-grey {
  background-color: #718096 !important;
}

.poem-card .heart-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.poem-card .like-count {
  font-size: 0.9rem;
  color: #718096;
  font-weight: 500;
}

.poem-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #718096;
  margin-top: 8px;
}

.poem-meta a {
  color: #2d3748;
  text-decoration: none;
  font-weight: 600;
}

.poem-meta a:hover {
  color: #4299e1;
  text-decoration: underline;
}

.poem-category {
  font-style: italic;
  color: #a0aec0;
}

.poem-date {
  color: #a0aec0;
}

/* ---------- Hero Section ---------- */
#hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 80px 20px;
  text-align: center;
  border-radius: 0 0 60px 60px;
  margin-bottom: 40px;
}

#hero h1 {
  color: #fff;
  font-size: 3rem;
  margin-bottom: 1rem;
}

#hero .w3-large {
  font-size: 1.25rem;
  color: #e2e8f0;
  margin-bottom: 2rem;
}

#hero .w3-button {
  font-size: 1.1rem;
  padding: 14px 32px;
  border-radius: 50px;
}

/* ---------- Recent Poems Section ---------- */
#recent-poems h3 {
  text-align: center;
  margin-bottom: 0.5rem;
}

#recent-poems .w3-text-grey {
  text-align: center;
  margin-bottom: 2rem;
}

/* ---------- User Profile Header ---------- */
.user-profile-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 16px;
}

.user-profile-header h3,
.user-profile-header h4,
.user-profile-header a {
  color: #fff !important;
}

.user-profile-header .w3-text-grey {
  color: #e2e8f0 !important;
}

.user-profile-header p {
  color: #e2e8f0;
}

.user-profile-header .w3-circle {
  border: 4px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---------- Profile Page ---------- */
.profile-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border-radius: 16px;
}

.profile-header h2,
.profile-header h3,
.profile-header a {
  color: #fff !important;
}

.profile-header .w3-text-grey {
  color: #e2e8f0 !important;
}

.profile-header p {
  color: #e2e8f0;
}

.profile-header .w3-circle {
  border: 5px solid rgba(255,255,255,0.4);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.profile-header .w3-tag {
  background: rgba(255,255,255,0.2);
  color: #fff !important;
}

.profile-header .w3-button.w3-circle.w3-light-grey {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
  border: none;
}

.profile-header .w3-button.w3-circle.w3-light-grey:hover {
  background: rgba(255,255,255,0.4) !important;
  color: #fff !important;
}

.profile-header a {
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.5);
}

.profile-header a:hover {
  text-decoration-color: #fff;
}

.fieldWrapper input.w3-input:focus,
.fieldWrapper textarea.w3-input:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* ---------- Register Page ---------- */
.register-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border-radius: 16px;
}

.register-header h2,
.register-header h3,
.register-header p {
  color: #fff !important;
}

.register-header .w3-text-grey {
  color: #e2e8f0 !important;
}

.register-header i.fa-user-plus {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

/* ---------- Auth Pages ---------- */
.login-header,
.reset-header,
.change-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border-radius: 16px;
}

.login-header h2,
.reset-header h2,
.change-header h2,
.login-header p,
.reset-header p,
.change-header p {
  color: #fff !important;
}

.login-header .w3-text-grey,
.reset-header .w3-text-grey,
.change-header .w3-text-grey {
  color: #e2e8f0 !important;
}

.login-header i.fa-sign-in,
.reset-header i.fa-key,
.change-header i.fa-key {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

/* ---------- Compose Page ---------- */
.compose-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border-radius: 16px;
}

.compose-header h2,
.compose-header p {
  color: #fff !important;
}

.compose-header .w3-text-grey {
  color: #e2e8f0 !important;
}

.compose-header i.fa-pencil {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.publish-toggle label {
  background: #f7fafc;
  padding: 16px 20px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  transition: all 0.2s ease;
}

.publish-toggle label:hover {
  background: #edf2f7;
  border-color: #4299e1;
}

.publish-help {
  font-weight: 400 !important;
  opacity: 0.8;
}

#word-count {
  font-weight: 600;
  color: #4299e1;
}
/* ---------- Drafts Page ---------- */
.drafts-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border-radius: 16px;
}

.drafts-header h2,
.drafts-header p {
  color: #fff !important;
}

.drafts-header .w3-text-grey {
  color: #e2e8f0 !important;
}

.drafts-header i.fa-folder-open {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.draft-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.draft-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e0;
}

.draft-card header {
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 24px;
}

.draft-card header h4 {
  margin: 0;
  font-size: 1.25rem;
  color: #1a202c;
}

.draft-card .poem-text {
  padding: 20px 24px;
}

.draft-card .poem-text p {
  margin: 0;
  font-size: 1rem;
  color: #4a5568;
  line-height: 1.6;
}

.draft-card .poem-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7fafc;
  border-top: 1px solid #e2e8f0;
}

.draft-card .poem-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #718096;
}

.draft-card .poem-category {
  font-style: italic;
  color: #a0aec0;
}

.draft-card .poem-date {
  color: #a0aec0;
}

/* ---------- Empty State ---------- */
.w3-center i.fa-quote-left {
  opacity: 0.3;
}

/* ---------- Footer ---------- */
footer.w3-black {
  background-color: #1a202c !important;
  margin-top: 60px;
  padding: 40px 0;
}

footer.w3-black p {
  color: #a0aec0 !important;
}

footer.w3-black a {
  color: #4299e1 !important;
}

footer.w3-black .fa {
  color: #a0aec0;
  margin: 0 8px;
  font-size: 1.5rem;
}

footer.w3-black .fa:hover {
  color: #4299e1;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  
  #hero {
    padding: 60px 20px;
    border-radius: 0 0 40px 40px;
  }
  
  #hero h1 {
    font-size: 2rem;
  }
  
  .w3-bar .w3-right {
    display: block !important;
    text-align: right;
    margin-top: 8px;
  }
  
  .w3-bar .w3-bar-item {
    display: block;
    margin: 4px 0;
    text-align: right;
  }
  
  .user-profile-header .w3-row-padding {
    display: block;
  }
  
  .user-profile-header .w3-col {
    width: 100% !important;
  }
  
  .poem-card .poem-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .poem-meta {
    flex-direction: column;
    gap: 6px;
  }
  
  .nav-bottom {
    margin-left: 0;
    margin-top: 4px;
    text-align: center;
  }
  
  .nav-bottom .nav-link {
    display: inline-block;
    margin: 2px 6px !important;
  }
}

@media (max-width: 480px) {
  .w3-button.w3-blue,
  .w3-button.w3-teal {
    width: 100%;
    text-align: center;
  }
  
  .poem-card .poem-text {
    padding: 16px;
  }
  
  .poem-card header {
    padding: 16px 20px;
  }
  
  .poem-card .poem-footer {
    padding: 12px 20px;
  }
  
  .navbar-brand {
    font-size: 1.5rem;
    padding: 10px 16px !important;
  }
  
  .logo-icon {
    font-size: 1.75rem;
  }
}