/* Compliance Audit Management - Main Styles */

:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2c3e50;
  --accent-color: #e67e22;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --text-color: #333;
  --gray-color: #6c757d;
  --gradient-primary: linear-gradient(135deg, var(--primary-color), #4a69bd);
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* General Styles */
body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  background-color: var(--light-color);
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--primary-dark);
}

.section-header {
  margin-bottom: 3rem;
}

.section-header h2 {
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.section-header h2:after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Buttons */
.btn {
  border-radius: 30px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-lg {
  padding: 1rem 2rem;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

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

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Header & Navigation */
.header {
  background: var(--gradient-primary);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: var(--transition);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: white;
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  background: var(--gradient-primary);
  color: white;
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.hero:before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: var(--light-color);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-title span {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  padding: 0 10px;
  border-radius: 4px;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-image {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-inner {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-icon {
  font-size: 8rem;
  color: white;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Features Section */
.features {
  padding: 6rem 0;
  background-color: white;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: var(--transition);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--light-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.feature-card h3 {
  margin-bottom: 1rem;
  font-weight: 600;
}

.feature-card p {
  color: var(--gray-color);
}

/* Standards Section */
.standards-section {
  padding: 6rem 0;
  background-color: var(--light-color);
}

.standard-item {
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.standard-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.standard-logo {
  font-size: 2rem;
  font-weight: 800;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--gradient-primary);
}

.standard-item h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.standard-item p {
  color: var(--gray-color);
  margin-bottom: 0;
}

/* CTA Section */
.cta-section {
  padding: 5rem 0;
  background: var(--gradient-primary);
  color: white;
  position: relative;
  text-align: center;
}

.cta-section h2 {
  color: white;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background: var(--secondary-color);
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 0 1rem;
}

.footer h5 {
  color: white;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer p {
  margin-bottom: 1.5rem;
}

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

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
  padding-left: 5px;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.875rem;
}

/* Application Styles */
#app-container {
  padding: 2rem 0;
  min-height: 100vh;
  background-color: #f8f9fa;
}

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

.back-nav a {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: 500;
  transition: var(--transition);
}

.back-nav a:hover {
  transform: translateX(-5px);
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.app-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.app-header h1 {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.app-header h1 i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.app-actions {
  margin-bottom: 2rem;
}

/* Standards Page */
.standard-card, .audit-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  height: 100%;
  overflow: hidden;
}

.standard-card:hover, .audit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.standard-card-header, .audit-card-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.standard-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.standard-icon i {
  font-size: 1.5rem;
  color: white;
}

.standard-card-header h3, .audit-card-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.audit-card-header .badge {
  float: right;
  font-weight: 500;
}

.standard-card-body, .audit-card-body {
  padding: 1.5rem;
}

.standard-meta, .audit-meta {
  display: flex;
  gap: 1rem;
  color: var(--gray-color);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.standard-card-footer, .audit-card-footer {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* AI Assistant Page */
.chat-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  height: 70vh;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.message {
  margin-bottom: 1.5rem;
  display: flex;
}

.user-message {
  justify-content: flex-end;
}

.system-message {
  justify-content: center;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 1rem;
}

.message-content {
  max-width: 70%;
  padding: 1rem;
  border-radius: 10px;
  background: #f8f9fa;
}

.user-message .message-content {
  background: var(--primary-color);
  color: white;
}

.system-message .message-content {
  background: #f0f0f0;
  color: var(--gray-color);
  font-size: 0.875rem;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid #eee;
}

/* Dialog Styles */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dialog-box {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  padding: 25px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: dialogAnimation 0.3s forwards;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .hero {
    padding: 4rem 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-image-inner {
    width: 250px;
    height: 250px;
  }
  
  .hero-icon {
    font-size: 6rem;
  }
  
  /* App responsive */
  .standard-meta, .audit-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .section-header {
    margin-bottom: 2rem;
  }
  
  .hero {
    padding: 3rem 0;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .features, .standards-section, .cta-section {
    padding: 3rem 0;
  }
  
  .feature-card, .standard-item {
    margin-bottom: 1.5rem;
  }
  
  .footer {
    text-align: center;
  }
  
  .footer .col-md-2 {
    margin-top: 2rem;
  }
  
  /* App responsive */
  .app-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .app-actions .btn, .app-actions .dropdown {
    width: 100%;
  }
  
  .standard-card-footer, .audit-card-footer {
    text-align: center;
  }
  
  .standard-card-footer .btn, .audit-card-footer .btn {
    margin-bottom: 0.5rem;
  }
  
  .message-content {
    max-width: 85%;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
  }
  
  /* App responsive */
  .app-header h1 {
    font-size: 1.5rem;
  }
  
  .message-content {
    max-width: 90%;
  }
}

/* AI Assistant Styles */

/* Ask AI Assistant Button */
.ask-ai-assistant-btn {
  background: linear-gradient(135deg, #3498db, #8e44ad);
  border: none;
  color: white;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
  transition: all 0.2s ease;
}

.ask-ai-assistant-btn:hover {
  background: linear-gradient(135deg, #2980b9, #7d3c98);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
  color: white;
}

.ask-ai-assistant-btn:active {
  transform: scale(0.98);
}

/* AI Insights Section */
.ai-insights-section {
  max-width: 100%;
  margin: 0 auto;
}

.ai-insights-section h5 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
}

/* AI Insight Cards */
.ai-insight-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.ai-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ai-insight-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db, #8e44ad);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-insight-icon i {
  color: white;
  font-size: 1.25rem;
}

.ai-insight-card h6 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.ai-insight-card p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

/* AI Assistant Modal */
#ai-assistant-modal .modal-dialog {
  max-width: 700px;
}

#ai-assistant-modal .modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#ai-assistant-modal .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
}

#ai-assistant-modal .modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
}

/* AI Status Indicator (Pulsing Dot) */
.ai-status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Chat Messages Container */
.ai-chat-messages-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.ai-chat-messages-container::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.ai-chat-messages-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.ai-chat-messages-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Chat Messages */
.ai-chat-message {
  margin-bottom: 1rem;
  display: flex;
  animation: slideIn 0.2s ease;
}

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

.ai-chat-message.user {
  justify-content: flex-end;
}

.ai-chat-message.assistant {
  justify-content: flex-start;
}

.ai-chat-message .message-content {
  max-width: 75%;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  word-wrap: break-word;
}

.ai-chat-message.user .message-content {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-chat-message.assistant .message-content {
  background: #e9ecef;
  color: #333;
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.ai-chat-message.typing .message-content {
  padding: 0.875rem 1.25rem;
}

/* Quick Actions */
.ai-quick-actions {
  padding: 0;
}

.ai-quick-actions small {
  font-size: 0.8125rem;
  color: #6c757d;
}

.ai-quick-action {
  font-size: 0.8125rem;
  border-radius: 20px;
  padding: 0.375rem 0.875rem;
  transition: all 0.2s ease;
}

.ai-quick-action:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Modal Footer Input */
#ai-assistant-modal .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
}

#ai-assistant-modal .input-group {
  border-radius: 8px;
  overflow: hidden;
}

#ai-chat-input {
  border: 1px solid #dee2e6;
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
}

#ai-chat-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.15);
}

/* Responsive AI Components */
@media (max-width: 768px) {
  .ask-ai-assistant-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
  }
  
  .ai-insights-section {
    padding: 1.5rem !important;
  }
  
  #ai-assistant-modal .modal-dialog {
    margin: 0.5rem;
  }
  
  .ai-chat-messages-container {
    max-height: 300px;
  }
  
  .ai-chat-message .message-content {
    max-width: 85%;
    font-size: 0.8125rem;
  }
  
  .audit-stage-selector {
    display: none;
  }
  
  .d-flex.align-items-center.gap-3 {
    flex-direction: column;
    gap: 0.75rem !important;
    align-items: flex-start !important;
  }
}

@media (max-width: 576px) {
  #ai-assistant-modal .modal-dialog {
    max-width: 100%;
    margin: 0;
  }
  
  #ai-assistant-modal .modal-content {
    border-radius: 0;
    min-height: 100vh;
  }
  
  .ai-chat-messages-container {
    max-height: calc(100vh - 300px);
  }
  
  .ai-chat-message .message-content {
    max-width: 90%;
  }
}
/* Enhanced Dashboard Stat Cards */
.dashboard-stat-card {
  position: relative;
  border-radius: 16px;
  padding: 1.5rem;
  color: white;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: all 0.3s ease;
}

.dashboard-stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.stat-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

.stat-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon-wrapper {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.stat-icon-wrapper i {
  opacity: 0.9;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 0.25rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  opacity: 0.95;
}

.stat-subtitle {
  font-size: 0.75rem;
  margin: 0.25rem 0 0 0;
  opacity: 0.75;
}

.stat-footer {
  position: relative;
  z-index: 1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-link {
  color: white !important;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.stat-link:hover {
  opacity: 1;
  text-decoration: none;
}

.compliance-bar-wrapper {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.compliance-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Responsive adjustments for stat cards */
@media (max-width: 768px) {
  .dashboard-stat-card {
    min-height: 150px;
    padding: 1.25rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .stat-icon-wrapper {
    padding: 0.75rem;
  }
  
  .stat-icon-wrapper i {
    font-size: 1.5rem !important;
  }
}
