/**
 * Components CSS
 * Reusable component styles
 */

/* ============================================================================
   Hero Section Enhancements
   ========================================================================= */

/* Hero Layout - Profile at Top, Bilingual Content Below */
.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 0;
}

.hero-profile-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0 1rem 0;
}

.hero-content-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-content {
  position: relative;
  padding: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.hero-content:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.language-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.8rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero-divider {
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 20%,
    var(--accent) 80%,
    transparent
  );
  align-self: stretch;
  min-height: 400px;
}

.hero-lead {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.hero-description {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-expertise {
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.eyebrow {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

/* Responsive Layout */
@media (max-width: 1024px) {
  .hero-content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-divider {
    display: none;
  }

  .hero-content {
    max-width: 700px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero {
    gap: 2rem;
  }

  .hero-content {
    padding: 1.5rem;
  }

  .language-badge {
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* Profile Image Container - Modern Design with Horizontal Space Utilization */
.profile-container {
  position: relative;
  width: 320px;
  height: 280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-decoration {
  position: absolute;
  width: 340px;
  height: 300px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  opacity: 0.1;
  animation: morphing 8s ease-in-out infinite;
  z-index: 1;
}

@keyframes morphing {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: rotate(0deg) scale(1);
  }
  25% {
    border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    transform: rotate(45deg) scale(1.05);
  }
  75% {
    border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
  }
}

.profile-image {
  position: relative;
  width: 300px;
  height: 260px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
              0 0 0 10px rgba(59, 130, 246, 0.1);
  z-index: 2;
  transition: var(--transition);
}

.profile-image:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4),
              0 0 0 10px rgba(59, 130, 246, 0.2);
}

.profile-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--success);
  color: white;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 3;
  animation: pulse 2s ease-in-out infinite;
}

.profile-badge svg {
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .profile-container {
    width: 240px;
    height: 240px;
  }

  .profile-decoration {
    width: 260px;
    height: 260px;
  }

  .profile-image {
    width: 220px;
    height: 220px;
  }

  .profile-badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-icon {
  transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* ============================================================================
   Experience Cards
   ========================================================================= */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.card-header h4 {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.timeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem 0;
  font-size: 0.9rem;
}

.timeline .icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.achievement-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.achievement-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.achievement-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
  font-size: 1.1rem;
}

/* ============================================================================
   Section Enhancements
   ========================================================================= */

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  margin: -0.5rem 0 2rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================================
   Testimonials
   ========================================================================= */

.testimonial-card {
  position: relative;
  padding-top: 3rem;
}

.quote-icon {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  color: var(--accent);
  opacity: 0.3;
}

.testimonial-text {
  font-size: 1.05rem;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.testimonial-author {
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.testimonial-author strong {
  color: var(--text);
  font-size: 1rem;
}

/* ============================================================================
   Icons
   ========================================================================= */

.icon {
  display: inline-block;
  vertical-align: middle;
}

/* ============================================================================
   Badges
   ========================================================================= */

.tech-badge,
.impact-badge,
.year-badge,
.featured-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.tech-badge {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.impact-badge {
  background: linear-gradient(135deg, var(--accent), #5aa6ff);
  color: white;
}

.year-badge {
  background: var(--glass);
  border: 1px solid var(--accent);
  color: var(--accent);
  margin-left: 0.5rem;
}

.featured-badge {
  background: var(--warning);
  color: var(--bg);
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
}

/* ============================================================================
   Project Cards
   ========================================================================= */

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.project-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem 0;
}

.project-desc {
  line-height: 1.6;
  margin-bottom: auto;
  color: var(--muted);
  flex-grow: 1;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

/* ============================================================================
   Notifications
   ========================================================================= */

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  word-wrap: break-word;
}

.notification-success {
  background-color: var(--success);
}

.notification-error {
  background-color: #ef4444;
}

.notification-info {
  background-color: var(--accent);
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* ============================================================================
   Loading States
   ========================================================================= */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--glass);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ============================================================================
   Skip Link (Accessibility)
   ========================================================================= */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 100;
}

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

/* ============================================================================
   Animations
   ========================================================================= */

/* Fade in animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .fade-in-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .notification {
    animation: none;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   Empty States
   ========================================================================= */

.no-projects {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ============================================================================
   Form Enhancements
   ========================================================================= */

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
  border-color: var(--success);
}

/* Button loading state */
button[aria-busy="true"] {
  position: relative;
  color: transparent;
  pointer-events: none;
}

button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================================
   Utility Classes
   ========================================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.text-muted {
  color: var(--muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
