/*
Author: Pham Hoang
Date: 12/xx/2025
File Name: style.css
Description: Styles for Webify Electronics final project.
*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #ffffff;
  font-family: "Poppins", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #02090A;
  line-height: 1.6;
}

a {
  color: #ffffff;
  text-decoration: none;
}

a:visited {
  color: #ffffff;
}

a:hover {
  background-color: #0056d2;
}

/* Header & Navigation */
header {
  padding: 1rem;
  background-color: #02090A;
  border-bottom: 1px solid #ffffff;
  text-align: center;
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.5rem;
  font-style: italic;
  text-shadow: 2px 2px 5px #000000; 
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

nav a {
  padding: 0.5rem 1rem;
  border: 1px solid #ffffff;
  border-radius: 15px;
}

nav a.active {
  background-color: #0056d2;
}

/* Hero Section */
.hero {
  padding: 4rem 1.5rem;
  text-align: center;
  background: linear-gradient(to right, #0f0f3d, #1e1e5a);
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  margin-bottom: 1.5rem;
}

.cta-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  color: #ffffff;
  background: #ff6a00;
}

/* Main Content */
main {
  padding: 1.5rem;
}

main > h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.section-title {
  grid-column: 1 / -1;
  font-size: 1.4rem;
  margin: 1rem 0;
}

/* Flex / Grid Layouts */
.featured {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}


.product-card {
  background-color: #07141b;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  max-width: 220px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.product-card img {
  width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
}

/* CSS Grid layout */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.gallery-grid figure {
  background-color: #07141b;
  padding: 0.75rem;
  border-radius: 10px;
  text-align: center;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

/* Media Section */
.media-section {
  max-width: 720px;
  margin: 2rem auto;      /* centers the whole block */
  text-align: center;     /* centers text + figcaption */
}

.media-section figure {
  margin: 1rem auto;
}

.media-section video {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0.5rem auto;
}

/* Contact Page */
#contact {
  text-align: left;
  max-width: 800px;
  margin: 0 auto;
}

.tel-link {
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.75rem;
  text-align: center;
  border-radius: 5px;
  background-color: #373684;
}

.tel-link a {
  display: block;
  font-size: 1.3rem;
  color: #fff;
}

.tab-desk {
  text-align: center;
}

#contact .email-link {
  color: #8ea8ff;
  font-weight: bold;
}

.map-wrapper {
  margin: 1rem 0 2rem 0;
}

.map-wrapper iframe {
  width: 100%;
  max-width: 600px;
}

/* Forms */
.form-section {
  background-color: #07141b;
  padding: 1.5rem;
  border-radius: 10px;
}

.form-section form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-section label,
.form-section legend {
  font-weight: 600;
}

.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="tel"],
.form-section select,
.form-section textarea {
  padding: 0.5rem;
  border-radius: 5px;
  border: 1px solid #cccccc;
  font-family: inherit;
}

.checkbox-label {
  display: block;
  margin-top: 0.5rem;
}

.form-buttons {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

.form-buttons input[type="submit"],
.form-buttons input[type="reset"] {
  padding: 0.5rem 1rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}

/* Table Styles */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem 0;
}

caption {
  caption-side: top;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

th,
td {
  padding: 0.75rem;
  border: 1px solid #ffffff;
  text-align: center;
}

tbody tr:nth-child(even) {
  background-color: #07141b;
}

/* Back to top link */
.back-to-top {
  text-align: right;
  margin-top: 1.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid #ffffff;
}
/* Mobile menu icon */
.mobile-menu-icon {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  color: white;
}

/* Navigation links container */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* Mobile Styling */
@media (max-width: 768px) {
  .mobile-menu-icon {
    display: block;
    text-align: right;
  }

  .nav-links {
    display: none; 
    flex-direction: column;
    margin-top: 1rem;
    gap: 0;
  }

  .nav-links a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid #444;
    text-align: center;
    border-radius: 0 !important;
  }

  .nav-links.show {
    display: flex; /* show menu when toggled */
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
  }

  .hero {
    padding: 2.5rem 1rem;
  }

  .featured {
    flex-direction: column;
    align-items: center;
  }

  .map-wrapper iframe {
    height: 300px;
  }

  .form-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Mobile vs tablet/desktop helper classes */
.mobile {
  display: block;
}

.tab-desk {
  display: none;
}

@media (min-width: 769px) {
  .mobile {
    display: none;
  }

  .tab-desk {
    display: block;
  }
}
