/* Main Styles for Jewellery Billing System */

:root {
  --primary-gold: #D4AF37;
  --secondary-gold: #FFD700;
  --dark-gold: #B8860B;
  --light-gold: #FFF8DC;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --dark: #343a40;
  --light: #f8f9fa;
  --white: #ffffff;
  --shadow: 0 2px 15px rgba(0,0,0,0.1);
  --border-radius: 8px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* Auth Container */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
}

.auth-box {
  background: var(--white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  border-top: 5px solid var(--primary-gold);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  color: var(--dark-gold);
  font-size: 28px;
  margin-bottom: 10px;
}

.auth-header p {
  color: #666;
  font-size: 14px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--dark);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-control:focus {
  border-color: var(--primary-gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.invalid-feedback {
  color: var(--danger);
  font-size: 14px;
  margin-top: 5px;
}

/* Button Styles */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--dark-gold);
  transform: translateY(-2px);
}

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

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

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

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

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

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Navigation */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}

.navbar-brand h1 {
  color: var(--dark-gold);
  font-size: 24px;
  margin: 0;
}

.navbar-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: var(--dark);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  background: var(--light-gold);
  color: var(--dark-gold);
}

.nav-link.active {
  background: var(--primary-gold);
  color: var(--white);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-gold);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Main Container */
.main-container {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h2 {
  color: var(--dark-gold);
  font-size: 28px;
  margin-bottom: 10px;
}

.page-header p {
  color: #666;
}

/* Card Styles */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  background: var(--light);
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  margin: 0;
  color: var(--dark);
}

.card-body {
  padding: 20px;
}

/* Table Styles */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

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

.table tbody tr:hover {
  background: var(--light-gold);
}

/* Billing Form */
.billing-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.customer-section,
.items-section {
  background: var(--white);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.section-title {
  color: var(--dark-gold);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Item Row */
.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 15px;
  padding: 15px;
  background: var(--light);
  border-radius: var(--border-radius);
  align-items: center;
}

/* Exchange Section */
.exchange-section {
  background: #f8f9fa;
  border-left: 4px solid var(--warning);
  padding: 20px;
  margin-top: 20px;
}

/* Summary Section */
.summary-section {
  background: var(--white);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-top: 30px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #dee2e6;
}

.summary-row.total {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-gold);
  border-bottom: 2px solid var(--primary-gold);
}

/* QR Code Display */
.qr-container {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-top: 30px;
}

.qr-box {
  text-align: center;
  padding: 20px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.qr-box img {
  max-width: 200px;
  margin-bottom: 15px;
}

/* Admin Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--white);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 4px solid var(--primary-gold);
}

.stat-card h3 {
  color: var(--dark);
  margin-bottom: 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--dark-gold);
  margin-bottom: 10px;
}

.stat-card .stat-change {
  font-size: 14px;
  color: var(--success);
}

/* Charts */
.chart-container {
  background: var(--white);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

/* AI Insights */
.ai-insights {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  margin-top: 30px;
}

.ai-insights h3 {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.insight-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  backdrop-filter: blur(10px);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Alert Messages */
.alert {
  padding: 15px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

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

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: none;
  }
  
  .container {
    width: 100%;
    max-width: none;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .billing-container {
    grid-template-columns: 1fr;
  }
  
  .item-row {
    grid-template-columns: 1fr;
  }
  
  .navbar {
    flex-direction: column;
    gap: 15px;
  }
  
  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .qr-container {
    flex-direction: column;
    align-items: center;
  }
}
