/* ==============================================
   REQUEST MARSHALL PORTAL - CORPORATE STYLING
   Professional Design System
   ============================================== */

/* CSS Custom Properties (Variables) */
:root {
  /* Corporate Color Palette */
  --primary-color: #003366;          /* Deep Corporate Blue */
  --primary-dark: #002244;           /* Darker Blue for hover states */
  --primary-light: #0055aa;          /* Lighter Blue for accents */
  --secondary-color: #6c757d;        /* Professional Gray */
  --accent-color: #28a745;           /* Success Green */
  --warning-color: #ffc107;          /* Warning Amber */
  --danger-color: #dc3545;           /* Error Red */
  --info-color: #17a2b8;             /* Info Cyan */
  
  /* Neutral Colors */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #495057;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  
  /* Typography */
  --font-family-primary: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-family-headings: 'Segoe UI Semibold', system-ui, -apple-system, sans-serif;
  --font-size-base: 0.9rem;
  --font-size-sm: 0.8rem;
  --font-size-lg: 1.1rem;
  --font-size-xl: 1.25rem;
  --font-size-xxl: 1.5rem;
  --line-height-base: 1.5;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Borders & Shadows */
  --border-radius: 0.375rem;
  --border-radius-sm: 0.25rem;
  --border-radius-lg: 0.5rem;
  --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Base Typography */
html {
  font-size: 14px;
  font-family: var(--font-family-primary);
  height: 100%;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  color: var(--text-primary);
  font-family: var(--font-family-primary);
  line-height: var(--line-height-base);
  background-color: var(--light-gray);
  height: 100%;
  overflow-x: hidden;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-headings);
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-xxl); font-weight: 600; }
h2 { font-size: var(--font-size-xl); font-weight: 600; }
h3 { font-size: var(--font-size-lg); font-weight: 600; }
h4 { font-size: var(--font-size-base); font-weight: 600; }
h5 { font-size: var(--font-size-sm); font-weight: 600; }
h6 { font-size: var(--font-size-sm); font-weight: 500; }

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

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

/* ==============================================
   CORPORATE NAVIGATION
   ============================================== */

.navbar-corporate {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-bottom: 2px solid var(--primary-light);
  box-shadow: var(--box-shadow);
  padding: var(--spacing-sm) 0;
}

.navbar-brand {
  font-family: var(--font-family-headings);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--white) !important;
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--light-gray) !important;
}

.navbar-nav .nav-link {
  color: var(--white) !important;
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  margin: 0 var(--spacing-xs);
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white) !important;
}

.dropdown-menu {
  border: none;
  box-shadow: var(--box-shadow-lg);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm);
}

.dropdown-item {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

.dropdown-divider {
  border-color: var(--border-color);
  margin: var(--spacing-sm) 0;
}

/* ==============================================
   CARDS & PANELS
   ============================================== */

.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: box-shadow 0.3s ease;
  background-color: var(--white);
}

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

.card-header {
  background-color: var(--light-gray);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  padding: var(--spacing-md) var(--spacing-lg);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  background-color: var(--light-gray);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-md) var(--spacing-lg);
}

/* Dashboard Stats Cards */
.stat-card {
  background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.stat-card.success { border-left-color: var(--accent-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.info { border-left-color: var(--info-color); }

/* ==============================================
   BUTTONS
   ============================================== */

.btn {
  font-weight: 500;
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-lg);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--box-shadow);
}

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

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

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

/* ==============================================
   FORMS
   ============================================== */

.form-control {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all 0.2s ease;
  font-size: var(--font-size-base);
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.25);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.25);
}

/* Multi-select specific styling */
.multiselect-field {
  min-height: 120px !important;
  height: auto !important;
}

/* Checkbox list styling for multiselect */
.multiselect-checkbox-list {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  background-color: var(--white);
}

.multiselect-checkbox-list .form-check {
  margin-bottom: 0.25rem;
}

.multiselect-checkbox-list .form-check:last-child {
  margin-bottom: 0;
}

/* ==============================================
   TABLES
   ============================================== */

.table {
  background-color: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow-sm);
}

.table thead th {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--font-size-sm);
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: var(--light-gray);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(248, 249, 250, 0.5);
}

/* ==============================================
   BADGES & STATUS
   ============================================== */

.badge {
  font-weight: 500;
  font-size: 0.75em;
  border-radius: var(--border-radius-sm);
  padding: 0.35em 0.65em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.status-pending { background-color: var(--warning-color) !important; color: var(--text-primary); }
.status-approved { background-color: var(--accent-color) !important; color: var(--white); }
.status-rejected { background-color: var(--danger-color) !important; color: var(--white); }
.status-in-progress { background-color: var(--info-color) !important; color: var(--white); }
.status-completed { background-color: var(--primary-color) !important; color: var(--white); }

/* ==============================================
   ALERTS
   ============================================== */

.alert {
  border: none;
  border-radius: var(--border-radius);
  border-left: 4px solid;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border-left-color: var(--accent-color);
  color: #155724;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-left-color: var(--danger-color);
  color: #721c24;
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-left-color: var(--warning-color);
  color: #856404;
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  border-left-color: var(--info-color);
  color: #0c5460;
}

/* ==============================================
   UTILITIES
   ============================================== */

/* Text Colors */
.text-corporate { color: var(--primary-color) !important; }
.text-muted-light { color: var(--text-secondary) !important; }

/* Background Colors */
.bg-corporate { background-color: var(--primary-color) !important; }
.bg-corporate-light { background-color: var(--light-gray) !important; }

/* Shadows */
.shadow-corporate {
  box-shadow: 0 0.5rem 1rem rgba(0, 51, 102, 0.15) !important;
}

/* Borders */
.border-corporate {
  border-color: var(--primary-color) !important;
}

/* Custom Spacing */
.p-corporate { padding: var(--spacing-lg) !important; }
.m-corporate { margin: var(--spacing-lg) !important; }

/* ==============================================
   FOOTER
   ============================================== */

.footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: var(--spacing-lg) 0;
  margin-top: auto;
  border-top: 3px solid var(--primary-light);
  flex-shrink: 0;
}

.footer a {
  color: var(--light-gray);
}

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

/* ==============================================
   FOCUS STATES
   ============================================== */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.25);
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 768px) {
  .card-body {
    padding: var(--spacing-md);
  }
  
  .table-responsive {
    font-size: var(--font-size-sm);
  }
  
  .btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
  }
}

/* ==============================================
   LOADING & ANIMATIONS
   ============================================== */

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

/* ==============================================
   CATEGORY COLOR UTILITY
   ============================================== */

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==============================================
   WORKFLOW PIPELINE VISUALIZATION
   Azure DevOps Classic Release Pipeline Style
   ============================================== */

.workflow-pipeline {
  background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
  border-radius: var(--border-radius);
  padding: var(--spacing-xl);
  margin: var(--spacing-lg) 0;
  box-shadow: var(--box-shadow-sm);
}

.pipeline-stages {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: var(--spacing-xl) 0;
  min-height: 120px;
}

.pipeline-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 140px;
  z-index: 2;
}

.stage-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  border: 3px solid;
  background: var(--white);
  box-shadow: var(--box-shadow);
  margin-bottom: var(--spacing-sm);
}

.stage-title {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.stage-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Stage States */
.stage-completed .stage-icon {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--white);
}

.stage-active .stage-icon {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  animation: pulse 2s infinite;
}

.stage-pending .stage-icon {
  background: var(--white);
  border-color: var(--medium-gray);
  color: var(--text-secondary);
}

.stage-rejected .stage-icon {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: var(--white);
}

.stage-cancelled .stage-icon {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--white);
}

/* Pipeline Connectors */
.pipeline-connector {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--medium-gray);
  z-index: 1;
  transform: translateY(-50%);
}

.connector-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color) 0%, var(--primary-color) 100%);
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* Stage Details Expandable */
.stage-details {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  box-shadow: var(--box-shadow-lg);
  display: none;
  white-space: nowrap;
  z-index: 10;
  margin-top: var(--spacing-sm);
}

.pipeline-stage:hover .stage-details {
  display: block;
}

.stage-details::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--border-color);
}

.stage-details::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--white);
}

/* Pipeline Summary */
.pipeline-summary {
  display: flex;
  justify-content: space-around;
  background: var(--white);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--box-shadow-sm);
}

.summary-item {
  text-align: center;
}

.summary-value {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--primary-color);
}

.summary-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
}

/* Pulse Animation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 51, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 51, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 51, 102, 0);
  }
}

/* Workflow Stage Cards */
.stage-icon-sm {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-completed.card {
  border-color: var(--accent-color) !important;
  background-color: rgba(40, 167, 69, 0.05);
}

.stage-active.card {
  border-color: var(--primary-color) !important;
  background-color: rgba(0, 51, 102, 0.05);
  border-width: 2px;
}

.stage-pending.card {
  border-color: var(--border-color) !important;
  opacity: 0.7;
}

.stage-rejected.card {
  border-color: var(--danger-color) !important;
  background-color: rgba(220, 53, 69, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .pipeline-stages {
    flex-direction: column;
    gap: var(--spacing-lg);
  }
  
  .pipeline-connector {
    display: none;
  }
  
  .pipeline-stage {
    min-width: auto;
  }
  
  .stage-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

/* Workflow Tabs */
.workflow-tabs {
  background: var(--white);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  border-bottom: 1px solid var(--border-color);
}

.workflow-tabs .nav-link {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--spacing-md) var(--spacing-lg);
}

.workflow-tabs .nav-link.active {
  border-color: var(--border-color) var(--border-color) transparent var(--border-color);
  background: var(--white);
  color: var(--primary-color);
}

.workflow-tabs .nav-link:hover:not(.active) {
  border-color: var(--medium-gray);
  color: var(--primary-color);
}

html {
  position: relative;
  min-height: 100%;
}