/* ==========================================================================
   COMPONENTS - Reusable UI Elements
   Yellow Bay Technologies
   ========================================================================== */

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--border-color);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: transform var(--transition-base);
}

.site-logo:hover {
  transform: translateY(-2px);
}

.logo-icon {
  width: 40px;
  height: 40px;
}

.main-nav {
  display: none;
}

@media (min-width: 1024px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
  }
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  transition: color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--bay-gold);
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.header-cta {
  display: none;
}

@media (min-width: 1024px) {
  .header-cta {
    display: block;
  }
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: var(--z-modal);
}

@media (min-width: 1024px) {
  .mobile-toggle {
    display: none;
  }
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-elevated);
  padding: 2rem 1.5rem;
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  z-index: var(--z-fixed);
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu li {
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu .nav-link {
  display: block;
  padding: 1rem 0;
  font-size: 1.125rem;
}

.mobile-menu .nav-link::after {
  display: none;
}

/* Dark Mode Toggle */
.theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-base);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--bg-elevated);
  border-radius: 50%;
  transition: transform var(--transition-base);
}

[data-theme="dark"] .theme-toggle {
  background: var(--bay-sky);
}

[data-theme="dark"] .theme-toggle::before {
  transform: translateX(20px);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--bay-gold);
  outline-offset: 4px;
}

/* Primary Button */
.btn-primary {
  background: var(--bay-gold);
  color: var(--bay-ink);
  border-color: var(--bay-gold);
}

.btn-primary:hover {
  background: #FFB347;
  border-color: #FFB347;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background: var(--bay-teal);
  color: white;
  border-color: var(--bay-teal);
}

.btn-secondary:hover {
  background: #249688;
  border-color: #249688;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  border-color: var(--bay-sky);
  color: var(--bay-teal);
}

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1.125rem 2.25rem;
  font-size: 1.125rem;
}

/* Icon Button */
.btn-icon {
  padding: 0.75rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  border-color: var(--bay-sky);
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--bay-gold);
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Service Card */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--bay-gold);
  transition: height var(--transition-base);
}

.service-card:hover::before {
  height: 100%;
}

/* Case Study Card */
.case-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.case-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.case-card:hover img {
  transform: scale(1.05);
}

.case-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(to top, rgba(11, 18, 32, 0.95), transparent);
  color: white;
  transform: translateY(60%);
  transition: transform var(--transition-base);
}

.case-card:hover .case-card-overlay {
  transform: translateY(0);
}

.case-card-title {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 0.5rem;
}

.case-card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: rgba(255, 200, 87, 0.2);
  color: var(--bay-gold);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bay-mist);
  color: var(--bay-teal);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 65ch;
  margin: 0 auto;
}

/* ==========================================================================
   STATS / METRICS
   ========================================================================== */

.stat-block {
  text-align: center;
  padding: 2rem;
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--bay-gold);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   TIMELINE
   ========================================================================== */

.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  transform: translateX(-50%);
}

@media (max-width: 767px) {
  .timeline::before {
    left: 20px;
  }
}

.timeline-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

@media (max-width: 767px) {
  .timeline-item {
    padding-left: 60px;
  }
}

.timeline-marker {
  width: 40px;
  height: 40px;
  background: var(--bay-gold);
  border: 4px solid var(--bg-elevated);
  border-radius: 50%;
  flex-shrink: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

@media (max-width: 767px) {
  .timeline-marker {
    left: 20px;
  }
}

.timeline-content {
  flex: 1;
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .timeline-item:nth-child(odd) .timeline-content {
    margin-right: calc(50% + 40px);
  }
  
  .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
  }
  
  .timeline-item:nth-child(even) .timeline-content {
    margin-left: calc(50% + 40px);
  }
}

.timeline-date {
  font-weight: 600;
  color: var(--bay-gold);
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   TABS
   ========================================================================== */

.tabs {
  margin-bottom: 2rem;
}

.tab-list {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}

.tab-button {
  padding: 1rem 1.5rem;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  margin-bottom: -2px;
}

.tab-button:hover {
  color: var(--text-primary);
}

.tab-button.active {
  color: var(--bay-gold);
  border-bottom-color: var(--bay-gold);
}

.tab-panel {
  display: none;
  padding: 2rem 0;
  animation: fadeIn 0.4s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ACCORDION
   ========================================================================== */

.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  text-align: left;
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition-base);
}

.accordion-header:hover {
  background: var(--bg-secondary);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ==========================================================================
   TESTIMONIAL SLIDER
   ========================================================================== */

.testimonial-slider {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.testimonial-track {
  overflow: hidden;
}

.testimonial-slides {
  display: flex;
  transition: transform var(--transition-slow);
}

.testimonial-slide {
  flex: 0 0 100%;
  padding: 2rem;
  text-align: center;
}

.testimonial-quote {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 2rem;
  position: relative;
}

.testimonial-quote::before {
  content: '"';
  font-size: 4rem;
  color: var(--bay-gold);
  position: absolute;
  top: -1rem;
  left: -1rem;
  font-family: Georgia, serif;
}

.testimonial-author {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.testimonial-role {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.testimonial-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.testimonial-control {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.testimonial-control:hover {
  background: var(--bay-gold);
  border-color: var(--bay-gold);
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.testimonial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all var(--transition-base);
}

.testimonial-dot.active {
  background: var(--bay-gold);
  width: 30px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-required {
  color: #E53E3E;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--bay-sky);
  box-shadow: 0 0 0 3px rgba(119, 182, 234, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #E53E3E;
}

.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: #38A169;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  display: block;
  color: #E53E3E;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.form-help {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Form Success/Error Messages */
.form-message {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-message-success {
  background: #F0FFF4;
  color: #22543D;
  border: 1px solid #9AE6B4;
}

.form-message-error {
  background: #FFF5F5;
  color: #742A2A;
  border: 1px solid #FC8181;
}

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 18, 32, 0.7);
  z-index: var(--z-modal-backdrop);
  display: none;
  backdrop-filter: blur(4px);
}

.modal-backdrop.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  display: none;
  box-shadow: var(--shadow-xl);
}

.modal.active {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.5rem;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-base);
}

.modal-close:hover {
  background: var(--bg-secondary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  background: var(--bay-ink);
  color: var(--text-inverse);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--bay-gold);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: var(--bay-gold);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* ==========================================================================
   UTILITY ANIMATIONS
   ========================================================================== */

.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.slide-up {
  opacity: 0;
  transform: translateY(30px);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--bay-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* CTA Band */
.cta-band {
  background: linear-gradient(135deg, var(--bay-teal), var(--bay-sky));
  padding: 4rem 2rem;
  border-radius: var(--radius-xl);
  text-align: center;
  color: white;
  margin: 4rem 0;
}

.cta-band h2 {
  color: white;
  margin-bottom: 1rem;
}

.cta-band p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* Logo Wall */
.logo-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  padding: 2rem 0;
  opacity: 0.6;
}

.logo-wall img {
  height: 40px;
  filter: grayscale(100%);
  transition: all var(--transition-base);
}

.logo-wall img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}