/* Material Design Theme for Sync Media Dashboard */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
  /* Primary Teal/Blue Colors */
  --primary-color: #3a8aa5;
  --primary-dark: #287792;
  --primary-light: #4b9fba;
  --secondary-color: #3ca6a7;
  --accent-color: #319697;
  
  /* Grey Tones */
  --grey-50: #fafafa;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-500: #9e9e9e;
  --grey-600: #757575;
  --grey-700: #616161;
  --grey-800: #424242;
  --grey-900: #212121;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: var(--grey-50);
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  
  /* Text Colors */
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-disabled: #bdbdbd;
  --text-on-primary: #ffffff;
  
  /* Status Colors */
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  --info: #2196f3;
  
  /* Shadows */
  --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  --shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  --shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'MS Sans Serif', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Material Design Navigation */
.navbar {
  background-color: var(--primary-color);
  box-shadow: var(--shadow-2);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.navbar-brand {
  color: var(--text-on-primary);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  margin-right: auto;
  display: flex;
  align-items: center;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-item {
  margin: 0 8px;
}

.nav-link {
  color: var(--text-on-primary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  font-weight: 400;
  font-size: 13px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-on-primary);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.nav-link .material-icons {
  margin-right: 6px;
  font-size: 18px;
}

/* Material Design Cards */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.2s ease;
  margin-bottom: 24px;
  overflow: hidden;
}

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

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--grey-200);
}

.card-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.card-body {
  padding: 24px;
}

.card-actions {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Statistics Cards (Info Boxes) */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.stat-card {
  background-color: transparent;
  border: 1px solid var(--grey-400);
  border-radius: 0;
  box-shadow: none;
  padding: 10px;
  text-align: center;
  transition: border-color 0.2s ease;
}

.stat-card:hover {
  border-color: var(--primary-color);
}

.stat-number {
  font-size: 28px;
  font-weight: 300;
  color: var(--primary-color);
  margin: 0;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-sublabel {
  font-size: 10px;
  color: var(--text-muted);
  margin: 2px 0 0;
  font-weight: 400;
}

.stat-icon {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Material Design Buttons */
.btn {
  font-family: 'MS Sans Serif', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 36px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-1);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-2);
}

.btn-secondary {
  background-color: var(--grey-300);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--grey-400);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
}

.btn-fab {
  border-radius: 50%;
  width: 56px;
  height: 56px;
  min-width: 56px;
  box-shadow: var(--shadow-2);
}

.btn-fab:hover {
  box-shadow: var(--shadow-3);
}

.btn .material-icons {
  margin-right: 8px;
  font-size: 18px;
}

.btn-fab .material-icons {
  margin: 0;
  font-size: 24px;
}

/* Material Design Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7px;
  border: 1px solid var(--grey-400);
}

.table th {
  background-color: #ff0000; /* RED for testing */
  color: var(--text-on-primary);
  font-weight: 500;
  text-align: center;
  padding: 6px 6px;
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  font-size: 10px; /* Reduced from 12px */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease;
}

.table th:hover {
  background-color: var(--primary-dark);
}

.table td {
  padding: 1px 6px;
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: var(--grey-50);
}

.table tbody tr:last-child td {
  border-bottom: 1px solid var(--grey-400);
}

.table th:last-child,
.table td:last-child {
  border-right: none;
}

/* Column width constraints */
.table th:nth-child(3), /* EP column */
.table td:nth-child(3) {
  width: 35px;
  max-width: 35px;
}

.table th:nth-child(4), /* Duration column */
.table td:nth-child(4) {
  width: 40px;
  max-width: 40px;
}

.table th:nth-child(7), /* Deadline column */
.table td:nth-child(7) {
  width: 60px;
  max-width: 60px;
}

/* Date columns - TR St, TR Due, TR Done */
.table th:nth-child(9), /* TR St */
.table td:nth-child(9),
.table th:nth-child(10), /* TR Due */
.table td:nth-child(10),
.table th:nth-child(11), /* TR Done */
.table td:nth-child(11) {
  width: 60px;
  max-width: 60px;
}

/* Date columns - QC ST, QC Due, QC Done */
.table th:nth-child(13), /* QC ST */
.table td:nth-child(13),
.table th:nth-child(14), /* QC Due */
.table td:nth-child(14),
.table th:nth-child(15), /* QC Done */
.table td:nth-child(15) {
  width: 60px;
  max-width: 60px;
}

/* Date columns - CP St, CP Due, CP Done */
.table th:nth-child(17), /* CP St */
.table td:nth-child(17),
.table th:nth-child(18), /* CP Due */
.table td:nth-child(18),
.table th:nth-child(19), /* CP Done */
.table td:nth-child(19) {
  width: 60px;
  max-width: 60px;
}

/* User assignment columns - Trans, QC, Caption */
.table th:nth-child(8), /* Trans */
.table td:nth-child(8),
.table th:nth-child(12), /* QC */
.table td:nth-child(12),
.table th:nth-child(16), /* Caption */
.table td:nth-child(16) {
  width: 70px;
  max-width: 70px;
}

/* Suggested minimum widths for auto-layout */
.table th:nth-child(2), /* Type */
.table td:nth-child(2) {
  min-width: 80px;
}

.table th:nth-child(6), /* PW */
.table td:nth-child(6) {
  min-width: 80px;
}

.table th:nth-child(20), /* Accuracy */
.table td:nth-child(20) {
  min-width: 100px;
}

.table th:nth-child(21), /* Done */
.table td:nth-child(21) {
  width: 40px;
  max-width: 40px;
}

.table th:nth-child(22), /* FB */
.table td:nth-child(22) {
  min-width: 80px;
}

/* Deadline color coding */
.deadline-past {
  background-color: #4a4a4a !important;
  color: #ffffff !important;
}

.deadline-today {
  background-color: #f44336 !important;
  color: #ffffff !important;
}

.deadline-2days {
  background-color: #ff69b4 !important;
  color: #000000 !important;
}

.deadline-3-4days {
  background-color: #ffe0b3 !important;
  color: #000000 !important;
}

/* Form Controls */
.form-control {
  font-family: 'MS Sans Serif', sans-serif;
  font-size: 14px;
  padding: 4px 8px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

/* Edit inputs in table cells - override form-control */
.table .form-control.edit-input,
.table .form-control.edit-select,
.table td .form-control {
  padding: 1px 3px !important;
  font-size: 12px !important;
  height: auto !important;
  min-height: 20px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

/* Specific textbox widths for Accuracy and FB fields */
.table td:nth-child(20) .form-control, /* Accuracy textbox */
.table td:nth-child(22) .form-control { /* FB textbox */
  width: calc(100% + 10px) !important;
  max-width: none !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(58, 138, 165, 0.2);
}

.form-control:hover {
  border-color: var(--grey-400);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Select Dropdown */
.select-container {
  position: relative;
}

.select-container::after {
  content: 'arrow_drop_down';
  font-family: 'Material Icons';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
}

/* Checkbox and Radio */
.checkbox, .radio {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.checkbox input, .radio input {
  margin-right: 12px;
  accent-color: var(--primary-color);
}

/* Material Design Alerts */
.alert {
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.alert .material-icons {
  margin-right: 12px;
  font-size: 20px;
}

.alert-success {
  background-color: #e8f5e8;
  color: #2e7d32;
  border-left: 4px solid var(--success);
}

.alert-warning {
  background-color: #fff3e0;
  color: #f57c00;
  border-left: 4px solid var(--warning);
}

.alert-error {
  background-color: #ffebee;
  color: #c62828;
  border-left: 4px solid var(--error);
}

.alert-info {
  background-color: #e3f2fd;
  color: #1976d2;
  border-left: 4px solid var(--info);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-fluid {
  padding: 0 24px;
}

.main-content {
  padding: 32px 0;
  min-height: calc(100vh - 64px);
}

.section-header {
  margin-bottom: 32px;
}

.section-title {
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive Grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -12px;
}

.col {
  flex: 1;
  padding: 0 12px;
}

.col-auto {
  flex: 0 0 auto;
  padding: 0 12px;
}

/* Status Indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background-color: #fff3e0;
  color: #f57c00;
}

.status-progress {
  background-color: #e3f2fd;
  color: #1976d2;
}

.status-completed {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.status-overdue {
  background-color: #ffebee;
  color: #c62828;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  color: var(--text-on-primary);
  border: none;
  box-shadow: var(--shadow-3);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000;
}

.fab:hover {
  box-shadow: var(--shadow-4);
  transform: scale(1.1);
}

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--grey-300);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.m-0 { margin: 0; }
.m-1 { margin: 8px; }
.m-2 { margin: 16px; }
.m-3 { margin: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .main-content {
    padding: 24px 0;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .row {
    margin: 0;
  }
  
  .col {
    padding: 0;
    margin-bottom: 16px;
  }
  
  .fab {
    bottom: 16px;
    right: 16px;
  }
}

/* Calendar Popup Styles */
.calendar-popup {
  position: absolute;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  z-index: 1001;
  min-width: 300px;
}

/* Hover Notes Styles */
.notes-popup {
  position: absolute;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  padding: 16px;
  max-width: 300px;
  z-index: 1000;
  border: 1px solid var(--grey-200);
}

.note-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--grey-100);
}

.note-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.note-timestamp {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.note-content {
  font-size: 13px;
  color: var(--text-primary);
}

/* Multi-select Styles */
.multiselect-container {
  position: relative;
}

.multiselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.multiselect-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.multiselect-option:hover {
  background-color: var(--grey-50);
}

.multiselect-option.selected {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
}

/* Start field specific styling */
.start-field {
  width: 60px !important;
  max-width: 60px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Type Color Coding */
.type-badge {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
  min-width: 50px;
  text-align: center;
}

/* CCSL - Dark Blue */
.type-ccsl {
  color: #1976d2;
}

/* CC - Dark Green */
.type-cc {
  color: #2e7d32;
}

/* CDSL - Dark Orange (already exists) */
.type-cdsl {
  color: #f57c00;
}

/* DV - Brown */
.type-dv {
  color: #795548;
}

/* SUBS - Dark Maroon */
.type-subs {
  color: #880e4f;
}

/* CONT - Purple */
.type-cont {
  color: #9c27b0;
}

/* Default type color */
.type-default {
  color: #9e9e9e;
}

/* Center text in type column (2nd column) */
.table td:nth-child(2) {
  text-align: center;
}

/* Done checkbox styling */
.done-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--success);
}

.done-cell {
  text-align: center !important;
  padding: 8px !important;
}