/* Root variables for consistent theming */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --border-color: #ddd;
  --spacing-unit: 1rem;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-color);
  background-color: #fff;
  line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Lora", serif;
  font-weight: 700;
  margin-bottom: var(--spacing-unit);
  color: var(--primary-color);
}

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

p {
  margin-bottom: var(--spacing-unit);
}

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

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

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

/* Header */
.site-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: "Lora", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.brand:hover {
  color: var(--secondary-color);
}

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

.nav a {
  color: white;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: var(--secondary-color);
}

.admin-link {
  font-size: 0.9rem;
  opacity: 0.8;
}

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

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

.btn-primary:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary:hover {
  background-color: #c0392b;
}

.btn-success {
  background-color: #27ae60;
  color: white;
}

.btn-success:hover {
  background-color: #229954;
}

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

.btn-danger:hover {
  background-color: #c0392b;
}

/* Layout */
.layout {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.sidebar {
  flex: 0 0 250px;
}

.content {
  flex: 1;
}

/* Main content area */
main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Page heading */
.page-heading {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--secondary-color);
}

.page-heading h1 {
  margin-bottom: 0.5rem;
}

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

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

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

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background-color: var(--light-bg);
}

/* Cards */
.card {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.card-header h3 {
  margin-bottom: 0;
}

/* Sidebar */
.sidebar-section {
  background-color: var(--light-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section li {
  margin-bottom: 0.5rem;
}

.sidebar-section a {
  display: block;
  padding: 0.5rem;
  color: var(--text-color);
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.sidebar-section a:hover {
  border-left-color: var(--secondary-color);
  padding-left: 1rem;
  color: var(--secondary-color);
}

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

footer p {
  margin-bottom: 0.5rem;
}

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

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left-color: #28a745;
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    flex: 1;
  }

  .nav {
    gap: 1rem;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

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

  .nav {
    width: 100%;
    justify-content: center;
  }
}

/* Animations */
body.anim-ready {
  animation: fadeIn 0.5s ease-in;
}

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

/* Utility classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: var(--spacing-unit);
}
.mt-2 {
  margin-top: calc(var(--spacing-unit) * 2);
}
.mb-1 {
  margin-bottom: var(--spacing-unit);
}
.mb-2 {
  margin-bottom: calc(var(--spacing-unit) * 2);
}
.p-1 {
  padding: var(--spacing-unit);
}
.p-2 {
  padding: calc(var(--spacing-unit) * 2);
}
