/**
 * Healthcare Insurance Data Analysis System - Styles
 * A modern, responsive design for the healthcare data analysis interface
 */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #0066cc;
  --secondary-color: #f8f9fa;
  --accent-color: #17a2b8;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --success-color: #28a745;
  --dark-color: #343a40;
  --light-color: #f8f9fa;
  --border-radius: 0.375rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition: all 0.15s ease-in-out;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--secondary-color);
  color: var(--dark-color);
  line-height: 1.5;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  padding: 1rem 0;
  text-align: center;
  box-shadow: var(--box-shadow);
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Sections */
section {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
}

section h2 {
  margin-top: 0;
  color: var(--primary-color);
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

/* Welcome Section */
#welcome-section {
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

#welcome-section p {
  font-size: 1.1rem;
  margin: 1.5rem 0;
  color: #6c757d;
}

/* Buttons */
button, .btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

button:hover, .btn:hover {
  background-color: #0052a3;
  transform: translateY(-1px);
}

button:active, .btn:active {
  transform: translateY(0);
}

button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
}

/* File Upload */
.dropzone {
  border: 2px dashed var(--primary-color);
  border-radius: var(--border-radius);
  padding: 3rem 2rem;
  text-align: center;
  background: #f8f9ff;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.active {
  border-color: var(--accent-color);
  background: #f0f8ff;
}

.dropzone input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone p {
  margin: 0;
  color: var(--primary-color);
  font-weight: 500;
}

/* Progress Bar */
.progress {
  background-color: #e9ecef;
  border-radius: var(--border-radius);
  height: 1rem;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  background-color: var(--primary-color);
  height: 100%;
  border-radius: var(--border-radius);
  transition: width 0.3s ease;
}

.progress-thin {
  height: 0.25rem;
  margin: 0.5rem 0;
}

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

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

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

#dashboard-stats > div {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: var(--box-shadow);
}

/* Charts */
canvas {
  max-width: 100%;
  height: 400px !important;
  margin: 2rem 0;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* Rejection Reasons */
#rejection-reasons-container {
  margin-top: 2rem;
}

.rejection-reason {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  border: 1px solid #dee2e6;
}

.rejection-reason .d-flex {
  display: flex;
}

.rejection-reason .justify-content-between {
  justify-content: space-between;
}

.rejection-reason .align-items-center {
  align-items: center;
}

/* Forms */
form {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
}

form > div {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

label input[type="radio"],
label input[type="checkbox"] {
  margin-right: 0.5rem;
}

input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Reports */
.list-group {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-group-item {
  display: block;
  padding: 1rem;
  background: white;
  border: 1px solid #dee2e6;
  text-decoration: none;
  color: var(--dark-color);
  transition: var(--transition);
}

.list-group-item:not(:first-child) {
  border-top: none;
}

.list-group-item:first-child {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.list-group-item:last-child {
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.list-group-item:only-child {
  border-radius: var(--border-radius);
}

.list-group-item:hover {
  background: #f8f9fa;
  transform: translateX(4px);
}

.list-group-item h6 {
  margin: 0 0 0.25rem 0;
  color: var(--primary-color);
}

.list-group-item small {
  color: #6c757d;
}

/* Footer Navigation */
footer {
  background: var(--dark-color);
  color: white;
  padding: 1rem 0;
  margin-top: 3rem;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.navbar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.navbar-nav li {
  margin: 0 1rem;
}

.navbar-nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--primary-color);
}

/* Utility Classes */
.text-muted {
  color: #6c757d !important;
}

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

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

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

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

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    padding: 0 0.5rem;
  }
  
  section {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  #dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .navbar-nav {
    flex-direction: column;
    align-items: center;
  }
  
  .navbar-nav li {
    margin: 0.25rem 0;
  }
  
  canvas {
    height: 300px !important;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }
  
  .dropzone {
    padding: 2rem 1rem;
  }
  
  button, .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
  }
  
  header, footer {
    display: none;
  }
  
  section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}
