/* Base styles */
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
}

/* Main layout styles */
.main-layout {
  min-height: 100vh;
  padding-top: 60px;
  padding-left: 250px;
  display: flex;
  flex-direction: column;
}

/* Header styles */
.header {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url(journals.jpg);
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.menu-toggle {
  display: none;
  position: absolute;
  left: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

.menu-toggle.active {
  transform: rotate(90deg);
}

/* Sidebar navigation */
.sidebar {
  width: 250px;
  background-color: rgb(48, 31, 11);
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  padding-top: 20px;
  z-index: 900;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar .nav-links {
  flex: 1;
}


.sidebar a {
  display: block;
  color: white;
  padding: 15px 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  margin: 4px 8px;
  border-radius: 6px;
}

.sidebar a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.sidebar a.active {
  background-color: #4caf50;
  color: white;
}

.sidebar a.active:before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: #fff;
  border-radius: 0 4px 4px 0;
}

/* Main content area */
.main-content {
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
}

/* Auth pages specific styles */
.auth-layout {
  min-height: 100vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url(journals.jpg);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.auth-container {
  background: rgba(255, 255, 255, 0.98);
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  margin-top: 80px;
}

/* Form styles */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgb(48, 31, 11);
}

/* Button styles */
.btn {
  background-color: rgb(48, 31, 11);
  color: white;
  padding: 14px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  max-width: 100%;
  box-sizing: border-box;
}

.btn:hover {
  background-color: #452b10;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(48, 31, 11, 0.2);
}

/* Card styles */
.card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.card h2 {
  color: rgb(48, 31, 11);
  margin-top: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.card p {
  color: #555;
  line-height: 1.6;
}

/* Footer */
.footer {
  background-color: rgb(48, 31, 11);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 20px 0;
}

/* Gallery styles */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  padding: 20px 0;
}

.gallery-item {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* Blog styles */
.blog-post {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.blog-post h2 {
  color: rgb(48, 31, 11);
  margin-top: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.blog-post .meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.blog-post .read-more {
  display: inline-block;
  padding: 8px 16px;
  background-color: rgb(48, 31, 11);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  margin-top: 15px;
  transition: all 0.3s ease;
}

.blog-post .read-more:hover {
  background-color: #452b10;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(48, 31, 11, 0.2);
}

.blog-sidebar {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  height: fit-content;
}

.blog-sidebar h3 {
  color: rgb(48, 31, 11);
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.blog-sidebar ul {
  list-style: none;
  padding: 0;
}

.blog-sidebar ul li {
  margin-bottom: 10px;
}

.blog-sidebar ul li a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-sidebar ul li a:hover {
  color: rgb(48, 31, 11);
}

.blog-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .menu-toggle {
    display: block !important;
  }

  .main-layout {
    padding-left: 0;
    padding-top: 60px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 80%;
    max-width: 250px;
    z-index: 1010;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  .sidebar.active {
    transform: translateX(0);
    display: flex !important;
  }

  .header {
    padding: 0 15px;
    justify-content: center;
  }

  .header h1 {
    font-size: 20px;
  }

  .main-content {
    padding: 20px 15px;
  }

  .card {
    padding: 20px;
  }

  .grid-2 {
    gap: 20px;
  }

  .blog-layout {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.gallery-item {
  animation: fadeIn 0.5s ease forwards;
}

/* Logout button styles */
.logout-btn {
  background: #e53e3e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.logout-btn:hover {
  background: #c53030;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.toast {
  background: white;
  color: #333;
  padding: 12px 24px;
  border-radius: 4px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  min-width: 280px;
  max-width: 400px;
  justify-content: center;
  animation: slideInTop 0.3s ease-out;
}

.toast.success {
  background: #4caf50;
  color: white;
}

.toast.error {
  background: #f44336;
  color: white;
}

@keyframes slideInTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutTop {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid rgb(48, 31, 11);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Button loading state */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
