/* =====================================================
   h-styles.css — Portfolio David Wawina (Google Style)
   ===================================================== */

/* ========== BASE STYLES ========== */
:root {
  --google-blue: #1a73e8;
  --google-blue-dark: #174ea6;
  --google-green: #3ddc84;
  --google-navy: #073042;
  --google-gray: #f8f9fa;
  --google-text: #202124;
  --google-text-sec: #5f6368;
  --google-border: #dadce0;
  
  /* Dark mode variables */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --border-color: #dadce0;
  --card-bg: #ffffff;
  --card-hover-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

/* Dark Mode */
html.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --card-bg: #1e293b;
  --card-hover-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bdc1c6; }

/* ========== SCROLL PROGRESS BAR ========== */
#scrollbar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--google-green), var(--google-blue));
  z-index: 60;
  transition: width 0.1s ease-out;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 24px;
  height: 48px;
  border-radius: 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background-color: var(--google-blue);
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: var(--google-blue-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-outline {
  background-color: var(--card-bg);
  color: var(--google-blue);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-secondary);
  border-color: var(--google-blue);
  color: var(--google-blue-dark);
}

.btn-android {
  background-color: var(--google-green);
  color: var(--google-navy);
  font-weight: 600;
}

.btn-android:hover {
  background-color: #32b56e;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* ========== CARDS ========== */
.card-clean {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.card-clean:hover {
  border-color: transparent;
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

/* ========== NAVBAR ========== */
.nav-link {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.nav-link:hover {
  color: var(--google-blue);
  background-color: var(--bg-secondary);
}

/* ========== MASONRY GRID ========== */
.masonry { 
  column-count: 1; 
  column-gap: 24px; 
}

@media (min-width: 768px) { 
  .masonry { column-count: 2; } 
}

@media (min-width: 1024px) { 
  .masonry { column-count: 3; } 
}

.masonry .mitem { 
  break-inside: avoid; 
  margin-bottom: 24px;
  display: block;
}

/* ========== BACKGROUND GRID ========== */
.bg-grid-slate {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, var(--border-color) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
}

html.dark .bg-grid-slate {
  background-image: linear-gradient(to right, rgba(71, 85, 105, 0.3) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(71, 85, 105, 0.3) 1px, transparent 1px);
}

/* ========== REVEAL ANIMATION ========== */
.reveal { 
  opacity: 0; 
  transform: translateY(20px); 
  transition: 0.8s ease-out; 
}

.reveal.revealed { 
  opacity: 1; 
  transform: translateY(0); 
}

/* ========== TYPING ANIMATION ========== */
.text-gradient {
  background-image: linear-gradient(90deg, var(--google-green), var(--google-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ========== PROMO BANNER ========== */
.promo-banner {
  background: linear-gradient(135deg, var(--google-navy), #0a4863);
  position: relative;
  overflow: hidden;
}

.promo-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(61, 220, 132, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(26, 115, 232, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

/* ========== TESTIMONIALS (Infinite Marquee) ========== */
.testimonial-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 1rem 0;
}

.testimonial-marquee-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 10;
  pointer-events: none;
}

.testimonial-marquee-fade-left {
  left: 0;
  background: linear-gradient(to right, 
    rgb(249 250 251) 0%, 
    rgba(249, 250, 251, 0) 100%);
}

.testimonial-marquee-fade-right {
  right: 0;
  background: linear-gradient(to left, 
    rgb(243 244 246) 0%, 
    rgba(243, 244, 246, 0) 100%);
}

html.dark .testimonial-marquee-fade-left {
  background: linear-gradient(to right, 
    rgb(15 23 42) 0%, 
    rgba(15, 23, 42, 0) 100%);
}

html.dark .testimonial-marquee-fade-right {
  background: linear-gradient(to left, 
    rgb(2 6 23) 0%, 
    rgba(2, 6, 23, 0) 100%);
}

.testimonial-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marquee 45s linear infinite;
}

.testimonial-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-100% / 3));
  }
}

.testimonial-card-modern {
  flex-shrink: 0;
  width: 340px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.dark .testimonial-card-modern {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.testimonial-card-modern:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

html.dark .testimonial-card-modern:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.testimonial-avatar-modern {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.testimonial-stars-modern {
  color: #fbbf24;
  font-size: 0.875rem;
  letter-spacing: 1px;
}

/* Legacy styles for backward compatibility */
.testimonial-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-4px);
}

.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 2px solid var(--border-color);
}

.testimonial-stars {
  color: #fbbf24;
  letter-spacing: 2px;
}

/* ========== FLOATING ELEMENTS ========== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* ========== RIPPLE EFFECT ========== */
.ripple {
  position: absolute;
  border-radius: 9999px;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  pointer-events: none;
  animation: ripple 0.6s ease-out forwards;
}

@keyframes ripple {
  to { transform: scale(2); opacity: 0; }
}

/* ========== BACK TO TOP ========== */
#toTop {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#toTop.visible {
  opacity: 1;
  visibility: visible;
}

/* ========== SKIP LINK ========== */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 9999;
}

.skip-link:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--google-blue);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

/* ========== FORM INPUTS ========== */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  background-color: var(--card-bg);
  border-color: var(--google-blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

/* ========== DARK MODE SPECIFIC ========== */
html.dark .bg-google-gray {
  background-color: var(--bg-secondary);
}

html.dark .text-google-text {
  color: var(--text-primary);
}

html.dark .text-google-textSec {
  color: var(--text-secondary);
}

html.dark .border-google-border {
  border-color: var(--border-color);
}

html.dark .bg-white {
  background-color: var(--bg-primary);
}

html.dark .bg-gray-50, 
html.dark .bg-gray-100 {
  background-color: var(--bg-secondary);
}

html.dark header {
  background-color: rgba(15, 23, 42, 0.95);
  border-color: var(--border-color);
}

html.dark #mobileMenu {
  background-color: var(--bg-primary);
}

html.dark .card-clean {
  background-color: var(--card-bg);
  border-color: var(--border-color);
}

html.dark footer {
  background-color: #020617;
}

html.dark dialog {
  background-color: var(--bg-primary);
}

html.dark dialog .bg-white {
  background-color: var(--card-bg);
}

html.dark .promo-banner {
  background: linear-gradient(135deg, #020617, var(--google-navy));
}

/* ========== LANGUAGE TOGGLE ========== */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.lang-toggle button {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.lang-toggle button.active {
  background-color: var(--google-blue);
  color: white;
}

.lang-toggle button:not(.active) {
  color: var(--text-secondary);
}

.lang-toggle button:not(.active):hover {
  color: var(--text-primary);
}

/* ========== FLOATING ACTION BUTTON ========== */
#fab {
  position: fixed;
  left: 1.25rem;
  bottom: 1.5rem;
  z-index: 50;
}

#fabMenu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#fabMenu.hidden {
  display: none;
}

/* ========== UTILITIES ========== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-balance {
  text-wrap: balance;
}
