/* Enhanced PCPartify Styles - Modern UI Design with Fixed Color Contrast */
:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --info-color: #06b6d4;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
  --surface-color: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.display-4 {
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Navbar styling */
.navbar-dark {
  background: linear-gradient(135deg, var(--dark-color) 0%, #334155 100%) !important;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
  width: 80%;
}

/* Card styling */
.card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface-color);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

/* FIXED: Dark feature cards with proper text contrast */
.feature-card {
  background: linear-gradient(135deg, var(--dark-color) 0%, #334155 100%) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card h3,
.feature-card h4,
.feature-card h5,
.feature-card .card-title {
  color: white !important;
  font-weight: 600;
}

.feature-card p,
.feature-card .card-text {
  color: rgba(255, 255, 255, 0.9) !important;
  line-height: 1.6;
}

.feature-card:hover {
  background: linear-gradient(135deg, #334155 0%, #475569 100%) !important;
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

/* Icon wrapper for feature cards */
.feature-card .icon-wrapper {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 auto 1.5rem auto;
}

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

.card-header {
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  background: linear-gradient(135deg, var(--light-color) 0%, #ffffff 100%);
  padding: 1.25rem 1.5rem;
}

.card-header.bg-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%) !important;
  color: white;
  border-bottom: none;
}

.card-header.bg-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
  color: white;
  border-bottom: none;
}

.card-header.bg-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%) !important;
  color: white;
  border-bottom: none;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: var(--light-color);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

/* Button styling */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: 0.625rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #3730a3 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.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(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-outline-secondary:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
}

/* Form styling */
.form-control {
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background: var(--surface-color);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Table styling with better contrast */
.table {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.table th {
  font-weight: 600;
  background: linear-gradient(135deg, var(--light-color) 0%, #ffffff 100%);
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
}

.table-hover tbody tr {
  transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  transform: scale(1.01);
}

/* Dark table variant for better contrast */
.table-dark {
  background: var(--dark-color);
  color: white;
}

.table-dark th {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  color: white;
  border-bottom: 2px solid #475569;
}

.table-dark td {
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #475569;
}

.table-dark tbody tr:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
}

/* Alert styling */
.alert {
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid;
  box-shadow: var(--shadow-md);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
  color: var(--danger-color);
  border-left-color: var(--danger-color);
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
  color: var(--success-color);
  border-left-color: var(--success-color);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
  color: var(--warning-color);
  border-left-color: var(--warning-color);
}

.alert-info {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(8, 145, 178, 0.05) 100%);
  color: var(--info-color);
  border-left-color: var(--info-color);
}

/* Progress bar */
.progress {
  height: 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--border-color);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
  transition: width 0.6s ease;
}

/* Badge styling with better contrast */
.badge {
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  color: white;
}

.badge.bg-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
  color: white;
}

.badge.bg-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%) !important;
  color: white;
}

.badge.bg-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
  color: white;
}

.badge.bg-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%) !important;
  color: white;
}

.badge.bg-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%) !important;
  color: white;
}

.badge.bg-secondary {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%) !important;
  color: white;
}

/* Footer styling */
footer {
  background: linear-gradient(135deg, var(--dark-color) 0%, #334155 100%) !important;
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  text-decoration: none;
}

footer a:hover {
  color: var(--primary-color);
  transform: translateY(-1px);
}

/* Utility classes */
.text-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.text-white {
  color: white !important;
}

.text-light {
  color: rgba(255, 255, 255, 0.9) !important;
}

.shadow-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl) !important;
}

.icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.icon-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: inherit;
}

/* Container improvements */
.container {
  max-width: 1200px;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 1rem;
  }
  
  .icon-wrapper {
    width: 64px;
    height: 64px;
  }
  
  .feature-card .card-body {
    padding: 1.5rem 1rem;
  }
  
  .feature-card h3,
  .feature-card h4 {
    font-size: 1.25rem;
  }
}

/* Animation classes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* RTL support */
[dir="rtl"] .me-3 {
  margin-right: 0 !important;
  margin-left: 1rem !important;
}

[dir="rtl"] .ms-3 {
  margin-left: 0 !important;
  margin-right: 1rem !important;
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.card:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
  
  .feature-card {
    border: 2px solid white !important;
  }
  
  .table {
    border: 2px solid var(--text-primary);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== ENHANCED MOBILE RESPONSIVENESS ===== */

/* Mobile Navigation Improvements */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding: 1rem 0;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin: 0.25rem 0;
    transition: all 0.3s ease;
  }
  
  .navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(8px);
  }
  
  .navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
  }
}

/* Enhanced Table Responsiveness */
@media (max-width: 767.98px) {
  /* Stack table layout for mobile */
  .table-responsive-stack table,
  .table-responsive-stack thead,
  .table-responsive-stack tbody,
  .table-responsive-stack th,
  .table-responsive-stack td,
  .table-responsive-stack tr {
    display: block;
  }
  
  .table-responsive-stack thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .table-responsive-stack tbody tr {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    position: relative;
  }
  
  .table-responsive-stack tbody tr:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    transition: all 0.3s ease;
  }
  
  .table-responsive-stack tbody td {
    border: none;
    padding: 0.75rem 0;
    position: relative;
    padding-left: 40% !important;
    text-align: right;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--text-primary);
  }
  
  .table-responsive-stack tbody td::before {
    content: attr(data-label) ":";
    position: absolute;
    left: 0;
    width: 35%;
    padding-right: 1rem;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    display: flex;
    align-items: center;
  }
  
  .table-responsive-stack tbody td:first-child {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    color: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: -1rem -1rem 0.5rem -1rem;
    padding: 1rem !important;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    justify-content: center;
  }
  
  .table-responsive-stack tbody td:first-child::before {
    display: none;
  }
  
  /* Mobile-specific button styling */
  .table-responsive-stack .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Mobile badge styling */
  .table-responsive-stack .badge {
    display: inline-block;
    width: auto;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Mobile Card Improvements */
@media (max-width: 575.98px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
  
  .card-header {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .card-footer {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .card-footer .row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .card-footer .col-md-6 {
    text-align: center !important;
  }
  
  /* Mobile button groups */
  .btn-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  .btn-group-mobile .btn {
    width: 100%;
    margin: 0;
  }
  
  /* Mobile form improvements */
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
  
  .input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .input-group .form-control,
  .input-group .btn {
    border-radius: var(--radius-md) !important;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px; /* Apple's recommended touch target size */
    padding: 0.75rem 1.5rem;
  }
  
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .table-responsive-stack tbody tr {
    margin-bottom: 1.5rem;
  }
  
  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  
  .btn:hover::before {
    left: -100%;
  }
}

/* Print styles */
@media print {
  .navbar,
  .btn,
  .card-footer {
    display: none !important;
  }
  
  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
  
  .feature-card {
    background: white !important;
    color: black !important;
  }
  
  .table-responsive-stack table {
    display: table !important;
  }
  
  .table-responsive-stack thead {
    display: table-header-group !important;
  }
  
  .table-responsive-stack tbody {
    display: table-row-group !important;
  }
  
  .table-responsive-stack tr {
    display: table-row !important;
  }
  
  .table-responsive-stack td,
  .table-responsive-stack th {
    display: table-cell !important;
  }
}
