/* static/css/style.css - TechShop Оптимизиран CSS */

/* ========== CSS ПРОМЕНЛИВИ ========== */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --gradient-primary: linear-gradient(135deg, #2563eb, #1e40af);
  --transition: all 0.3s ease;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 10px;
}

/* ========== БАЗОВИ СТИЛОВЕ ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gray-100);
  color: #212529;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ========== ТИПОГРАФИЯ ========== */
h1, h2, h3 { font-weight: 600; margin-bottom: 1rem; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ========== НАВИГАЦИЯ ========== */
.horizontal-menu {
  background: white;
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.horizontal-menu .navbar-nav .nav-link {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--gray-600);
}

.horizontal-menu .navbar-nav .nav-link:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.horizontal-menu .navbar-nav .nav-link.active {
  background: var(--gradient-primary);
  color: white;
}

.horizontal-menu .dropdown-menu {
  border: none;
  box-shadow: var(--shadow-hover);
  border-radius: var(--radius-md);
}

.horizontal-menu .dropdown-item:hover {
  background: rgba(37, 99, 235, 0.1);
}

/* Търсачка */
.bg-light.py-3 {
  background: #f8f9fa;
  border-bottom: 1px solid var(--gray-200);
}

.input-group .form-control {
  border-radius: 25px 0 0 25px;
  border: 2px solid #dee2e6;
  border-right: none;
  padding: 0.75rem 1.25rem;
}

.input-group .btn-primary {
  border-radius: 0 25px 25px 0;
  background: var(--gradient-primary);
  padding: 0.75rem 1.5rem;
  border: none;
}

/* ========== КАРТИ ========== */
.card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

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

.card-header {
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
}

.card-header.bg-primary {
  background: var(--gradient-primary) !important;
  color: white;
}

.card-body { padding: 1.25rem; }
.card-footer {
  background: rgba(0, 0, 0, 0.03);
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
}

/* Продуктови карти */
.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card .card-text {
  flex: 1;
  margin-bottom: 15px;
}

.product-image-container {
  height: 200px;
  overflow: hidden;
  margin: 10px 0;
  border-radius: 8px;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #28a745;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* ========== ДЕТАЙЛЕН ИЗГЛЕД НА ПРОДУКТ ========== */
.product-detail-image-container {
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.product-detail-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.product-price-box {
  background-color: #f0f7ff;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.product-description {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 10px;
}

.product-specifications {
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 15px;
}

.product-actions .btn {
  padding: 12px;
  font-size: 1.1rem;
}

/* ========== ФОРМУЛЯРИ ========== */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-control-file {
  padding: 0.375rem 0.75rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check-input {
  width: 1.1em;
  height: 1.1em;
}

/* ========== БУТОНИ ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, #1e3a8a);
  transform: translateY(-2px);
}

.btn-success {
  background: #198754;
  color: white;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-secondary {
  background: var(--gray-600);
  color: white;
}

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

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

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-info {
  background: #0dcaf0;
  color: #212529;
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.375rem;
  color: white;
}

.badge.bg-success { background: #198754; }
.badge.bg-warning { background: #ffc107; color: #212529; }
.badge.bg-info { background: #0dcaf0; color: #212529; }
.badge.bg-danger { background: #dc3545; }

/* ========== АЛЕРТИ ========== */
.alert {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* ========== ТАБЛИЦИ ========== */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  border-top: 1px solid var(--gray-200);
}

.table thead th {
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
}

.table-hover tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

/* ========== ПОТРЕБИТЕЛСКИ АВАТАРИ ========== */
.profile-picture {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}

.user-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.default-avatar {
  background: var(--gradient-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  text-transform: uppercase;
}

/* ========== ПРОГРЕС БАР ========== */
.progress {
  height: 0.75rem;
  background: var(--gray-200);
  border-radius: 0.375rem;
  overflow: hidden;
}

.progress-bar {
  background: var(--gradient-primary);
  height: 100%;
  transition: width 0.3s;
}

/* ========== СТАТИСТИКА ========== */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--gray-800);
}

.stat-card-label {
  color: var(--gray-600);
}

/* ========== СТАТУСИ ========== */
.user-status-active,
.status-badge.bg-success {
  background: #198754;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.user-status-inactive,
.status-badge.bg-danger {
  background: #dc3545;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.status-badge.bg-warning {
  background: #ffc107;
  color: #212529;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

/* ========== FOOTER ========== */
footer {
  background: #009fff;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
}

footer a:hover {
  color: white;
}

/* ========== МОДАЛЕН ПРОЗОРЕЦ ========== */
.modal-content {
  border: none;
  border-radius: var(--radius-md);
}

.modal-header.bg-primary {
  background: var(--gradient-primary) !important;
  color: white;
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-card {
  animation: fadeInUp 0.6s ease-out;
}

/* Анимации за елементи */
.fade-in,
.category-card,
.order-row,
.stats-card {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.fade-in.animated,
.category-card.animated,
.order-row.animated,
.stats-card.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ========== SCROLL TO TOP ========== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== ПРЕГЛЕД НА СНИМКА ========== */
.image-preview {
  max-width: 200px;
  max-height: 200px;
  margin-top: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-image-placeholder {
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ========== КОЛИЧКА СТРАНИЦА ========== */
.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.quantity-input {
  width: 70px;
  text-align: center;
}

.cart-summary {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
}

.cart-item {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.cart-item:hover {
  background-color: #f8f9fa;
  border-left-color: var(--primary, #0d6efd);
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
}

.empty-cart i {
  font-size: 80px;
  color: #dee2e6;
  margin-bottom: 20px;
}

/* ========== UTILITY КЛАСОВЕ ========== */
.text-center { text-align: center; }
.text-muted { color: var(--gray-600); }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.float-end { float: right; }
.w-100 { width: 100%; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .horizontal-menu .navbar-nav .nav-link { padding: 0.5rem 1rem; }
  .btn, .btn-lg { width: 100%; margin-bottom: 0.5rem; }
  .profile-picture { width: 100px; height: 100px; }

  /* Количка мобилна адаптация */
  .cart-item-image {
    width: 60px;
    height: 60px;
  }

  .quantity-input {
    width: 60px;
  }

  .cart-summary {
    position: static;
    margin-top: 20px;
  }
}

@media (max-width: 576px) {
  .card-body { padding: 1rem; }
  .table { font-size: 0.875rem; }
  .form-control { padding: 0.5rem 0.75rem; }
}
/* ========== СТРАНИЦА ЗА ПОРЪЧКА ========== */
.order-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.product-image-sm {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Мобилна адаптация */
@media (max-width: 768px) {
    .order-summary {
        position: static;
        margin-top: 20px;
    }
}
.profile-picture {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.default-avatar {
    width: 150px;
    height: 150px;
    background-color: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #6c757d;
    margin: 0 auto;
}

/* За по-добър външен вид на бутоните */
.d-flex.gap-2 {
    gap: 0.5rem !important;
}
