/* ===================================
   VISUAL ENHANCEMENTS - STEVE JOBS LEVEL
   Modern shadows, depth, animations, and polish
   =================================== */

/* ===================================
   1. MODERN SHADOW SYSTEM
   Based on Material Design and Apple HIG
   =================================== */

:root {
  /* Shadow levels */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* Colored shadows */
  --shadow-primary: 0 10px 25px -5px rgba(0, 113, 227, 0.25);
  --shadow-success: 0 10px 25px -5px rgba(16, 185, 129, 0.25);
  --shadow-warning: 0 10px 25px -5px rgba(245, 158, 11, 0.25);
  --shadow-danger: 0 10px 25px -5px rgba(239, 68, 68, 0.25);

  /* Transition timings */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Blur effects */
  --blur-sm: blur(4px);
  --blur-md: blur(8px);
  --blur-lg: blur(16px);
  --blur-xl: blur(24px);
}

/* ===================================
   2. ENHANCED CARD STYLES
   =================================== */

.stat-card,
.project-card,
.card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before,
.project-card::before,
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

.stat-card:hover,
.project-card:hover,
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.stat-card:hover::before,
.project-card:hover::before,
.card:hover::before {
  transform: scaleX(1);
}

/* ===================================
   3. ENHANCED BUTTONS
   =================================== */

button,
.button,
.btn-primary,
.btn-secondary,
.action-btn {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

button:hover,
.button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.action-btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

button:active,
.button:active,
.btn-primary:active,
.btn-secondary:active,
.action-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* Ripple effect */
button::after,
.button::after,
.btn-primary::after,
.action-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::after,
.button:active::after,
.btn-primary:active::after,
.action-btn:active::after {
  width: 300px;
  height: 300px;
}

/* ===================================
   4. GLASS MORPHISM EFFECTS
   =================================== */

nav,
.header {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modal-content,
.exit-modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-2xl);
}

/* ===================================
   5. SMOOTH ANIMATIONS
   =================================== */

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Apply animations */
.stat-card,
.project-card,
.card {
  animation: fadeIn var(--transition-slow) ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 100ms; }
.stat-card:nth-child(3) { animation-delay: 200ms; }
.stat-card:nth-child(4) { animation-delay: 300ms; }

.project-card:nth-child(1) { animation-delay: 0ms; }
.project-card:nth-child(2) { animation-delay: 100ms; }
.project-card:nth-child(3) { animation-delay: 200ms; }

/* ===================================
   6. ENHANCED INPUT FIELDS
   =================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
  border: 2px solid #E9E9E7;
  border-radius: 8px;
  padding: 12px 16px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), var(--shadow-sm);
  transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
textarea:hover,
select:hover {
  border-color: #D1D1CF;
  box-shadow: var(--shadow-sm);
}

/* ===================================
   7. ENHANCED STATISTICS TILES
   =================================== */

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 60px 0;
}

.stat-box {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
  transform: scale(0);
  transition: transform var(--transition-slow);
}

.stat-box:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.stat-box:hover::before {
  transform: scale(1);
}

.stat-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.stat-title {
  font-size: 2rem;
  font-weight: 700;
  color: #37352F;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-description {
  font-size: 1rem;
  color: #6B6B66;
  line-height: 1.5;
}

/* ===================================
   8. ENHANCED HERO SECTION
   =================================== */

.hero h1 {
  background: linear-gradient(135deg, #37352F 0%, #667eea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 0.8s ease-out;
}

.hero p {
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.hero .cta-buttons {
  animation: fadeIn 0.8s ease-out 0.4s both;
}

/* ===================================
   9. LOADING STATES
   =================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: 8px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===================================
   10. ENHANCED NAVIGATION
   =================================== */

.nav-links a {
  position: relative;
  padding-bottom: 4px;
}

.nav-links a:not(.btn-primary)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width var(--transition-base);
}

.nav-links a:not(.btn-primary):hover::after {
  width: 100%;
}

/* ===================================
   11. ENHANCED MODALS
   =================================== */

.modal-content,
.exit-modal-content {
  animation: scaleIn var(--transition-slow) ease-out;
}

.modal-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ===================================
   12. ENHANCED TABLES
   =================================== */

table {
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  overflow: hidden;
}

table tr {
  transition: all var(--transition-fast);
}

table tr:hover {
  background: rgba(102, 126, 234, 0.05);
  transform: scale(1.01);
}

table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 16px;
}

table td {
  padding: 16px;
  border-top: 1px solid #f0f0f0;
}

/* ===================================
   13. ENHANCED BADGES & TAGS
   =================================== */

.badge,
.tag,
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.badge:hover,
.tag:hover,
.status-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

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

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

.badge-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

/* ===================================
   14. ENHANCED TOOLTIPS
   =================================== */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ===================================
   15. ENHANCED SCROLLBARS
   =================================== */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ===================================
   16. ENHANCED IMAGES
   =================================== */

img {
  transition: all var(--transition-slow);
}

img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.image-wrapper:hover::after {
  opacity: 1;
}

/* ===================================
   17. ENHANCED PROGRESS BARS
   =================================== */

.progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-inner);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* ===================================
   18. ENHANCED ALERTS & NOTIFICATIONS
   =================================== */

.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin: 16px 0;
  box-shadow: var(--shadow-md);
  animation: slideInRight var(--transition-slow);
  border-left: 4px solid;
}

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

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

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

.alert-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
  border-left-color: #3b82f6;
  color: #1e40af;
}

/* ===================================
   19. ENHANCED GRID LAYOUTS
   =================================== */

.grid {
  display: grid;
  gap: 24px;
  animation: fadeIn var(--transition-slow);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ===================================
   20. MOBILE OPTIMIZATIONS
   =================================== */

@media (max-width: 768px) {
  .stat-box {
    padding: 24px;
  }

  .stat-icon {
    font-size: 2.5rem;
  }

  .stat-title {
    font-size: 1.75rem;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  /* Reduce motion on mobile for performance */
  * {
    animation-duration: 0.3s !important;
  }
}

/* ===================================
   21. ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #667eea;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  transition: top var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.skip-to-main:focus {
  top: 20px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  * {
    border-width: 2px !important;
  }

  .btn-primary,
  .button {
    border: 2px solid currentColor !important;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark mode support (future-proof) */
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  }
}
