/**
 * Modern Styles - Armaan Virani Portfolio
 * Implementing recommendations for modern design best practices
 */

/* ===== 1. MODERNIZED COLOR SCHEME ===== */
:root {
  /* Modern color palette with better contrast */
  --primary: #2563eb;         /* More vibrant blue */
  --primary-dark: #1d4ed8;    /* Accessible contrast for text */
  --primary-light: #93c5fd;   /* For subtle highlights */
  --secondary: #f0f9ff;       /* Slightly warmer background */
  --accent: #f97316;          /* Complementary orange accent */
  --accent-light: #ffedd5;    /* For subtle accents */
  --text: #1e293b;            /* Deeper text for better readability */
  --text-light: #64748b;      /* Improved contrast for secondary text */
  --bg: #ffffff;
  --bg-alt: #f8fafc;          /* Subtle texture for alternate backgrounds */
  --border: #e5e7eb;          /* Softer border color */
  --success: #10b981;         /* Success color for feedback */
  --error: #ef4444;           /* Error color for alerts */
  
  /* Color combinations for gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --gradient-accent: linear-gradient(135deg, var(--accent), #ea580c);
  
  /* Salesforce Lightning Design System Colors */
  --slds-color-brand: #0176d3;       /* Salesforce Blue */
  --slds-color-brand-dark: #014486;  /* Darker Blue for hover */
  --slds-color-brand-light: #d8edff; /* Light Blue for focus ring */
  
  /* Success Colors */
  --slds-color-success: #2e844a;     /* Green */
  --slds-color-success-dark: #194e31; /* Dark Green for hover */
  --slds-color-success-light: #cdefc4; /* Light Green for focus ring */
  
  /* Neutral Colors */
  --slds-color-neutral: #747474;     /* Gray */
  --slds-color-neutral-dark: #5c5c5c; /* Dark Gray for hover */
  --slds-color-neutral-light: #f3f3f3; /* Light Gray for disabled */

  /* ===== 2. ENHANCED SHADOW SYSTEM ===== */
  /* Layered shadows for more realistic depth */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03), 0 1px 1px rgba(0,0,0,0.02);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  
  /* Colored shadows for cards */
  --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.15);
  --shadow-accent: 0 4px 14px rgba(249, 115, 22, 0.15);

  /* ===== 9. WHITESPACE AND RHYTHM OPTIMIZATION ===== */
  /* Consistent spacing system */
  --space-xs: clamp(0.5rem, 0.5rem + 0.25vw, 0.75rem);
  --space-sm: clamp(0.75rem, 0.75rem + 0.5vw, 1rem);
  --space-md: clamp(1rem, 1rem + 0.75vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.5rem + 1vw, 2rem);
  --space-xl: clamp(2rem, 2rem + 1.5vw, 3rem);
  --space-2xl: clamp(3rem, 3rem + 2vw, 4rem);
  
  /* Border radius */
  --radius-xs: 0.25rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  
  /* Animation timings */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Animation properties */
  --transition-fast: 150ms;
  --transition-normal: 250ms;
  --transition-slow: 350ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== GLOBAL STYLES ===== */
body {
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
}

/* Improved focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
[role="button"]:focus,
[tabindex]:focus {
  outline: 3px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

/* ===== 4. MODERN LAYOUT TECHNIQUES ===== */

/* Modern container with max-width and auto margins */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Responsive grid system */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

/* Flexbox layouts */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

/* ===== NAVIGATION ===== */
.fixed-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
}

/* Navigation links with improved spacing and grouping */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Left cluster - Brand */
.nav-links a:first-child {
  margin-right: 1.5rem;
  font-weight: 600;
}

/* Right cluster - Stock Portfolio and Contact */
.nav-links a:nth-last-child(-n+2) {
  margin-left: 1.5rem;
}

/* Stock Portfolio link with lightning bolt icon */
.nav-links a[href*="stock-portfolio"]::before {
  content: '⚡';
  margin-right: 0.25rem;
  font-size: 0.85em;
}

.nav-links a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal) var(--ease-default);
  position: relative;
  letter-spacing: 0.5px;
}

/* Hover state with soft blue background */
.nav-links a:hover {
  color: var(--primary-dark);
  background-color: rgba(37, 99, 235, 0.08);
}

/* Active state with underline */
.nav-links a.active,
.nav-links a[aria-current="page"] {
  font-weight: 600;
  color: var(--primary-dark);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--primary);
  transition: width var(--transition-normal) var(--ease-default), 
              left var(--transition-normal) var(--ease-default);
}

.nav-links a:hover::after {
  width: 80%;
  left: 10%;
}

.nav-links a.active::after,
.nav-links a[aria-current="page"]::after {
  width: 80%;
  left: 10%;
}

/* ===== 5. BUTTON COMPONENT ENHANCEMENT - SALESFORCE LIGHTNING DESIGN SYSTEM INSPIRED ===== */

/* Base SLDS Button Styles */
.btn,
.resume-download-btn,
.hero-card-btn,
.btn-green,
.btn-instagram,
.btn-linkedin,
.timeline-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  height: 2.5rem;
  line-height: 2.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  transition: all 0.1s linear;
  position: relative;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0;
  border: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.05);
}

/* SLDS Standard Button (Neutral) */
.btn {
  background-color: white;
  border-color: #dddbda;
  color: #0176d3;
}

.btn:hover {
  background-color: #f3f3f3;
  color: #014486;
}

.btn:active {
  background-color: #eeeeee;
  border-color: #dddbda;
}

.btn:focus {
  box-shadow: 0 0 3px #0176d3;
  outline: none;
}

/* SLDS Brand Button (Blue) */
.btn-primary, 
.resume-download-btn, 
.hero-card-btn {
  background-color: var(--slds-color-brand);
  border-color: var(--slds-color-brand);
  color: white;
}

.btn-primary:hover, 
.resume-download-btn:hover, 
.hero-card-btn:hover {
  background-color: var(--slds-color-brand-dark);
  border-color: var(--slds-color-brand-dark);
  color: white;
}

.btn-primary:active, 
.resume-download-btn:active, 
.hero-card-btn:active {
  background-color: var(--slds-color-brand-dark);
  border-color: var(--slds-color-brand-dark);
  transform: scale(0.98);
}

.btn-primary:focus, 
.resume-download-btn:focus, 
.hero-card-btn:focus {
  box-shadow: 0 0 3px var(--slds-color-brand), 0 0 0 1px var(--slds-color-brand-light);
  outline: none;
}

/* SLDS Success Button (Green) */
.btn-green {
  background-color: var(--slds-color-success);
  border-color: var(--slds-color-success);
  color: white;
}

.btn-green:hover {
  background-color: var(--slds-color-success-dark);
  border-color: var(--slds-color-success-dark);
  color: white;
}

.btn-green:active {
  background-color: var(--slds-color-success-dark);
  border-color: var(--slds-color-success-dark);
  transform: scale(0.98);
}

.btn-green:focus {
  box-shadow: 0 0 3px var(--slds-color-success), 0 0 0 1px var(--slds-color-success-light);
  outline: none;
}

/* Social buttons with SLDS styling */
.btn-instagram {
  background-color: #e1306c;
  border-color: #e1306c;
  color: white;
}

.btn-instagram:hover {
  background-color: #c13584;
  border-color: #c13584;
}

.btn-instagram:focus {
  box-shadow: 0 0 3px #e1306c;
  outline: none;
}

.btn-linkedin {
  background-color: #0077b5;
  border-color: #0077b5;
  color: white;
}

.btn-linkedin:hover {
  background-color: #005e93;
  border-color: #005e93;
}

.btn-linkedin:focus {
  box-shadow: 0 0 3px #0077b5;
  outline: none;
}

/* Button with icon */
.btn-with-icon {
  padding-left: 0.75rem;
}

.btn-with-icon svg,
.btn-with-icon i {
  margin-right: 0.5rem;
}

/* Disabled button state */
.btn[disabled],
.btn-primary[disabled],
.btn-green[disabled],
.resume-download-btn[disabled],
.hero-card-btn[disabled] {
  background-color: var(--slds-color-neutral-light);
  border-color: #dddbda;
  color: #939393;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== 6. CARD COMPONENT ENHANCEMENT ===== */

/* Base card styles */
.card, 
.timeline-item, 
.cert-card, 
.words-grid > div, 
.hero-card,
.contact-card,
.about-container {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal) var(--ease-default);
  position: relative;
  border: 1px solid rgba(0,0,0,0.05);
}

/* Card hover effects */
.timeline-item:hover, 
.cert-card:hover, 
.words-grid > div:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* Card with accent border */
.card-accent {
  border-top: 4px solid var(--primary);
}

/* Card with hover highlight */
.card-highlight:before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--primary-light), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal) var(--ease-default);
  z-index: 0;
  pointer-events: none;
}

.card-highlight:hover:before {
  opacity: 0.05;
}

/* Card content padding */
.card-content,
.hero-card-content,
.about-content,
.exp-card-content {
  padding: var(--space-lg);
  position: relative;
  z-index: 1;
}

/* Hero card specific styles */
.hero-card {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-lg);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto var(--space-xl);
  position: relative;
  box-shadow: var(--shadow-card, var(--shadow-md));
  border-radius: var(--radius-lg);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 50%, var(--primary-light), transparent 60%);
  opacity: 0.07;
  z-index: 0;
  border-radius: var(--radius-lg);
}

.hero-card-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-card-image {
  width: 300px; /* Increased by ~40% */
  height: 300px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-primary);
  transition: all 0.4s var(--ease-bounce);
  position: relative;
}

.hero-card-image::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary-light);
  opacity: 0.5;
  z-index: -1;
}

.hero-card-image:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.hero-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: relative;
  z-index: 1;
}

.hero-card-name {
  font-size: 3.5rem;
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero-card-tagline {
  font-size: 1.35rem;
  line-height: 1.6;
  margin: var(--space-sm) 0 var(--space-lg);
  color: var(--text-light);
  max-width: 90%;
}

.hero-card-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 280px;
}

/* ===== SECTION STYLING ===== */
section {
  padding: var(--space-xl) 0;
  position: relative;
}

section h2 {
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* ===== TIMELINE SECTION ===== */
.timeline-container {
  display: flex;
  position: relative;
}

.timeline-bar {
  position: relative;
}

.timeline-bar-fill {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: var(--primary-light);
  border-radius: var(--radius-full);
}

.timeline-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: var(--radius-full);
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* ===== EXPERIENCE CARDS ===== */
.timeline-item {
  margin-bottom: var(--space-md);
  padding: var(--space-md);
}

.exp-card-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  background: white;
  padding: 0.5rem;
}

/* ===== ABOUT SECTION ===== */
.about-container {
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.about-list li {
  margin-bottom: var(--space-sm);
  position: relative;
  padding-left: var(--space-md);
}

.about-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.resume-download-container {
  margin-top: var(--space-lg);
  text-align: center;
}

/* ===== FOOTER ===== */
.site-footer {
  background-color: var(--bg-alt);
  padding: var(--space-xl) var(--space-md);
  margin-top: var(--space-2xl);
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--bg);
  color: var(--primary);
  transition: all var(--transition-normal) var(--ease-default);
}

.footer-link:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-3px);
}

/* ===== 7. OPTIMIZED CSS ORGANIZATION ===== */

/* Media Queries */
@media (min-width: 700px) {
  .nav-links {
    display: flex !important;
    flex-direction: row;
    position: static;
    width: auto;
    box-shadow: none;
    background: transparent;
    padding: 0;
    gap: var(--space-md);
  }
  
  .nav-hamburger {
    display: none;
  }
}

/* Hero section responsive styles */
@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }
  
  .hero-card-tagline {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-card-actions {
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .hero-card-image {
    width: 240px;
    height: 240px;
  }
  
  .hero-card-name {
    font-size: 2.5rem;
  }
  
  .hero-card-tagline {
    font-size: 1.2rem;
  }
}

@media (max-width: 700px) {
  .hide-on-mobile {
    display: none !important;
  }
  
  .nav-links {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
    background: white;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-md);
    z-index: 1001;
    padding: var(--space-md) 0;
    text-align: center;
  }
  
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-card-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  section h2::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  section h2 {
    display: block;
    text-align: center;
  }
  
  .footer-main {
    gap: var(--space-md);
  }
}

/* Performance optimizations */
.hero-video-bg,
.hero-card-video,
.carousel-track,
.timeline-item,
.exp-card,
.cert-card,
.cert-group-card,
.words-card {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

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

/* ===== TIMELINE FILTER STYLES ===== */
/* Timeline filter container and buttons - SLDS Style */
#timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
  justify-content: center;
}

.timeline-filter-btn {
  background-color: white;
  border: 1px solid #dddbda;
  color: var(--slds-color-brand);
  padding: 0 1rem;
  height: 2rem;
  line-height: 2rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.1s linear;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.05);
  position: relative;
  text-align: center;
}

.timeline-filter-btn:hover {
  background-color: #f3f3f3;
  color: var(--slds-color-brand-dark);
}

.timeline-filter-btn:active {
  background-color: #eeeeee;
  transform: scale(0.98);
}

.timeline-filter-btn:focus {
  box-shadow: 0 0 3px var(--slds-color-brand);
  outline: none;
}

.timeline-filter-btn.active {
  background-color: var(--slds-color-brand);
  color: white;
  border-color: var(--slds-color-brand);
  box-shadow: 0 0 2px var(--slds-color-brand);
}

/* Alternate success variant for some filters */
.timeline-filter-btn[data-category="solution-engineering"] {
  color: var(--slds-color-success);
}

.timeline-filter-btn[data-category="solution-engineering"]:hover {
  color: var(--slds-color-success-dark);
}

.timeline-filter-btn[data-category="solution-engineering"].active {
  background-color: var(--slds-color-success);
  color: white;
  border-color: var(--slds-color-success);
}

/* Timeline item animation classes */
.timeline-item {
  transition: transform var(--transition-base),
              opacity var(--transition-base),
              visibility var(--transition-base);
}

.timeline-item.filtered-in {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.timeline-item.poof-out {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
}

/* Timeline category tags */
.timeline-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.timeline-category-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  background-color: var(--bg-alt);
  color: var(--text-light);
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #timeline-filters {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: var(--space-xs);
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  
  .timeline-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}