/* ==========================================================================
   FLAVOR GLASS — Component Library
   ========================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--fg-space-sm);
  padding: 0.65rem 1.5rem;
  font-family: var(--fg-font-family);
  font-size: var(--fg-text-sm);
  font-weight: var(--fg-weight-medium);
  line-height: 1;
  color: var(--fg-text-primary);
  background: var(--fg-glass-bg);
  -webkit-backdrop-filter: blur(var(--fg-blur-md)) saturate(var(--fg-saturate));
  backdrop-filter: blur(var(--fg-blur-md)) saturate(var(--fg-saturate));
  border: 1px solid var(--fg-glass-border);
  border-radius: var(--fg-radius-pill);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    all var(--fg-duration-base) var(--fg-ease-glass);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fg-glass-highlight), transparent);
  opacity: 0.5;
}

.btn:hover {
  background: var(--fg-glass-bg-hover);
  border-color: var(--fg-glass-border-hover);
  transform: translateY(-1px);
  box-shadow: var(--fg-shadow-glass-hover);
  color: var(--fg-text-primary);
}

.btn:active {
  transform: translateY(0);
  background: var(--fg-glass-bg-active);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary button — accent tinted glass */
.btn-primary {
  background: linear-gradient(135deg, rgba(88, 196, 220, 0.25), rgba(88, 196, 220, 0.10));
  border-color: rgba(88, 196, 220, 0.30);
  color: var(--fg-accent);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(88, 196, 220, 0.35), rgba(88, 196, 220, 0.18));
  border-color: rgba(88, 196, 220, 0.45);
  box-shadow: var(--fg-shadow-glass-hover), 0 0 20px var(--fg-accent-glow);
  color: var(--fg-accent);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  backdrop-filter: none;
  border-color: var(--fg-glass-border);
}

.btn-ghost:hover {
  background: var(--fg-glass-bg);
  backdrop-filter: blur(var(--fg-blur-sm));
}

/* Small button */
.btn-sm {
  padding: 0.45rem 1rem;
  font-size: var(--fg-text-xs);
}

/* Large button */
.btn-lg {
  padding: 0.85rem 2rem;
  font-size: var(--fg-text-base);
}

/* --- Form Inputs --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--fg-space-sm);
}

.form-label {
  font-size: var(--fg-text-sm);
  font-weight: var(--fg-weight-medium);
  color: var(--fg-text-secondary);
}

.form-input,
.form-textarea {
  padding: 0.75rem 1rem;
  font-family: var(--fg-font-family);
  font-size: var(--fg-text-base);
  color: var(--fg-text-primary);
  background: var(--fg-glass-bg);
  -webkit-backdrop-filter: blur(var(--fg-blur-sm));
  backdrop-filter: blur(var(--fg-blur-sm));
  border: 1px solid var(--fg-glass-border);
  border-radius: var(--fg-radius-md);
  outline: none;
  transition:
    border-color var(--fg-duration-base) var(--fg-ease-glass),
    box-shadow var(--fg-duration-base) var(--fg-ease-glass),
    background var(--fg-duration-base) var(--fg-ease-glass);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--fg-accent);
  box-shadow: 0 0 0 3px var(--fg-accent-soft), var(--fg-shadow-glass);
  background: var(--fg-glass-bg-hover);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--fg-text-tertiary);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Cards --- */
.card {
  padding: var(--fg-space-xl);
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--fg-space-md);
  margin-bottom: var(--fg-space-lg);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--fg-accent-soft);
  border-radius: var(--fg-radius-md);
  color: var(--fg-accent);
  flex-shrink: 0;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-title {
  font-size: var(--fg-text-lg);
  font-weight: var(--fg-weight-semibold);
}

.card-body {
  color: var(--fg-text-secondary);
  font-size: var(--fg-text-sm);
  line-height: var(--fg-leading-normal);
}

/* --- Badge / Tag --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--fg-space-xs);
  padding: 0.25rem 0.75rem;
  font-size: var(--fg-text-xs);
  font-weight: var(--fg-weight-medium);
  color: var(--fg-accent);
  background: var(--fg-accent-soft);
  border: 1px solid rgba(88, 196, 220, 0.15);
  border-radius: var(--fg-radius-pill);
  backdrop-filter: blur(var(--fg-blur-sm));
}

/* --- Progress bar --- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fg-accent), #a78bfa);
  border-radius: 3px;
  transition: width var(--fg-duration-slow) var(--fg-ease-smooth);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
  border-radius: 3px;
}

/* --- Stat counter --- */
.stat {
  text-align: center;
  padding: var(--fg-space-lg);
}

.stat-value {
  font-size: var(--fg-text-4xl);
  font-weight: var(--fg-weight-bold);
  line-height: 1;
  background: linear-gradient(135deg, var(--fg-accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: var(--fg-text-sm);
  color: var(--fg-text-secondary);
  margin-top: var(--fg-space-sm);
}

/* --- Testimonial card --- */
.testimonial-card {
  padding: var(--fg-space-2xl);
  position: relative;
}

.testimonial-quote {
  font-size: var(--fg-text-base);
  color: var(--fg-text-secondary);
  line-height: var(--fg-leading-normal);
  font-style: italic;
  margin-bottom: var(--fg-space-xl);
  position: relative;
  padding-left: var(--fg-space-xl);
}

.testimonial-quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--fg-accent), transparent);
  border-radius: 2px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--fg-space-md);
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--fg-radius-full);
  object-fit: cover;
  border: 2px solid var(--fg-glass-border);
}

.testimonial-name {
  font-size: var(--fg-text-sm);
  font-weight: var(--fg-weight-semibold);
  color: var(--fg-text-primary);
}

.testimonial-role {
  font-size: var(--fg-text-xs);
  color: var(--fg-text-tertiary);
}

/* --- Section headers --- */
.section-header {
  text-align: center;
  margin-bottom: var(--fg-space-3xl);
}

.section-label {
  display: inline-block;
  font-size: var(--fg-text-xs);
  font-weight: var(--fg-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-accent);
  background: var(--fg-accent-soft);
  padding: 0.3rem 1rem;
  border-radius: var(--fg-radius-pill);
  margin-bottom: var(--fg-space-md);
  border: 1px solid rgba(88, 196, 220, 0.12);
  backdrop-filter: blur(var(--fg-blur-sm));
}

.section-title {
  font-size: var(--fg-text-4xl);
  margin-bottom: var(--fg-space-md);
}

.section-subtitle {
  font-size: var(--fg-text-lg);
  color: var(--fg-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Divider --- */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fg-glass-border), transparent);
  margin: var(--fg-space-2xl) 0;
}

/* --- Portfolio card --- */
.portfolio-card {
  border-radius: var(--fg-radius-xl);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.portfolio-card-image {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  position: relative;
}

.portfolio-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--fg-duration-slow) var(--fg-ease-glass);
}

.portfolio-card:hover .portfolio-card-image img {
  transform: scale(1.05);
}

.portfolio-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--fg-space-xl);
  opacity: 0;
  transition: opacity var(--fg-duration-base) var(--fg-ease-glass);
}

.portfolio-card:hover .portfolio-card-overlay {
  opacity: 1;
}

.portfolio-card-info {
  padding: var(--fg-space-lg);
}

.portfolio-card-title {
  font-size: var(--fg-text-lg);
  font-weight: var(--fg-weight-semibold);
  margin-bottom: var(--fg-space-xs);
}

.portfolio-card-category {
  font-size: var(--fg-text-xs);
  color: var(--fg-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Theme toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--fg-glass-bg);
  backdrop-filter: blur(var(--fg-blur-sm));
  border: 1px solid var(--fg-glass-border);
  border-radius: var(--fg-radius-full);
  cursor: pointer;
  color: var(--fg-text-secondary);
  transition: all var(--fg-duration-base) var(--fg-ease-glass);
}

.theme-toggle:hover {
  background: var(--fg-glass-bg-hover);
  color: var(--fg-accent);
  border-color: var(--fg-glass-border-hover);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Sun icon hidden in dark mode, shown in light mode */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* --- Filter tabs --- */
.filter-tabs {
  display: flex;
  gap: var(--fg-space-sm);
  padding: 4px;
  background: var(--fg-glass-bg);
  backdrop-filter: blur(var(--fg-blur-sm));
  border: 1px solid var(--fg-glass-border);
  border-radius: var(--fg-radius-pill);
  width: fit-content;
}

.filter-tab {
  padding: 0.45rem 1.25rem;
  font-size: var(--fg-text-sm);
  font-weight: var(--fg-weight-medium);
  color: var(--fg-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--fg-radius-pill);
  cursor: pointer;
  transition: all var(--fg-duration-base) var(--fg-ease-glass);
  font-family: var(--fg-font-family);
}

.filter-tab:hover {
  color: var(--fg-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
  color: var(--fg-text-primary);
  background: var(--fg-glass-bg-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Skill / Knowledge tag --- */
.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: var(--fg-text-xs);
  font-weight: var(--fg-weight-medium);
  color: var(--fg-text-secondary);
  background: var(--fg-glass-bg);
  border: 1px solid var(--fg-glass-border);
  border-radius: var(--fg-radius-pill);
  backdrop-filter: blur(var(--fg-blur-sm));
  transition: all var(--fg-duration-base) var(--fg-ease-glass);
}

.skill-tag:hover {
  color: var(--fg-accent);
  border-color: rgba(88, 196, 220, 0.25);
  background: var(--fg-accent-soft);
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--fg-space-2xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--fg-accent), var(--fg-glass-border), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--fg-space-2xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--fg-space-2xl) + 3px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--fg-radius-full);
  background: var(--fg-accent);
  box-shadow: 0 0 10px var(--fg-accent-glow);
}

.timeline-date {
  font-size: var(--fg-text-xs);
  color: var(--fg-accent);
  font-weight: var(--fg-weight-medium);
  margin-bottom: var(--fg-space-xs);
}

.timeline-title {
  font-size: var(--fg-text-lg);
  font-weight: var(--fg-weight-semibold);
  margin-bottom: var(--fg-space-xs);
}

.timeline-company {
  font-size: var(--fg-text-sm);
  color: var(--fg-text-tertiary);
  margin-bottom: var(--fg-space-sm);
}

.timeline-description {
  font-size: var(--fg-text-sm);
  color: var(--fg-text-secondary);
  line-height: var(--fg-leading-normal);
}
