/* ============================================
   Keyboard Ranking Site - Main Stylesheet
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-gray: #ecf0f1;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: #f9f9f9;
}

/* ============================================
   Header & Navigation
   ============================================ */

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: '⌨';
  font-size: 2rem;
}

nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav a {
  color: white;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

nav a:hover {
  color: var(--secondary-color);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 5rem 2rem;
  text-align: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.cta-button {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid var(--accent-color);
  cursor: pointer;
  font-size: 1rem;
}

.cta-button:hover {
  background-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 2rem;
  background-color: white;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  border-radius: 2px;
}

/* ============================================
   Ranking Cards
   ============================================ */

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.ranking-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  border: 2px solid transparent;
}

.ranking-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--secondary-color);
}

.card-rank {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: white;
  padding: 1.5rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
}

.card-rank-number {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.card-image {
  width: 100%;
  height: 200px;
  background-color: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-light);
}

.card-content {
  padding: 2rem;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

.card-category {
  color: var(--secondary-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.card-price {
  font-size: 1.8rem;
  color: var(--accent-color);
  margin: 1rem 0;
  font-weight: bold;
}

.card-description {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.card-features {
  list-style: none;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.card-features li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-light);
}

.card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--secondary-color);
  font-weight: bold;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.stars {
  color: #f39c12;
  letter-spacing: 2px;
}

.rating-count {
  color: var(--text-light);
}

.card-button {
  display: block;
  width: 100%;
  background-color: var(--secondary-color);
  color: white;
  padding: 0.8rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
  margin-top: 1rem;
}

.card-button:hover {
  background-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ============================================
   Comparison Table
   ============================================ */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  overflow-x: auto;
  display: block;
}

.comparison-table th,
.comparison-table td {
  padding: 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--light-gray);
}

.comparison-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

.comparison-table tr:hover {
  background-color: #f5f5f5;
}

.comparison-table tbody tr:nth-child(odd) {
  background-color: #fafafa;
}

/* ============================================
   Form Styles
   ============================================ */

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
textarea,
select {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid var(--light-gray);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

input[type='text']:focus,
input[type='email']:focus,
input[type='tel']:focus,
input[type='number']:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-checkbox input[type='checkbox'] {
  width: auto;
  cursor: pointer;
}

.form-checkbox label {
  margin-bottom: 0;
  font-weight: normal;
}

/* ============================================
   Footer
   ============================================ */

footer {
  background-color: var(--primary-color);
  color: white;
  padding: 3rem 2rem;
  margin-top: 5rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Breadcrumb
   ============================================ */

.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem 0;
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text-light);
  margin: 0 0.5rem;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-light);
}

.mt-3 {
  margin-top: 2rem;
}

.mb-3 {
  margin-bottom: 2rem;
}

.pd-3 {
  padding: 2rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  nav {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .section {
    padding: 2rem 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    font-size: 0.85rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.8rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 1.5rem;
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .card-rank-number {
    font-size: 2rem;
  }

  .cta-button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* ============================================
   Animation & Effects
   ============================================ */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: slideInUp 0.6s ease forwards;
}

/* ============================================
   Loading & Success States
   ============================================ */

.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  display: none;
}

.alert.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.alert.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.alert.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  display: block;
}

/* ============================================
   Performance Optimizations
   ============================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy loading support */
img[loading='lazy'] {
  background-color: var(--light-gray);
}
