/*
PyCVTool Main Stylesheet
Based on Level template (Tooplate 2095)
*/

/* === Variables (Level Template Color Palette) === */
:root {
  --primary-color: #ee5057;
  --primary-hover: #d53239;
  --dark-blue: #1f3646;
  --bg-gray: #f4f4f4;
  --text-gray: #898989;
  --border-gray: #cccccc;
  --white: #ffffff;
}

/* === Base Styles === */
body {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-gray);
  line-height: 1.9;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #333;
}

a {
  transition: all 0.3s ease;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* === Navigation === */
.tm-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.2s ease-in-out;
  height: 80px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tm-top-bar-bg {
  height: 80px;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-blue);
}

.navbar-brand i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.nav-item {
  border-left: 1px solid var(--border-gray);
  transition: all 0.5s ease;
}

.nav-item:last-child {
  border-right: 1px solid var(--border-gray);
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 300;
  text-transform: uppercase;
  padding: 1rem 2rem !important;
  color: #333;
}

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

.navbar-toggler {
  border-color: var(--primary-color);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%23ee5057' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}

/* === Buttons === */
.btn {
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 13px 30px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

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

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

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

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

/* === Sections === */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-section h1 {
  color: var(--white);
}

.hero-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.features-section {
  background: var(--bg-gray);
}

.feature-card {
  background: var(--white);
  padding: 2rem;
  text-align: center;
  box-shadow: 0px 0px 7px 0px rgba(214, 214, 214, 1);
  transition: transform 0.3s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.feature-card h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--dark-blue);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-gray);
}

/* === Status Section === */
.status-section {
  background: var(--white);
}

.status-card {
  background: var(--white);
  padding: 2rem;
  border: 1px solid var(--border-gray);
  box-shadow: 0px 0px 7px 0px rgba(214, 214, 214, 1);
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bg-gray);
}

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

.status-label {
  font-weight: 600;
  color: var(--dark-blue);
}

.status-value {
  font-family: 'Courier New', monospace;
}

.status-value.healthy {
  color: #28a745;
}

.status-value.unhealthy {
  color: #dc3545;
}

/* === Footer === */
.footer {
  background: var(--dark-blue);
}

/* === Form Controls === */
.form-control {
  border-radius: 0;
  padding: 0.6rem 0.75rem;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(238, 80, 87, 0.25);
}

/* === Utilities === */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

/* === SPA-specific Styles === */

/* Consultant Cards */
.consultant-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.consultant-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Section Cards with Drag and Drop */
.section-card {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

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

.section-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.section-card[draggable="true"] {
  cursor: move;
}

.section-content-preview {
  max-height: 100px;
  overflow: hidden;
}

/* Loading States */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

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

/* Alert Messages */
#messages .alert {
  border-radius: 0;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

#messages .alert-success {
  border-left-color: #28a745;
}

#messages .alert-danger {
  border-left-color: #dc3545;
}

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

/* Form Validation */
.form-control.is-invalid {
  border-color: #dc3545;
}

.invalid-feedback {
  display: block;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Button Loading States */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Modal Enhancements */
.modal-content {
  border-radius: 0;
  border: none;
}

.modal-header {
  background-color: var(--bg-gray);
  border-bottom: 2px solid var(--primary-color);
}

.modal-footer {
  background-color: var(--bg-gray);
  border-top: 1px solid var(--border-gray);
}

/* Cards */
.card {
  border-radius: 0;
}

.card-header {
  background-color: var(--bg-gray);
  border-bottom: 2px solid var(--primary-color);
  font-weight: 600;
}

/* Empty States */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state i {
  opacity: 0.5;
}

/* Navbar Active State */
.navbar .nav-link.active {
  background-color: var(--primary-color);
  color: white !important;
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Responsive Improvements */
@media (max-width: 991px) {
  .nav-item {
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-gray);
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
  }

  .tm-top-bar {
    height: auto;
  }

  /* Stack action buttons vertically on mobile */
  .card-footer .d-flex {
    flex-direction: column;
  }

  .card-footer .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Reduce padding on mobile */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Make modals full-screen on mobile */
  .modal-dialog {
    margin: 0;
    max-width: 100%;
  }

  .modal-content {
    min-height: 100vh;
  }
}

@media (max-width: 576px) {
  /* Smaller button text on mobile */
  .btn {
    font-size: 0.65rem;
    padding: 10px 20px;
  }

  /* Reduce heading sizes */
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Stack consultant cards */
  .consultant-card {
    margin-bottom: 1rem;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .card-footer,
  #messages,
  .modal {
    display: none !important;
  }

  .card {
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  body {
    font-size: 12pt;
  }
}
