/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #365071;
  --secondary-color: #b66576;
  --text-dark: #2c2c2c;
  --text-light: #6c6c6c;
  --background-light: #f8f9fa;
  --white: #ffffff;
  --border-light: #e1e5e9;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-color);
}

/* Header and Navigation */
header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-image {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  background-color: var(--background-light);
  color: var(--primary-color);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 200px);
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.page-title {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-title {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  justify-content: space-around;
  width: 2.5rem;
  height: 2.5rem;
}

.hamburger-line {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--primary-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Menu Animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem 2rem;
    position: relative;
  }
  
  .mobile-menu-toggle {
    display: flex;
    z-index: 1001;
    position: relative;
  }
  
  .logo-image {
    height: 35px;
  }

  .logo-text {
    font-size: 1rem;
  }
  
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    gap: 0;
    z-index: 1000;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--border-light);
  }
  
  .nav-links li:last-child {
    border-bottom: none;
  }
  
  .nav-links a {
    display: block;
    padding: 1rem 0;
    width: 100%;
    text-align: center;
  }
  
  main {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  /* Better mobile card spacing */
  .card {
    padding: 1.5rem;
  }
  
  /* Stack form elements better on mobile */
  .admin-form .form-row {
    grid-template-columns: 1fr;
  }
  
  /* Better mobile table handling */
  .admin-table, .dashboard-table {
    overflow-x: auto;
  }
  
  .admin-table table, .dashboard-table table {
    min-width: 600px;
  }
  
  /* Improve hero logo on mobile */
  .hero-logo-image {
    height: 80px;
  }
  
  /* Better mobile grid layouts */
  .dashboard-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  /* Better mobile button spacing */
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    margin-bottom: 0.5rem;
  }
  
  /* Improve widget container on mobile */
  .widget-container iframe {
    height: 300px;
  }
  
  /* Better mobile contact info layout */
  .page-header {
    padding: 1rem 0;
  }
  
  /* Improve mobile spacing for events and blog posts */
  .card [style*="border-left"] {
    margin-bottom: 1rem !important;
  }
}

/* Hero Logo */
.hero-logo {
  margin-bottom: 2rem;
}

.hero-logo-image {
  height: 200px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* Widget Container */
.widget-container {
  margin-top: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget-container iframe {
  display: block;
  max-width: 100%;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  border: 1px solid;
}

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Admin Authentication Layout */
.auth-container {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  height: 80px;
  margin-bottom: 1rem;
}

.auth-header h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-light);
  margin: 0;
}

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.auth-btn {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.875rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.auth-footer a {
  color: var(--text-light);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--primary-color);
}

/* Admin Dashboard Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.dashboard-card {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-hover);
}

.dashboard-card-header {
  background: var(--primary-color);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-card-header h3 {
  margin: 0;
  color: white;
}

.dashboard-count {
  font-size: 2rem;
  font-weight: bold;
}

.dashboard-card-content {
  padding: 1.5rem;
}

.dashboard-section {
  margin-bottom: 3rem;
}

.dashboard-section h2 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

/* Admin Tables */
.admin-table, .dashboard-table {
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-table table, .dashboard-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .dashboard-table th {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

.admin-table td, .dashboard-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-table tr:hover, .dashboard-table tr:hover {
  background-color: rgba(54, 80, 113, 0.05);
}

.actions {
  display: flex;
  gap: 0.5rem;
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-active {
  background-color: #d4edda;
  color: #155724;
}

.status-inactive {
  background-color: #f8d7da;
  color: #721c24;
}

/* Admin Forms */
.admin-form-container {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 800px;
}

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

.admin-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-checkbox {
  width: auto;
}

.form-label-inline {
  margin: 0;
}

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

/* Admin Show Views */
.admin-show-container {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-show-header {
  background: var(--primary-color);
  color: white;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-show-header h2 {
  margin: 0;
  color: white;
}

.admin-show-content {
  padding: 2rem;
}

.admin-show-section {
  margin-bottom: 2rem;
}

.admin-show-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

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

.detail-item {
  padding: 1rem;
  background: var(--background-light);
  border-radius: 0.5rem;
}

.admin-show-actions {
  padding: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 1rem;
}

/* Header Actions */
.admin-header-actions {
  margin-bottom: 2rem;
  display: flex;
  justify-content: flex-end;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Button Variations */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  color: white;
  transform: translateY(-2px);
}

/* Blog Content Styling */
.blog-content {
  background: var(--background-light);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--secondary-color);
}

.blog-content p {
  margin-bottom: 1rem;
}

.blog-content p:last-child {
  margin-bottom: 0;
}

/* Library Settings Styling */
.settings-intro {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary-color);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.setting-card {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.setting-card:hover {
  box-shadow: var(--shadow-hover);
}

.setting-header {
  background: var(--primary-color);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-header h3 {
  margin: 0;
  color: white;
  font-size: 1.25rem;
}

.setting-content {
  padding: 1.5rem;
}

.setting-value {
  background: var(--background-light);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-family: 'Georgia', serif;
  min-height: 2rem;
}

.setting-description {
  color: var(--text-light);
  font-style: italic;
}

.settings-help {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--secondary-color);
}

.settings-help h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.settings-help ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-help li {
  margin-bottom: 0.5rem;
}

.setting-preview h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Image Gallery Styles */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.image-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.image-thumbnail:hover img {
  transform: scale(1.02);
}

.image-thumbnail:hover .image-overlay {
  opacity: 1;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(54, 80, 113, 0.8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 500;
}

/* Image Modal Styles */
.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: modalFadeIn 0.3s ease;
  text-align: center;
}

.image-modal-content {
  position: relative;
  margin: auto;
  padding: 0;
  width: 90%;
  max-width: 1200px;
  top: 50%;
  transform: translateY(-50%);
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.image-modal-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  font-size: 1.1rem;
}

.image-modal-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
}

.image-modal-close:hover {
  color: var(--secondary-color);
}

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

@media (max-width: 768px) {
  .image-gallery {
    grid-template-columns: 1fr;
  }
  
  .image-modal-content {
    width: 95%;
  }
  
  .image-modal-close {
    top: 10px;
    right: 20px;
    font-size: 35px;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
