/* BetrCooking - Reader Mode Inspired Design */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #202122;
  --text-secondary: #54595d;
  --border-color: #a2a9b1;
  --link-color: #0645ad;
  --link-hover: #0b0080;
  --sidebar-bg: #f8f9fa;
  --accent-color: #eaecf0;
  --success-color: #00af89;
  --danger-color: #d73333;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Liberation Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* Header */
header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-family: Georgia, 'Times New Roman', serif;
}

.logo-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-size: 1.5rem;
  font-weight: 400;
  font-family: Georgia, 'Times New Roman', serif;
}

.logo-accent {
  color: var(--link-color);
}

.logo-tagline {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: italic;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header-nav a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.95rem;
}

.header-nav a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* Header Search Bar */
.header-search {
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--link-color);
}

/* Search Bar */
.search-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.search-box {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  font-family: inherit;
}

.search-box:focus {
  outline: none;
  border-color: var(--link-color);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  gap: 2rem;
}

/* Sidebar */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.sidebar-section {
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background-color: var(--accent-color);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-list {
  list-style: none;
  padding: 0.5rem 0;
}

.sidebar-list li {
  padding: 0.25rem 0.75rem;
}

.sidebar-list a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.95rem;
}

.sidebar-list a:hover {
  text-decoration: underline;
}

/* Recipe Navigation Section */
.recipe-nav-section {
  background-color: #e8f4f8;
  border-color: var(--link-color);
}

.recipe-nav-section .sidebar-title {
  background-color: var(--link-color);
  color: white;
}

.recipe-nav-list a {
  font-weight: 500;
}

/* Add scroll padding for anchor links */
.recipe-section {
  scroll-margin-top: 2rem;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}

/* Article Styling (Recipe Content) */
article {
  background-color: var(--bg-primary);
}

h1 {
  font-family: 'Georgia', serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

h2 {
  font-family: 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Recipe List */
.recipe-list {
  list-style: none;
}

.recipe-item {
  border-bottom: 1px solid var(--accent-color);
  padding: 1rem 0;
}

.recipe-item:last-child {
  border-bottom: none;
}

.recipe-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
}

.recipe-link:hover {
  text-decoration: underline;
}

.recipe-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Recipe Info Box */
.recipe-info-box {
  float: right;
  width: 280px;
  margin: 0 0 1rem 1.5rem;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.recipe-info-title {
  background-color: var(--accent-color);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.recipe-info-image {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid var(--border-color);
}

.recipe-info-content {
  padding: 0.75rem;
}

.info-row {
  display: flex;
  padding: 0.25rem 0;
}

.info-label {
  font-weight: 600;
  min-width: 90px;
  color: var(--text-secondary);
}

.info-value {
  color: var(--text-primary);
}

/* Recipe Sections */
.recipe-section {
  margin: 1.5rem 0;
}

.ingredients-list,
.instructions-list {
  padding-left: 1.5rem;
  line-height: 1.8;
}

.ingredients-list li {
  margin: 0.5rem 0;
}

.instructions-list {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}

.instructions-list li {
  counter-increment: step-counter;
  margin: 1rem 0;
  position: relative;
  padding-left: 2.5rem;
}

.instructions-list li::before {
  content: counter(step-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 600;
  color: var(--link-color);
  width: 2rem;
  text-align: right;
  padding-right: 0.5rem;
}

/* Forms */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  font-family: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--link-color);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

button {
  background-color: var(--link-color);
  color: white;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 500;
}

button:hover {
  background-color: var(--link-hover);
}

button.secondary {
  background-color: var(--text-secondary);
}

button.secondary:hover {
  background-color: var(--text-primary);
}

button.success {
  background-color: var(--success-color);
}

button.danger {
  background-color: var(--danger-color);
}

button.danger:hover {
  background-color: #b02a2a;
}

/* Admin Controls */
#adminControls {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 2px;
  margin-top: 2rem;
}

/* Admin Dashboard */
.submission-card {
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 2px;
}

.submission-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.submission-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.submission-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.submission-body {
  margin: 1rem 0;
}

.submission-section {
  margin: 0.75rem 0;
}

.submission-section strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.submission-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.submission-actions button {
  padding: 0.5rem 1.5rem;
}

/* Alert Messages */
.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 2px;
  border-left: 4px solid;
}

.alert-success {
  background-color: #d4edda;
  border-color: var(--success-color);
  color: #155724;
}

.alert-info {
  background-color: #d1ecf1;
  border-color: #0c5460;
  color: #0c5460;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: var(--danger-color);
  color: #721c24;
}

/* Notes/Tips Box */
.notes-box {
  background-color: #fef6e7;
  border: 1px solid #f0c36d;
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 2px;
}

.notes-box strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #996633;
}

/* Image Upload Preview */
.image-preview {
  margin-top: 0.5rem;
  max-width: 300px;
}

.image-preview img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 2px;
}

.submission-image {
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 2px;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  .main-content {
    order: 1;
    max-width: 100%;
  }

  .recipe-info-box {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem 0;
  }
}

@media (max-width: 768px) {
  .rotd-card {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .rotd-image-container {
    height: 200px;
    width: 100%;
  }

  .rotd-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .rotd-details {
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .logo-image {
    width: 40px;
    height: 40px;
  }

  .logo-main {
    font-size: 1.25rem;
  }

  .logo-tagline {
    font-size: 0.7rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .recipe-of-the-day {
    padding: 1rem;
    margin: 1rem 0;
  }

  .rotd-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
  }

  .rotd-header h2 {
    font-size: 1.5rem;
  }

  .rotd-date {
    font-size: 0.8rem;
  }

  .rotd-card {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rotd-image-container {
    height: 180px;
  }

  .rotd-details {
    padding: 1rem;
    gap: 0.75rem;
  }

  .rotd-title {
    font-size: 1.25rem;
  }

  .rotd-meta {
    font-size: 0.85rem;
    gap: 0.75rem;
  }

  .rotd-preview {
    font-size: 0.9rem;
  }

  .rotd-button {
    width: 100%;
    text-align: center;
  }
}

/* Chef Profile Page */
.chef-profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  margin-bottom: 2rem;
}

.chef-profile-icon {
  font-size: 4rem;
  background: white;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid #a2a9b1;
}

.chef-profile-info h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
}

.chef-stats {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 600px) {
  .chef-profile-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .chef-profile-icon {
    width: 80px;
    height: 80px;
    font-size: 3rem;
  }

  .chef-profile-info h1 {
    font-size: 1.5rem;
  }

  .chef-stats {
    font-size: 0.85rem;
    justify-content: center;
  }
}

/* Recipe Rating System */
.recipe-rating-section {
  padding: 1rem;
  border-top: 1px solid #a2a9b1;
  background: #f8f9fa;
}

.recipe-rating-display {
  text-align: center;
  margin-bottom: 0.75rem;
}

.stars-display {
  font-size: 1.5rem;
  color: #ffa500;
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
}

.rating-text {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recipe-rating-input {
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
}

.rating-prompt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stars-input {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

.star-btn {
  font-size: 2rem;
  color: #ddd;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.star-btn:hover {
  color: #ffa500;
  transform: scale(1.1);
}

.star-btn:active {
  transform: scale(0.95);
}

/* Recipe Author Credit */
.recipe-author {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  margin: -0.5rem 0 1.5rem 0;
}

.author-link {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  font-style: normal;
}

.author-link:hover {
  text-decoration: underline;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #a2a9b1;
  margin: 2rem 0 0 0;
}

.admin-tab {
  padding: 0.75rem 1.5rem;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  border-bottom: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  margin-bottom: -2px;
}

.admin-tab:hover {
  background: #e9ecef;
}

.admin-tab.active {
  background: white;
  color: var(--text-primary);
  border-bottom: 2px solid white;
  font-weight: 600;
}

.admin-tab-content {
  animation: fadeIn 0.3s ease;
}

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

/* Admin Controls on Recipe Pages */
.admin-controls-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
}

.admin-controls-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #a2a9b1;
}

.admin-controls-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-btn-edit,
.admin-btn-delete {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: 1px solid;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  background: white;
}

.admin-btn-edit {
  color: #0645ad;
  border-color: #0645ad;
}

.admin-btn-edit:hover {
  background: #0645ad;
  color: white;
}

.admin-btn-delete {
  color: #d73333;
  border-color: #d73333;
}

.admin-btn-delete:hover {
  background: #d73333;
  color: white;
}

/* Recipe of the Day */
.recipe-of-the-day {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
  border: 2px solid #ff9933;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(255, 153, 51, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.rotd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #ff9933;
}

.rotd-header h2 {
  color: #cc6600;
  font-size: 1.8rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rotd-date {
  font-size: 0.9rem;
  color: #8b5a00;
  font-weight: 500;
}

.rotd-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

.rotd-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.rotd-empty a {
  color: var(--link-color);
  text-decoration: underline;
}

.rotd-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.rotd-image-container {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.rotd-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rotd-card:hover .rotd-image {
  transform: scale(1.05);
}

.rotd-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rotd-title {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.rotd-category {
  display: inline-block;
  background: #f0f0f0;
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  width: fit-content;
}

.rotd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.rotd-meta-item {
  display: inline;
}

.rotd-preview {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.rotd-button {
  display: inline-block;
  background: #0645ad;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  transition: background 0.15s ease;
  width: fit-content;
  margin-top: auto;
  border: 1px solid #0645ad;
}

.rotd-button:hover {
  background: #0b0080;
  border-color: #0b0080;
}

/* Print Styles */
@media print {
  header,
  .sidebar,
  .header-nav,
  .search-container {
    display: none;
  }

  .main-content {
    max-width: 100%;
  }

  .recipe-info-box {
    float: none;
    width: 100%;
    border: 2px solid #000;
  }
}

