/* Main Styles for PharmaEvents */

:root {
  --primary: #0f6e84;
  --primary-dark: #0a5a6d;
  --secondary: #4caf50;
  --secondary-dark: #388e3c;
  --light: #f8f9fa;
  --gray: #6c757d;
  --dark: #343a40;
  --danger: #dc3545;
  --warning: #ffc107;
  --success: #28a745;
  --info: #17a2b8;
}

/* Theme Color Classes */
[data-theme-color="blue"] {
    --primary: #0f6e84;
    --primary-dark: #0a5a6e;
}

[data-theme-color="green"] {
    --primary: #198754;
    --primary-dark: #146c43;
}

[data-theme-color="purple"] {
    --primary: #6f42c1;
    --primary-dark: #59359a;
}

[data-theme-color="red"] {
    --primary: #dc3545;
    --primary-dark: #b02a37;
}

[data-theme-color="orange"] {
    --primary: #fd7e14;
    --primary-dark: #e8690b;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f5f7f9;
  color: #333;
}

/* Navbar */
.navbar {
  background-color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  color: white !important;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
}

.navbar-nav .nav-link:hover {
  color: white !important;
}

.navbar-nav .active .nav-link {
  color: white !important;
  font-weight: 700;
}

/* Cards */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

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

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  border-color: var(--secondary-dark);
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.login-left {
  padding: 2rem;
}

.login-right {
  background-color: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.login-logo {
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.login-title {
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

/* Dashboard */
.stat-card {
  text-align: center;
  padding: 1.5rem;
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-container {
  position: relative;
  height: 350px;
  margin-bottom: 1.5rem;
}

/* Event Cards */
.event-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.event-card .card-img-top {
  height: 180px;
  object-fit: cover;
}

.event-banner {
  position: relative;
}

.event-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.event-details {
  flex-grow: 1;
}

.event-category {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: rgba(15, 110, 132, 0.1);
  color: var(--primary);
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.event-info-icon {
  color: var(--gray);
  width: 1rem;
  margin-right: 0.5rem;
}

.event-actions {
  margin-top: auto;
}

/* Forms */
.form-label {
  font-weight: 500;
}

.required-field::after {
  content: "*";
  color: var(--danger);
  margin-left: 4px;
}

.custom-file-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Settings Page */
.settings-section {
  margin-bottom: 2rem;
}

.settings-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* User Menu */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(45deg, #6a11cb, #2575fc);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-menu {
  min-width: 200px;
  max-width: 280px;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  margin-top: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: none;
  max-height: 80vh;
  overflow-y: auto;
}

/* Ensure dropdown stays within viewport */
.dropdown-menu-end {
  --bs-position: end;
  right: 0 !important;
  left: auto !important;
  transform: translateX(0) !important;
}

/* Parent dropdown container positioning */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  z-index: 1050;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
}

/* Fix positioning for responsive screens */
@media (max-width: 768px) {
  .user-menu {
    min-width: 180px;
    max-width: 95vw;
    right: 0.5rem !important;
    left: auto !important;
    margin-right: 0;
    position: fixed !important;
    top: 60px !important;
  }
  
  .navbar .dropdown-menu.show {
    right: 0.5rem !important;
    left: auto !important;
  }
}

/* Prevent dropdown from going off screen on small screens */
@media (max-width: 480px) {
  .user-menu {
    min-width: 160px;
    max-width: 90vw;
    right: 0.25rem !important;
  }
}

.dropdown-role {
  padding: 0.25rem 1.5rem;
  font-size: 0.875rem;
  color: var(--gray);
}

.dropdown-role-item {
  padding-left: 2rem;
}

.dropdown-role-item.active {
  background-color: var(--primary);
  color: white;
}

/* Charts */
.chart-section {
  margin-bottom: 2rem;
}

.chart-section .card-header {
  background-color: var(--primary);
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .login-left {
    display: none;
  }

  .stat-card .stat-value {
    font-size: 2rem;
  }

  .chart-container {
    height: 300px;
  }
}

/* Utility Classes */
.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-secondary {
  background-color: var(--secondary) !important;
}

.text-overflow-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: all 0.3s ease;
}

[data-bs-theme="dark"] .loading-overlay {
  background-color: rgba(33, 37, 41, 0.8);
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Style for loading message */
.loading-message {
  margin-top: 1rem;
  color: var(--primary);
  font-weight: 500;
}

/* Color Picker Styles */
.form-control-color {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-control-color:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.color-preview {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preset-color {
    min-width: 80px;
    margin-bottom: 0.5rem;
    border: 2px solid transparent !important;
    transition: all 0.3s ease;
}

.preset-color:hover {
    border-color: #fff !important;
    box-shadow: 0 0 0 2px var(--primary);
    transform: translateY(-2px);
}

.current-theme-display {
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

/* Color Wheel Styles */