/*
 * This is a manifest file that'll be compiled into application.css.
 */

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

/* Theme Variables - Ocean (Default) */
body[data-theme="ocean"],
body:not([data-theme]) {
  --primary-color: #0077be;
  --primary-dark: #005a8f;
  --primary-light: #4da6d6;
  --secondary-color: #00a8cc;
  --accent-color: #ffa500;
  --sidebar-bg: #1a2332;
  --sidebar-hover: #2a3442;
  --sidebar-active: #00a8cc;
  --content-bg: #f5f7fa;
  --card-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-light: #ffffff;
  --border-color: #e1e4e8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Theme - Sunset */
body[data-theme="sunset"] {
  --primary-color: #ff6b6b;
  --primary-dark: #ee5a52;
  --primary-light: #ff8787;
  --secondary-color: #ffa07a;
  --accent-color: #ffd93d;
  --sidebar-bg: #2d1b2e;
  --sidebar-hover: #3d2b3e;
  --sidebar-active: #ff6b6b;
  --content-bg: #fff5f5;
  --card-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-light: #ffffff;
  --border-color: #ffe4e4;
  --shadow-sm: 0 1px 3px rgba(255, 107, 107, 0.1);
  --shadow-md: 0 4px 6px rgba(255, 107, 107, 0.1);
  --shadow-lg: 0 10px 20px rgba(255, 107, 107, 0.15);
}

/* Theme - Forest */
body[data-theme="forest"] {
  --primary-color: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #40916c;
  --secondary-color: #52b788;
  --accent-color: #95d5b2;
  --sidebar-bg: #1b2821;
  --sidebar-hover: #2b3831;
  --sidebar-active: #52b788;
  --content-bg: #f1f8f4;
  --card-bg: #ffffff;
  --text-primary: #1b4332;
  --text-secondary: #52796f;
  --text-light: #ffffff;
  --border-color: #d8f3dc;
  --shadow-sm: 0 1px 3px rgba(45, 106, 79, 0.1);
  --shadow-md: 0 4px 6px rgba(45, 106, 79, 0.1);
  --shadow-lg: 0 10px 20px rgba(45, 106, 79, 0.15);
}

/* Theme - Midnight */
body[data-theme="midnight"] {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;
  --sidebar-bg: #1e1b29;
  --sidebar-hover: #2e2b39;
  --sidebar-active: #6366f1;
  --content-bg: #f8f9fc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.1);
  --shadow-md: 0 4px 6px rgba(99, 102, 241, 0.1);
  --shadow-lg: 0 10px 20px rgba(99, 102, 241, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--content-bg);
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  transition: transform 0.3s ease;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
  transform: translateX(-260px);
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.org-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background-color: rgba(255, 255, 255, 0.1);
}

.org-info {
  flex: 1;
  min-width: 0;
}

.org-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light);
}

.app-title a {
  color: var(--text-light);
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

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

.sidebar-nav li {
  margin: 0.25rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-light);
  border-left-color: var(--sidebar-active);
}

.sidebar-nav a.active {
  background-color: var(--sidebar-hover);
  color: var(--text-light);
  border-left-color: var(--sidebar-active);
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.25rem;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-footer form {
  width: 100%;
}

.sidebar-footer button {
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.sidebar-footer button:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Theme Selector */
.theme-selector {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-selector label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-selector select {
  width: 100%;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
}

.theme-selector select option {
  background-color: var(--sidebar-bg);
  color: var(--text-light);
}

/* Main Layout */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  width: calc(100% - 260px);
}

.main-wrapper.expanded {
  margin-left: 0;
  width: 100%;
}

/* Top Bar */
.top-bar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-toggle {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  color: var(--text-primary);
  font-size: 1.25rem;
  line-height: 1;
}

.sidebar-toggle:hover {
  background-color: var(--content-bg);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Main content */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Footer */
.app-footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: auto;
}

.app-footer p {
  margin: 0;
}

.app-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.app-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Flash messages */
.flash {
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.flash.notice {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.flash.alert {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background-color: var(--content-bg);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

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

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

tbody tr:last-child td {
  border-bottom: none;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Buttons */
button, input[type="submit"], a.button {
  background-color: var(--primary-color);
  color: var(--text-light);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
  display: inline-block;
  text-decoration: none;
}

button:hover, input[type="submit"]:hover, a.button:hover {
  background-color: var(--primary-dark);
  text-decoration: none;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

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

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-260px);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .main-content {
    padding: 1rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.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; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
