/* Digital Democracy Custom Styles */

/* Root variables for civic theme colors */
:root {
  --civic-primary: #1e40af;
  --civic-secondary: #64748b;
  --civic-accent: #dc2626;
  --civic-success: #059669;
  --civic-warning: #d97706;
  --civic-info: #0284c7;
  --civic-light: #f8fafc;
  --civic-dark: #0f172a;
  --civic-border: #e2e8f0;
}

/* Custom utility classes for civic engagement theme */
.text-civic-primary { color: var(--civic-primary) !important; }
.text-civic-secondary { color: var(--civic-secondary) !important; }
.bg-civic-primary { background-color: var(--civic-primary) !important; }
.bg-civic-light { background-color: var(--civic-light) !important; }
.border-civic { border-color: var(--civic-border) !important; }

/* Enhanced navbar for civic appeal */
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.025em;
}

.navbar-brand i {
  color: #fbbf24;
}

/* Active navigation highlighting */
.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff !important;
  font-weight: 600;
  border-radius: 0.375rem;
  position: relative;
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background-color: var(--civic-primary);
  border-radius: 1px;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

/* Profile image consistency */
.navbar .rounded-circle {
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: border-color 0.2s ease;
}

.navbar .rounded-circle:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

/* Card enhancements for better readability */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Badge improvements for political parties */
.badge.bg-primary { background-color: var(--civic-primary) !important; }
.badge.bg-danger { background-color: var(--civic-accent) !important; }

/* Button enhancements */
.btn {
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

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

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

/* Form improvements */
.form-control {
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--civic-primary);
  box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
}

.form-select {
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Alert enhancements */
.alert {
  border-radius: 0.75rem;
  border: none;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(5, 150, 105, 0.1);
  color: #059669;
  border-left: 4px solid #059669;
}

.alert-info {
  background-color: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  border-left: 4px solid #0284c7;
}

.alert-warning {
  background-color: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border-left: 4px solid #d97706;
}

.alert-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-left: 4px solid #dc2626;
}

/* Hero section styling */
.display-4 {
  font-weight: 800;
  letter-spacing: -0.025em;
}

.lead {
  font-weight: 400;
  opacity: 0.9;
}

/* Navigation tabs enhancement */
.nav-tabs .nav-link {
  border-radius: 0.5rem 0.5rem 0 0;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.nav-tabs .nav-link.active {
  background-color: var(--bs-body-bg);
  border-color: var(--civic-primary) var(--civic-primary) var(--bs-body-bg);
  color: var(--civic-primary);
}

.nav-pills .nav-link {
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-pills .nav-link.active {
  background-color: var(--civic-primary);
}

/* Footer styling */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Loading states */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }
  
  .lead {
    font-size: 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
}

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

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--civic-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
  
  .btn-outline-primary {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .card,
  .btn,
  .form-control,
  .nav-link {
    transition: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .btn-primary:hover {
    transform: none;
  }
}

/* Print styles */
@media print {
  .navbar,
  .btn,
  footer {
    display: none !important;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
  
  .container {
    max-width: none;
  }
}

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

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

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--civic-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1d4ed8;
}

/* Enhanced focus indicators for better accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--civic-primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#sidebar-wrapper {
    width: 16rem;
    background-color: #0d1117 !important;
}

#sidebar-wrapper .list-group-item-dark {
    background-color: #0d1117 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    white-space: nowrap !important;
}

#sidebar-wrapper .list-group-item-dark:hover {
    background-color: #1f2937 !important;
}

/* Remove default validation icons (green ticks) from form controls */
.form-control:valid, .form-control.is-valid {
    background-image: none !important;
    padding-right: 0.75rem !important; /* Reset padding reserved for icon */
}
