/* EmProView Main CSS */

:root {
  --primary: #0047AB;
  --primary-dark: #003C8F;
  --primary-light: #3373C4;
  --secondary: #1E3A8A;
  --success: #10B981;
  --danger: #DC2626;
  --warning: #FFC107;
  --accent: #F59E0B;
  --info: #17A2B8;
  --light: #F3F4F6;
  --dark: #1F2937;
  --gray: #6B7280;
  --gray-light: #F3F4F6;
  --gray-dark: #374151;
  --body-bg: #f0f2f5;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --border-radius: 6px;
}

/* General */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--body-bg);
  color: var(--dark);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

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

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

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

.btn-outline:hover {
  background-color: var(--secondary);
  color: white;
  text-decoration: none;
}

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

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

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.card-header {
  background-color: var(--light);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark);
}

.card-body {
  padding: 1.5rem;
}

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

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--dark);
  background-color: white;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  border-color: var(--primary-light);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--dark);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3e%3cpath fill='%236b7280' d='M4 4L0 0h8z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 8px 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  appearance: none;
}

.form-select:focus {
  border-color: var(--primary-light);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--dark);
  border-collapse: collapse;
}

.table th, 
.table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.table th {
  font-weight: 600;
  background-color: var(--gray-light);
}

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

.table tr:hover {
  background-color: #f9fafb;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 9999px;
}

.badge-primary {
  background-color: #e0e7ff;
  color: var(--primary);
}

/* Alerts */
.alert {
  position: relative;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
}

.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-indicator.active {
  background-color: var(--success);
}

.status-indicator.pending {
  background-color: var(--accent);
}

.status-indicator.inactive {
  background-color: var(--gray);
}

/* Priority level indicators */
.emergency-level {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.emergency-level-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.emergency-level-high {
  background-color: var(--danger);
}

.emergency-level-medium {
  background-color: var(--accent);
}

.emergency-level-low {
  background-color: var(--success);
}

/* Source badges */
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  color: white;
}

.source-airline {
  background-color: #3B82F6;
}

.source-manufacturer {
  background-color: #0891b2;
}

.source-regulatory {
  background-color: #b45309;
}

.source-vendor {
  background-color: #4b5563;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  margin: 0 0.5rem;
  color: var(--secondary);
}

.breadcrumb-item.active {
  color: var(--secondary);
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

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

/* Layout */
.main-header {
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.page-layout {
  display: flex;
}

.main-container {
  display: flex;
  min-height: 100vh;
  margin-top: 64px; /* Header height */
}

.sidebar {
  width: 260px;
  background-color: var(--dark);
  color: white;
  min-height: 100vh;
  position: fixed;
  top: 64px; /* Header height */
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 900;
  transition: transform 0.3s ease;
  padding: 1rem 0;
}

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

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: bold;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.main-content {
  flex: 1;
  margin-left: 260px; /* Sidebar width */
  padding: 2rem;
  transition: margin-left 0.3s ease;
}

.main-content.full {
  margin-left: 0;
}

/* Additional sidebar styling */
.sidebar-nav {
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 0.25rem;
}

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

.nav-link:hover, .sidebar-nav-item:hover {
  background-color: rgba(255,255,255,0.1);
  color: white;
  text-decoration: none;
}

.nav-link.active, .sidebar-nav-item.active {
  background-color: var(--primary);
  color: white;
  font-weight: 500;
}

.nav-icon {
  color: rgba(255,255,255,0.6);
}

.nav-link.active .nav-icon {
  color: white;
}

/* Server status indicator */
.server-status-indicator {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  color: var(--gray);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-dot.online {
  background-color: var(--success);
}

.status-dot.offline {
  background-color: var(--danger);
}

/* Collapse sidebar button */
.collapse-sidebar {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--gray);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.collapse-sidebar svg {
  margin-right: 0.5rem;
}

.collapse-sidebar:hover {
  color: var(--primary);
}

/* Header styling */
.header-logo img {
  height: 32px;
}

.header-nav {
  display: flex;
  align-items: center;
}

.search-box {
  position: relative;
  margin-right: 1.5rem;
}

.search-input {
  padding: 0.5rem 1rem;
  padding-right: 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  width: 250px;
  font-size: 0.875rem;
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  color: var(--gray);
}

.header-user {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
}

.header-user:hover {
  background-color: var(--gray-light);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.user-name {
  margin-right: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Dropdown menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  display: none;
  min-width: 180px;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--dark);
  text-decoration: none;
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background-color: var(--gray-light);
  text-decoration: none;
}

.dropdown-item svg {
  margin-right: 0.75rem;
  color: var(--gray);
}

.dropdown-divider {
  border-top: 1px solid var(--border-color);
  margin: 0.5rem 0;
}

/* Main footer */
.main-footer, .footer {
  background-color: white;
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--gray);
  font-size: 0.875rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-copyright {
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Login page specific styles */
.login-page {
  background-color: var(--body-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.login-box {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

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

.login-logo {
  height: 48px;
  margin-bottom: 1.5rem;
}

.login-form {
  margin-bottom: 1.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.forgot-password {
  color: var(--primary);
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.login-info {
  margin-top: 1rem;
  padding: 1rem;
  background-color: var(--gray-light);
  border-radius: var(--border-radius);
  text-align: left;
  font-size: 0.75rem;
}

/* Server status alert */
.server-status {
  margin-bottom: 1rem;
}

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

.stat-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.stat-footer {
  display: flex;
  align-items: center;
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: auto;
}

/* Filter section */
.filter-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  padding: 0 1.5rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-item label {
  font-weight: 500;
  white-space: nowrap;
}

.filter-item .form-select {
  width: auto;
  min-width: 150px;
}

/* File upload */
.file-upload {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload:hover {
  border-color: var(--primary);
}

.file-upload-input {
  display: none;
}

.file-upload-icon {
  font-size: 2rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.file-upload-text {
  color: #6b7280;
}

.file-upload-text strong {
  color: var(--primary);
}

/* Procedure view specific styles */
#attachmentsSection .uploaded-file {
  background-color: var(--gray-light);
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
}

#procedureText {
  line-height: 1.6;
}

/* Welcome Banner */
.welcome-banner {
  background-color: var(--primary);
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.welcome-banner h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.welcome-banner p {
  opacity: 0.9;
  margin: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  display: none;
}

.modal {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #6b7280;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid #e5e7eb;
  position: sticky;
  bottom: 0;
  background-color: white;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 60;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .search-input {
    width: 180px;
  }
  
  .filter-section {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-item {
    width: 100%;
  }
  
  .filter-item .form-select {
    width: 100%;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}
