/* ============================================
   Certoria - App Styles
   Brand: Blue (#0d6efd) with clean, simple design
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary-blue: #0d6efd;
  --primary-blue-dark: #0a58ca;
  --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.125);
  --border-radius: 0.5rem;
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.2s ease-in-out;
}

/* ---------- Base Layout ---------- */
.container {
  max-width: 960px;
}

.pricing-header {
  max-width: 700px;
}

/* Main content wrapper - ensures footer stays at bottom */
.main-content {
  min-height: calc(100vh - 250px);
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

/* Apply subtle fade-in to main content */
.container > *:first-child {
  animation: fadeIn 0.25s ease-out;
}

/* ---------- Cards ---------- */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

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

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

/* Card wrapper for content sections */
.content-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ---------- Tables ---------- */
.table-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-card .table {
  margin-bottom: 0;
}

.table {
  --bs-table-hover-bg: rgba(13, 110, 253, 0.04);
}

.table > thead {
  background-color: #f8f9fa;
}

.table > thead th {
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #6c757d;
  border-bottom: 2px solid #dee2e6;
  padding: 0.875rem 0.75rem;
}

.table > tbody > tr {
  transition: background-color var(--transition-fast);
}

.table > tbody > tr:hover {
  background-color: var(--bs-table-hover-bg);
}

.table > tbody td {
  padding: 0.875rem 0.75rem;
  vertical-align: middle;
}

/* Responsive table improvements */
@media (max-width: 768px) {
  .table > thead th,
  .table > tbody td {
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
  }
  
  .table-card {
    border-radius: 0;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
}

/* ---------- Status Badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 50rem;
  font-size: 0.8125rem;
  font-weight: 500;
  gap: 0.375rem;
  white-space: nowrap;
}

.status-badge-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.status-badge-warning {
  background-color: rgba(255, 193, 7, 0.15);
  color: #997404;
}

.status-badge-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* Pulse animation for expiring soon */
.status-badge-warning {
  animation: pulse 2s infinite;
}

/* ---------- Buttons ---------- */
.btn {
  transition: all var(--transition-normal);
  font-weight: 500;
}

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

.btn-primary:hover {
  background: var(--primary-blue-dark);
  border-color: var(--primary-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-primary:active,
.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

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

.btn-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ---------- Forms ---------- */
.form-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
  animation: fadeInUp 0.3s ease-out;
}

.form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.375rem;
}

/* ---------- Page Headers ---------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  margin-bottom: 0;
  font-weight: 600;
  color: #212529;
  font-size: 1.75rem;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-header-actions {
    width: 100%;
  }
  
  .page-header-actions .btn {
    flex: 1;
  }
}

/* ---------- Divider ---------- */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #dee2e6;
}

.divider-text {
  padding: 0 1rem;
  font-size: 0.875rem;
}

/* ---------- Links ---------- */
a {
  transition: color var(--transition-fast);
}

.action-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.action-link:hover {
  color: var(--primary-blue);
}

.action-link.text-danger:hover {
  color: #b02a37;
}

/* ---------- Profile Page ---------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* ---------- Sign In / Sign Up Pages ---------- */
.auth-container {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.4s ease-out;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-card .form-control {
  padding: 0.75rem 1rem;
}

@media (max-width: 576px) {
  .auth-card {
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
  }
}

/* ---------- Flash Messages ---------- */
.alert {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease-out;
}

/* ---------- Modal Improvements ---------- */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.modal.fade .modal-dialog {
  transition: transform 0.2s ease-out;
}

/* ---------- Navbar Enhancements ---------- */
.navbar .nav-link {
  transition: color var(--transition-fast), background-color var(--transition-fast);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem !important;
  margin: 0 0.125rem;
}

.navbar-dark .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .nav-link.active,
.navbar-dark .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.15);
}

/* ---------- Footer Enhancements ---------- */
@media (max-width: 768px) {
  footer .row {
    text-align: center;
  }
  
  footer .col-md-4 {
    margin-bottom: 1rem;
  }
  
  footer .list-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
}

/* ---------- Utility Classes ---------- */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.25rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background-color: rgba(13, 110, 253, 0.2);
  color: inherit;
}

/* ============================================
   Landing Page Styles
   ============================================ */

.landing-hero {
  padding-top: 60px;
  padding-bottom: 120px;
  min-height: 80vh;
}

.landing-hero h1 {
  line-height: 1.2;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.landing-hero .text-muted-emphasis {
  color: #6c757d;
}

.landing-section {
  padding: 100px 20px;
}

.landing-section-alt {
  background-color: #f8f9fa;
}

.landing-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.landing-prose {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #495057;
}

.landing-prose p {
  margin-bottom: 1.5rem;
}

/* Step indicators */
.step-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Feature cards on landing */
.feature-card {
  padding: 1.5rem;
  height: 100%;
  border-radius: var(--border-radius);
  transition: background-color var(--transition-normal);
}

.feature-card:hover {
  background-color: #f8f9fa;
}

.feature-card h3 {
  font-size: 1.25rem;
}

/* Testimonial cards */
.testimonial-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.testimonial-card blockquote {
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* CTA section */
.landing-cta {
  background: var(--primary-gradient);
  padding: 100px 20px;
  color: #fff;
}

.landing-cta h2 {
  color: #fff;
}

.landing-cta .btn-light {
  font-weight: 600;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.landing-cta .btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Technical features grid */
.tech-feature {
  text-align: center;
  padding: 1.5rem;
}

.tech-feature i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-blue);
}

.tech-feature h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Accordion improvements */
.accordion-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius) !important;
  overflow: hidden;
}

.accordion-button:not(.collapsed) {
  background-color: rgba(13, 110, 253, 0.05);
  color: var(--primary-blue);
}

.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.125);
}

.accordion-body {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- Certificate History Timeline ---------- */
.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.timeline-item {
  position: relative;
  padding-left: 4rem;
  padding-bottom: 2rem;
  margin-bottom: 1rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 0 0 4px #fff;
  z-index: 1;
}

.timeline-content {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.timeline-content h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.event-details dt {
  font-weight: 600;
  color: #6c757d;
  font-size: 0.875rem;
}

.event-details dd {
  margin-bottom: 0.5rem;
  color: #212529;
}
