/* 
 * TRIBE MARKETING - Main Stylesheet
 * Company: Tribe Marketing, Rockwall Texas
 * Colors: #c15d24 (orange), #4faecc (blue), #ec8432 (light orange), #383838 (dark gray)
 * Fonts: Jomhura (headings), Inter (body)
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Jomhuria:wght@400&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for Brand Colors */
:root {
  --tribe-orange: #c15d24;
  --tribe-blue: #4faecc;
  --tribe-light-orange: #ec8432;
  --tribe-dark: #383838;
  --tribe-white: #ffffff;
  --tribe-light-gray: #f8f9fa;
  --tribe-medium-gray: #6c757d;
  
  /* Font Variables */
  --heading-font: 'Jomhuria', cursive;
  --body-font: 'Inter', sans-serif;
  
  /* Spacing */
  --section-padding: 80px 0;
  --container-padding: 0 20px;
  
  /* Transitions */
  --smooth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --fast-transition: all 0.2s ease;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--body-font);
  line-height: 1.6;
  color: var(--tribe-dark);
  background-color: var(--tribe-white);
  overflow-x: hidden;
}

/* Prevent FOUC (Flash of Unstyled Content) */
.hero .btn {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--tribe-dark);
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h3 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h4 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--tribe-medium-gray);
}

a {
  color: var(--tribe-orange);
  text-decoration: none;
  transition: var(--fast-transition);
}

a:hover {
  color: var(--tribe-light-orange);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--container-padding);
  position: relative;
  z-index: 2;
}

/* Header Styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  transition: var(--smooth-transition);
  border-bottom: 1px solid rgba(56, 56, 56, 0.1);
}

header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo Placeholder */
.logo {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--tribe-orange);
}

.logo-icon {
  width: 28px;
  height: 37px;
  margin-right: 10px;
  /* TRIBE Marketing logo PNG */
  vertical-align: baseline;
  margin-bottom: -2px;
}

.logo-text {
  font-family: var(--heading-font);
  font-size: clamp(5.01rem, 8.9vw, 6.68rem);
  font-weight: 400;
  line-height: 1;
  vertical-align: baseline;
}

/* Navigation Styles */
.nav-desktop {
  display: none;
}

.nav-desktop ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-desktop a {
  color: var(--tribe-dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: var(--smooth-transition);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background-color: var(--tribe-orange);
  color: var(--tribe-white);
}

/* Hamburger Menu Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: var(--tribe-dark);
  transition: var(--smooth-transition);
  transform-origin: center;
}

/* Hamburger Animation States */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
  background-color: var(--tribe-white);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
  background-color: var(--tribe-white);
}

/* Full Screen Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, var(--tribe-orange) 0%, var(--tribe-light-orange) 100%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu ul {
  list-style: none;
  text-align: center;
}

.mobile-menu li {
  margin: 1.5rem 0;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.3s ease;
}

.mobile-menu.active li {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu a {
  color: var(--tribe-white);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-family: var(--heading-font);
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transition: var(--smooth-transition);
  letter-spacing: 1px;
}

.mobile-menu a:hover {
  color: var(--tribe-light-gray);
  transform: scale(1.1);
}

/* Main Content */
main {
  margin-top: 80px; /* Account for fixed header */
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--tribe-blue) 0%, var(--tribe-orange) 100%);
  color: var(--tribe-white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
}

.hero-content div {
  position: relative;
  z-index: 4;
}

.hero .btn {
  position: relative;
  z-index: 5;
  display: inline-block;
}

.hero h1 {
  color: var(--tribe-white);
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-size: clamp(3.5rem, 7vw, 6rem);
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--smooth-transition);
  border: none;
  cursor: pointer;
  font-family: var(--body-font);
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--tribe-white);
  color: var(--tribe-orange);
}

.btn-primary:hover {
  background-color: var(--tribe-light-gray);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--tribe-dark);
  border: 2px solid var(--tribe-orange);
}

.btn-secondary:hover {
  background-color: var(--tribe-orange);
  color: var(--tribe-white);
}

/* Secondary buttons on hero/colored backgrounds */
.hero .btn-secondary,
[style*="background: linear-gradient"] .btn-secondary,
[style*="background:linear-gradient"] .btn-secondary {
  color: var(--tribe-white);
  border: 2px solid var(--tribe-white);
  background-color: transparent;
  position: relative;
  z-index: 10;
}

.hero .btn-secondary:hover,
[style*="background: linear-gradient"] .btn-secondary:hover,
[style*="background:linear-gradient"] .btn-secondary:hover {
  background-color: var(--tribe-white);
  color: var(--tribe-orange);
}

/* Ensure all hero buttons are visible */
.hero .btn-primary {
  position: relative;
  z-index: 10;
  background-color: var(--tribe-white);
  color: var(--tribe-orange);
  border: 2px solid var(--tribe-white);
}

.hero .btn-primary:hover {
  background-color: var(--tribe-light-gray);
  color: var(--tribe-orange);
}

/* Ensure buttons are always visible with animation */
.hero .btn {
  animation: fadeInButtons 0.8s ease-in-out 0.5s both;
}

@keyframes fadeInButtons {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Styles */
.section {
  padding: var(--section-padding);
  position: relative;
  z-index: 2;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  color: var(--tribe-dark);
  position: relative;
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--tribe-orange), var(--tribe-blue));
  border-radius: 2px;
}

/* Grid System */
.grid {
  display: grid;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Card Styles */
.card {
  background: var(--tribe-white);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: var(--smooth-transition);
  border: 1px solid rgba(79, 174, 204, 0.1);
  position: relative;
  z-index: 3;
}

/* Testimonials card specific styling */
.card[style*="backdrop-filter"] {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  color: white !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure testimonials section content is visible */
section[style*="gradient"] .grid {
  opacity: 1 !important;
  visibility: visible !important;
}

section[style*="gradient"] .card {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Debug: Ensure all grid content is visible */
.grid {
  opacity: 1 !important;
  visibility: visible !important;
}

.grid .card {
  opacity: 1 !important;
  visibility: visible !important;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  height: 200px;
  background-color: var(--tribe-light-gray);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tribe-medium-gray);
  font-style: italic;
  overflow: hidden;
  position: relative;
  /* Placeholder for images - replace with actual images */
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Contact Form Styles */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--tribe-white);
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 2rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--tribe-light-gray);
  border-radius: 10px;
  font-family: var(--body-font);
  font-size: 1rem;
  transition: var(--smooth-transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--tribe-blue);
  box-shadow: 0 0 0 3px rgba(79, 174, 204, 0.1);
}

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

/* Footer */
footer {
  background: var(--tribe-dark);
  color: var(--tribe-white);
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--tribe-orange);
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
  color: var(--tribe-orange);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Default state - visible by default (no JS) */
.animate-on-scroll {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

/* Hidden state when JS is working */
.js-loaded .animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
}

/* Animated state when JS adds the animate class */
.js-loaded .animate-on-scroll.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Carousel Styles */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel-container {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  /* Replace with actual images */
  background-color: var(--tribe-light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--fast-transition);
}

.carousel-dot.active {
  background-color: var(--tribe-orange);
}

/* Responsive Design */
@media (min-width: 768px) {
  .nav-desktop {
    display: block;
  }
  
  .hamburger-btn {
    display: none;
  }
  
  .hero-content {
    text-align: left;
  }
  
  .grid-2-desktop {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --section-padding: 60px 0;
    --container-padding: 0 15px;
  }
  
  .hero {
    min-height: 70vh;
  }
  
  .hero h1 {
    font-size: clamp(3rem, 8vw, 4rem);
  }
  
  .mobile-menu a {
    font-size: clamp(2.2rem, 7vw, 3rem);
  }
  
  .section-title h2 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
  }
  
  .contact-form {
    padding: 2rem 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .card h3 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
  }
  
  .card h4 {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--tribe-white);
  animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.hidden { display: none; }
.visible { display: block; }
