/* AIMS - Modern Appliances & Accessories Inventory Management System */
/* Designed by jpkennect@ groups */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.75rem;
}

body {
  background: var(--light-bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

/* Enhanced Cards */
.card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

/* Container Outlines */
.container {
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  padding: 1.25rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Modern Buttons */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success-color);
  box-shadow: var(--shadow-sm);
}

.btn-warning {
  background: var(--warning-color);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background: var(--danger-color);
  box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  transform: translateY(-1px);
}

/* Enhanced Forms */
.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Navigation */
.navbar {
  background: var(--card-bg) !important;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
}

/* Compact Icon Navigation */
.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.75rem !important;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  margin: 0 0.125rem;
  position: relative;
  width: 50px;
  height: 50px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: var(--light-bg);
  color: var(--primary-color) !important;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nav-link.active {
  background: var(--primary-color);
  color: white !important;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

/* Tooltip for navigation */
.nav-item {
  position: relative;
}

.nav-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1000;
  margin-top: 0.5rem;
}

.nav-tooltip::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--text-primary);
}

.nav-item:hover .nav-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hide text on smaller nav items */
.nav-link .nav-text {
  display: none;
}

/* Mobile Navigation Adjustments */
@media (max-width: 991.98px) {
  .nav-link {
    width: auto;
    height: auto;
    padding: 0.5rem 1rem !important;
    justify-content: flex-start;
  }
  
  .nav-link .nav-text {
    display: inline;
    margin-left: 0.5rem;
  }
  
  .nav-tooltip {
    display: none;
  }
}

/* Tables */
.table {
  background: var(--card-bg);
}

.table th {
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  padding: 1rem;
  background: var(--light-bg);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(248, 250, 252, 0.5);
}

.table-hover tbody tr:hover {
  background: var(--light-bg);
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-weight: 500;
}

.alert-success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  border-left: 4px solid var(--primary-color);
}

/* Badges */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
}

/* Dashboard Stats Cards */
.stats-card {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stats-card.success {
  background: linear-gradient(135deg, var(--success-color), #047857);
}

.stats-card.warning {
  background: linear-gradient(135deg, var(--warning-color), #b45309);
}

.stats-card.danger {
  background: linear-gradient(135deg, var(--danger-color), #b91c1c);
}

/* Product Icons (formerly Appliance Icons) */
.product-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: calc(var(--radius) * 0.75);
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
  .container {
    margin: 0.25rem;
    padding: 0.75rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .btn:last-child {
    margin-bottom: 0;
  }
  
  .d-flex.gap-2 {
    flex-direction: column;
  }
  
  .table th, .table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Footer Branding */
.footer-brand {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-top: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-brand a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.footer-brand a:hover {
  text-decoration: underline;
}

/* Image Enhancements */
.product-image {
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.product-image:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

.product-image-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.product-image-thumbnail:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: scale(1.1);
}

.product-image-large {
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.product-image-large:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-modal.show {
  opacity: 1;
  visibility: visible;
}

.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  background: white;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.image-modal.show .image-modal-content {
  transform: scale(1);
}

.image-modal img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0.5rem;
}

.image-modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.image-modal-close:hover {
  background: #b91c1c;
  transform: scale(1.1);
}

.image-placeholder {
  width: 40px;
  height: 40px;
  background: var(--light-bg);
  border: 1px dashed var(--border-color);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* Image Upload Preview */
.image-upload-preview {
  position: relative;
  display: inline-block;
}

.image-upload-preview img {
  max-width: 120px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid var(--border-color);
}

.image-upload-preview .remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.image-upload-preview .remove-image:hover {
  background: #b91c1c;
  transform: scale(1.1);
}
