/* TuningPro - Güçlü ve Şık Automotive E-ticaret CSS */

:root {
  /* Light theme */
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #ffffff;
  --card-foreground: #1a1a1a;
  --border: #e5e7eb;
  --input: #f3f4f6;
  --muted: #f9fafb;
  --muted-foreground: #6b7280;
  --primary: #ef4444;
  --primary-foreground: #ffffff;
  --secondary: #f3f4f6;
  --secondary-foreground: #374151;
  
  /* Tuning colors */
  --tuning-red: #ef4444;
  --tuning-blue: #3b82f6;
  --tuning-orange: #f97316;
  --tuning-dark: #1a1a1a;
  --tuning-gray: #6b7280;
}

.dark {
  /* Dark theme */
  --background: #0f0f0f;
  --foreground: #ffffff;
  --card: #1a1a1a;
  --card-foreground: #ffffff;
  --border: #262626;
  --input: #262626;
  --muted: #1a1a1a;
  --muted-foreground: #a3a3a3;
  --primary: #ef4444;
  --primary-foreground: #ffffff;
  --secondary: #262626;
  --secondary-foreground: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========================= */
/*        HEADER CSS        */
/* ========================= */

.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.dark .header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--tuning-red);
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  gap: 1.2rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.nav-menu a {
  color: var(--foreground);
  font-weight: 500;
  padding: 0.4rem 0;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--tuning-red);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--tuning-red);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
}

#search-form {
  position: relative;
  width: 200px;
  min-width: 150px;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

#search-input {
  width: 100%;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--foreground);
}

#search-input::placeholder {
  color: var(--muted-foreground);
}

.cart-count {
  background: var(--tuning-red);
  color: white;
  border-radius: 50%;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--muted);
  border: 1px solid var(--border);
}

.theme-toggle:hover {
  background: var(--secondary);
  transform: scale(1.1);
}




.btn-primary:hover {
  background: var(--tuning-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  background: var(--muted);
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  background: var(--muted);
  border-color: var(--tuning-red);
}


/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
  border: 2px solid transparent;
}


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

.btn-primary:hover {
  background: var(--tuning-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--muted);
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  background: var(--muted);
  border-color: var(--tuning-red);
}

/* Theme Toggle */
.theme-toggle {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.theme-toggle:hover {
  background: var(--secondary);
  transform: scale(1.1);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--tuning-dark) 0%, var(--tuning-red) 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 4rem 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.cart-button, .theme-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--input);
    color: var(--foreground);
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.cart-button:hover, .theme-button:hover {
    background: var(--secondary);
    color: var(--tuning-red);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--tuning-red);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}


.login-button, .register-button, .logout-button, .admin-button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}
.login-button {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}
.register-button {
    background: var(--tuning-red);
    color: white;
    border: 1px solid var(--tuning-red);
}
.logout-button {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}
.admin-button {
    background: var(--tuning-blue);
    color: white;
    border: 1px solid var(--tuning-blue);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.username {
    font-size: 0.9rem;
    color: var(--foreground);
    margin-right: 0.5rem;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

/* Search */
.search-container {
    position: relative;
    width: 200px;
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input);
    color: var(--foreground);
    font-size: 0.9rem;
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.2rem;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 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(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--tuning-red);
}

.dark .card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--card-foreground);
}

.card-description {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Product Card */
.product-card {
  position: relative;
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--tuning-red);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 10;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.current-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tuning-red);
}

.original-price {
  font-size: 1rem;
  color: var(--muted-foreground);
  text-decoration: line-through;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--tuning-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--muted);
  font-weight: 600;
  color: var(--foreground);
}

.table tr:hover {
  background: var(--muted);
}

.table-container {
  overflow-x: auto;
  margin: -1px;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.alert-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.dark .alert-success {
  background: #14532d;
  color: #bbf7d0;
}

.dark .alert-error {
  background: #7f1d1d;
  color: #fecaca;
}

.dark .alert-info {
  background: #1e3a8a;
  color: #bfdbfe;
}

/* Cart */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--tuning-red);
  font-weight: 700;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background: var(--muted);
  border-color: var(--tuning-red);
}

/* Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-block;
}

/* Admin Panel */
.admin-sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 80px);
  padding: 2rem 0;
}

.admin-sidebar ul {
  list-style: none;
}

.admin-sidebar a {
  display: block;
  padding: 1rem 2rem;
  color: var(--foreground);
  text-decoration: none;
  transition: background-color 0.3s ease;
  border-left: 3px solid transparent;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: var(--muted);
  color: var(--tuning-red);
  border-left-color: var(--tuning-red);
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

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

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--tuning-red);
  display: block;
}

.stat-label {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}


/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--muted-foreground); }
.text-red { color: var(--tuning-red); }
.text-blue { color: var(--tuning-blue); }
.text-green { color: #22c55e; }
.text-orange { color: var(--tuning-orange); }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .header-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
  }
  
  .nav-menu {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }
  
  .header-actions {
    order: 2;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.5rem;
  }

  #search-form {
    width: 100%;
    margin-right: 0;
  }
  
}

@media (max-width: 768px) {
  .header-container {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .nav-menu {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .header-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .hero {
    padding: 3rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }
  
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .cart-item-image {
    width: 60px;
    height: 60px;
  }
  
  .flex {
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-sidebar {
    min-height: auto;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  #search-form {
    width: 100%;
  }

  #search-input {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }
  
  .card-content {
    padding: 1rem;
  }
  
  .hero {
    padding: 2rem 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
}





/* Loading Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Smooth Transitions */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Print Styles */
@media print {
  .header, .footer, .btn, .theme-toggle {
    display: none !important;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
}

.hamburger .bar {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 4px 0;
  transition: 0.3s;
}

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

/* Responsive Ayarlar */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: none;
    flex-direction: column;
    background-color: white;
    padding: 1rem;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }

  .mobile-menu.active {
    display: flex;
  }

  .nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    width: 100%;
  }

  .nav-menu li {
    border-bottom: 1px solid #eee;
  }

  .nav-menu li a {
    display: block;
    padding: 0.75rem;
    text-decoration: none;
    color: #333;
  }

  .header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  #search-form input {
    width: 100%;
  }
}
