/* ============================================
   CSS Variables for Easy Theming
   ============================================ */
:root {
  --primary-color: #1775bc;
  --secondary-color: #4CAF50;
  --background: #f4f7fb;
  --text-color: #222;
  --white: #ffffff;
  --footer-bg: #222;
  --footer-text: #fff;
  --spacing-unit: 20px;
  --border-radius: 8px;
  --box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  --box-shadow-lg: 0 4px 8px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* ============================================
   Base Styles
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  color: var(--text-color);
  line-height: 1.6;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Header & Navigation
   ============================================ */
header {
  background: var(--primary-color);
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

header img {
  height: 60px;
  width: auto;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav li {
  margin: 0 15px;
}

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

nav a:hover,
nav a:focus {
  text-decoration: underline;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
}

/* ============================================
   Main Content
   ============================================ */
main {
  padding: 40px;
  max-width: 1200px;
  margin: auto;
}

section {
  margin-bottom: 40px;
}

h1 {
  color: var(--primary-color);
  margin-top: 0;
}

h2 {
  color: var(--primary-color);
  margin-top: 30px;
}

h3 {
  color: var(--primary-color);
  margin-top: 20px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  text-align: center;
  margin: -40px -40px 40px -40px;
  position: relative;
}

.hero img {
  width: 100%;
  max-width: 1200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.hero-text {
  position: relative;
  margin-top: -150px;
  color: var(--primary-color);
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
}

/* ============================================
   Feature Cards & Grids
   ============================================ */
.features,
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature-card,
.product-item {
  background: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover,
.product-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-lg);
}

.feature-card h3,
.product-item h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  margin-top: 0;
}

.product-item .price {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  margin: 15px 0;
}

/* ============================================
   Download Grid
   ============================================ */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.download-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-lg);
}

.download-card img {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 15px;
  height: auto;
}

.download-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: var(--transition);
}

.download-card a:hover,
.download-card a:focus {
  text-decoration: underline;
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.download-link {
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: none;
  transition: var(--transition);
}

.download-link:hover,
.download-link:focus {
  text-decoration: underline;
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ============================================
   Content Sections
   ============================================ */
.content-box {
  background: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-top: 30px;
}

.info-box {
  background: #f0f8ff;
  padding: 30px;
  border-radius: var(--border-radius);
  margin-top: 40px;
}

.warning-box {
  background: #fff3cd;
  border: 2px solid #ffeeba;
  color: #856404;
  padding: 20px;
  border-radius: var(--border-radius);
  margin-top: 40px;
}

.success-box {
  background: #d4edda;
  border: 2px solid #c3e6cb;
  color: #155724;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 30px;
}

.centered-image {
  text-align: center;
  margin: 30px 0;
}

.centered-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background: #145a8c;
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
  margin-left: 15px;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #45a049;
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

.btn-center {
  text-align: center;
  margin-top: 20px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(23, 117, 188, 0.1);
}

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

.form-error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
}

/* ============================================
   Auth Form
   ============================================ */
.auth-form {
  max-width: 500px;
  margin: 40px auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.auth-form button {
  width: 100%;
  padding: 15px;
  margin-top: 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.auth-form button:hover,
.auth-form button:focus {
  background: #145a8c;
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ============================================
   Footer
   ============================================ */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 15px;
  margin-top: 40px;
}

footer a {
  color: var(--footer-text);
  text-decoration: underline;
}

footer a:hover,
footer a:focus {
  color: #ccc;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mt-30 {
  margin-top: 30px;
}

.mt-40 {
  margin-top: 40px;
}

.mb-30 {
  margin-bottom: 30px;
}

/* ============================================
   Responsive Design - Mobile First
   ============================================ */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 15px;
  }
  
  header img {
    margin-bottom: 15px;
  }
  
  .menu-toggle {
    display: block;
    position: absolute;
    top: 15px;
    right: 15px;
  }
  
  nav {
    width: 100%;
  }
  
  nav ul {
    flex-direction: column;
    width: 100%;
    display: none;
  }
  
  nav ul.active {
    display: flex;
  }
  
  nav li {
    margin: 5px 0;
    text-align: center;
    width: 100%;
  }
  
  nav a {
    display: block;
    padding: 10px;
  }
  
  main {
    padding: 20px;
  }
  
  .hero {
    margin: -20px -20px 20px -20px;
  }
  
  .hero-text {
    margin-top: -100px !important;
    padding: 15px !important;
    font-size: 0.9em;
  }
  
  .features,
  .product-grid,
  .download-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .btn-secondary {
    margin-left: 0;
    margin-top: 10px;
    display: block;
  }
  
  .btn-center {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .hero-text {
    margin-top: -50px !important;
    font-size: 0.85em;
    padding: 10px !important;
  }
  
  h1 {
    font-size: 1.5em;
  }
  
  h2 {
    font-size: 1.3em;
  }
  
  h3 {
    font-size: 1.1em;
  }
  
  main {
    padding: 15px;
  }
  
  .feature-card,
  .product-item,
  .download-card {
    padding: 20px;
  }
  
  .auth-form {
    padding: 20px;
  }
}
