/* Enhanced Contract Management Styles */

/* Main Container Enhancements */
.enhanced-contract-header {
  margin-bottom: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Navigation Tabs */
.contract-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: white;
  color: #667eea;
  font-weight: 600;
}

.contract-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.contract-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 12px;
  min-width: 18px;
  text-align: center;
  display: none;
}

/* Enhanced Filters */
.contract-filters {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

.filter-row {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

.filter-group label {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}

.filter-group select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* Enhanced Views */
.enhanced-contract-view {
  margin-top: 2rem;
}

/* Workflow Board */
.workflow-view {
  margin-top: 2rem;
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  min-height: 600px;
}

.workflow-column {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.column-header h4 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contract-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.contract-cards {
  padding: 1rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Contract Cards */
.contract-card {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1rem;
  cursor: move;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contract-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.contract-card.dragging {
  opacity: 0.7;
  transform: rotate(5deg);
}

.contract-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0;
  background: none;
}

.contract-card .card-header h5 {
  margin: 0;
  color: #333;
  font-size: 1rem;
}

.contract-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contract-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.contract-detail .label {
  color: #666;
  font-weight: 500;
}

.contract-detail .value {
  font-weight: 600;
  color: #333;
}

.expiry-warning {
  color: #e67e22;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: flex-end;
}

.card-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.draft {
  background: #f39c12;
  color: white;
}

.status-badge.under-review {
  background: #3498db;
  color: white;
}

.status-badge.active {
  background: #27ae60;
  color: white;
}

.status-badge.suspended {
  background: #e74c3c;
  color: white;
}

.status-badge.expired {
  background: #95a5a6;
  color: white;
}

.status-badge.terminated {
  background: #2c3e50;
  color: white;
}

/* Templates View */
.templates-view {
  margin-top: 2rem;
}

.templates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.template-card {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  overflow: hidden;
}

.template-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.template-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.template-actions {
  display: flex;
  gap: 0.5rem;
}

.template-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.template-body {
  padding: 1rem;
}

.template-detail {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.template-description {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
}

.template-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
  grid-column: 1 / -1;
}

.empty-state i {
  color: #ddd;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 1rem 0 0.5rem 0;
  color: #333;
}

/* Analytics View */
.analytics-view {
  margin-top: 2rem;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.analytics-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.analytics-card {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.analytics-card .card-header {
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.analytics-card .card-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.analytics-card .card-body {
  padding: 1.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.metric {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.coming-soon {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem;
}

/* Notification Center */
.notification-center {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 400px;
  max-height: 600px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.notification-header h4 {
  margin: 0;
  font-size: 1rem;
}

.notification-list {
  max-height: 500px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  transition: background-color 0.3s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  background: #f0f7ff;
  border-left: 4px solid #3498db;
}

.notification-item.priority-high {
  border-left-color: #e74c3c;
}

.notification-item.priority-medium {
  border-left-color: #f39c12;
}

.notification-icon {
  margin-right: 0.75rem;
  color: #666;
}

.notification-content {
  flex: 1;
}

.notification-content h5 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  color: #333;
}

.notification-content p {
  margin: 0 0 0.25rem 0;
  font-size: 0.8rem;
  color: #666;
}

.notification-content small {
  font-size: 0.7rem;
  color: #999;
}

.notification-actions {
  display: flex;
  align-items: center;
}

.empty-notifications {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.empty-notifications i {
  font-size: 2rem;
  color: #ddd;
  margin-bottom: 1rem;
}

/* Contract Details Modal */
.contract-details-modal .modal-content.large {
  max-width: 900px;
  width: 90vw;
}

.contract-details-tabs {
  min-height: 500px;
}

.tab-buttons {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.tab-buttons .tab-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
  color: #666;
}

.tab-buttons .tab-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: none;
}

.tab-buttons .tab-btn.active {
  background: #667eea;
  color: white;
}

.tab-content {
  padding: 2rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.detail-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
}

.detail-section h5 {
  margin: 0 0 1rem 0;
  color: #333;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.detail-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-row .label {
  font-weight: 600;
  color: #555;
}

.detail-row .value {
  color: #333;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-buttons .btn {
  justify-content: flex-start;
}

.status-history {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
}

.history-timeline {
  position: relative;
  padding-left: 2rem;
}

.history-timeline::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ddd;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  background: #667eea;
  border: 2px solid white;
  border-radius: 50%;
}

.timeline-content h6 {
  margin: 0 0 0.25rem 0;
  color: #333;
}

.timeline-content p {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  color: #666;
}

.timeline-content small {
  color: #999;
  font-size: 0.8rem;
}

/* Enhanced Table Styles */
.table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.data-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  font-weight: 600;
  text-align: left;
  border: none;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.data-table tr:hover {
  background: #f8f9fa;
}

.expiry-warning {
  color: #e67e22;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.expired {
  color: #e74c3c;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .contract-navigation {
    flex-direction: column;
    gap: 1rem;
  }

  .view-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions {
    margin-left: 0;
    justify-content: center;
  }

  .workflow-board {
    grid-template-columns: 1fr;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .notification-center {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tab-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .tab-btn i {
    display: none;
  }

  .contract-actions .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.enhanced-contract-view.hidden {
  display: none !important;
}

/* Animation Classes */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-center {
  animation: slideInRight 0.3s ease-out;
}

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

.contract-card {
  animation: fadeInUp 0.3s ease-out;
}
