/*
 * Global styles and variables for 404 Fixed website
 */
/* Color palette inspired by the company logo */
:root {
  --primary-color: #0066b2; /* deep blue */
  --accent-color: #f05a26; /* vibrant orange */
  --primary-color-dark: #005ca0; /* darker shade of primary for hover */
  --accent-color-dark: #d44f21; /* darker shade of accent */
  --secondary-color: #f5f7fa; /* light grey background */
  --dark-color: #0a1f44; /* dark shade for contrast */
  --text-color: #333333; /* default text colour */
  --heading-color: #0a1f44; /* dark heading */
  --border-radius: 8px;
  --transition: 0.3s ease;
}

/* Reset and basic styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: white;
  padding-top: 80px; /* offset header */
}

/* Containers */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: background-color var(--transition);
  cursor: pointer;
}

/* general button hover uses a darker shade */
.btn:hover {
  background-color: var(--primary-color-dark);
}

/* Header and navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo img {
  height: 48px;
}

nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--heading-color);
  font-weight: 500;
  transition: color var(--transition);
}

nav a:hover {
  color: var(--primary-color);
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  width: 30px;
  height: 22px;
}

.nav-toggle .bar,
.nav-toggle .bar::before,
.nav-toggle .bar::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle .bar {
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle .bar::before {
  top: -8px;
}

.nav-toggle .bar::after {
  top: 8px;
}

.nav-toggle.open .bar {
  background-color: transparent;
}

.nav-toggle.open .bar::before {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open .bar::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  padding: 4rem 0;
  display: flex;
  align-items: center;
  min-height: 60vh;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.btn-primary {
  background-color: var(--accent-color);
}

/* primary button hover uses darker accent colour */
.btn-primary:hover {
  background-color: var(--accent-color-dark);
}

/* Section headings */
section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--heading-color);
}

/* Services Section */
.services-section {
  background-color: var(--secondary-color);
  padding: 4rem 0;
}

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

.service-card {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-card .icon {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--heading-color);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--text-color);
}

/* AI Try-On Section */
.tryon-section {
  padding: 4rem 0;
}

.tryon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.tryon-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--heading-color);
}

.tryon-info p {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.tryon-info .note {
  font-size: 0.9rem;
  color: #888;
  font-style: italic;
}

.tryon-demo {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--primary-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition);
}

.upload-area:hover {
  background-color: var(--secondary-color);
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--primary-color);
  font-weight: 500;
  gap: 0.5rem;
  cursor: pointer;
}

.upload-label i {
  font-size: 2rem;
}

/* Preview area */
.preview-area {
  position: relative;
  width: 100%;
  padding-top: 100%; /* square aspect ratio */
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  overflow: hidden;
  display: none;
}

.preview-area.active {
  display: block;
}

.preview-area img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.preview-area .overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent-color);
  font-size: 4rem;
  opacity: 0.7;
  pointer-events: none;
}

/* About Section */
.about-section {
  background-color: var(--secondary-color);
  padding: 4rem 0;
}

.about-content p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-color);
}

.about-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
  color: var(--heading-color);
}

/* Contact Section */
.contact-section {
  padding: 4rem 0;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--heading-color);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 1rem;
}

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

.contact-form button {
  align-self: flex-start;
  background-color: var(--primary-color);
}

/* contact form button hover */
.contact-form button:hover {
  background-color: var(--primary-color-dark);
}

/* Footer */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

footer p {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Media queries for responsiveness */
@media (max-width: 900px) {
  .tryon-grid {
    grid-template-columns: 1fr;
  }
  .tryon-demo {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  nav ul {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    flex-direction: column;
    align-items: flex-start;
    width: 200px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
  }
  nav ul.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
}

/* Contact form alert box */
.form-alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  color: #fff;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.4s ease-in-out;
}

/* Success and error states */
.form-alert.success {
  background-color: var(--primary-color);
}

.form-alert.error {
  background-color: var(--accent-color);
}

/* Fade-out animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}