/* SecurePass Student - Custom Styles */

/* Brand Colors and Variables */
:root {
  --brand-primary: #3b82f6;
  --brand-secondary: #8b5cf6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Global Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

.animate-bounce-in {
  animation: bounceIn 0.6s ease-out;
}

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

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Enhanced Button Styles */
.btn-gradient {
  background: var(--gradient-primary);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.5);
}

.btn-success {
  background: var(--gradient-success);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.4);
}

/* Card Enhancements */
.card-elevated {
  box-shadow: var(--shadow-elevated);
  transition: all 0.3s ease;
}

.card-elevated:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Progress Bars */
.progress-bar {
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 9999px;
  transition: width 0.5s ease-in-out;
}

.xp-progress {
  background: linear-gradient(90deg, #f59e0b, #eab308);
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Level Indicator */
.level-circle {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  position: relative;
}

.level-circle::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg, var(--brand-primary), var(--brand-secondary), var(--brand-primary));
  border-radius: 50%;
  z-index: -1;
}

/* Password Strength Indicators */
.strength-very-weak {
  background-color: #dc2626;
}

.strength-weak {
  background-color: #ea580c;
}

.strength-fair {
  background-color: #ca8a04;
}

.strength-good {
  background-color: #2563eb;
}

.strength-strong {
  background-color: #059669;
}

/* Security Score Circle */
.security-score {
  background: conic-gradient(
    from 0deg,
    #dc2626 0% 20%,
    #ea580c 20% 40%,
    #ca8a04 40% 60%,
    #2563eb 60% 80%,
    #059669 80% 100%
  );
  border-radius: 50%;
  padding: 3px;
  display: inline-block;
}

.security-score-inner {
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Modal Enhancements */
.modal-backdrop {
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Form Enhancements */
.form-input {
  transition: all 0.3s ease;
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  border-color: var(--brand-primary);
}

/* Navigation Enhancements */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* Gamification Elements */
.achievement-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.xp-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Breach Alert Styles */
.breach-alert {
  animation: alertPulse 1s ease-in-out;
}

@keyframes alertPulse {
  0%, 100% {
    background-color: rgba(239, 68, 68, 0.05);
  }
  50% {
    background-color: rgba(239, 68, 68, 0.1);
  }
}

.breach-high {
  border-left: 4px solid #dc2626;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.1) 0%, transparent 100%);
}

.breach-medium {
  border-left: 4px solid #ea580c;
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.1) 0%, transparent 100%);
}

.breach-low {
  border-left: 4px solid #ca8a04;
  background: linear-gradient(90deg, rgba(202, 138, 4, 0.1) 0%, transparent 100%);
}

/* Loading States */
.loading-spinner {
  border: 2px solid #e5e7eb;
  border-top: 2px solid var(--brand-primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

/* Responsive Enhancements */
@media (max-width: 768px) {
  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-menu {
    display: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
.focus-visible:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .btn-gradient {
    border: 2px solid currentColor;
  }
  
  .card-elevated {
    border: 1px solid #64748b;
  }
}

/* Custom Utilities */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
}