/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #004d7a 50%, #00bf72 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.quotation-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.quotation-header {
  background: white;
  border-radius: 12px;
  padding: 20px 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quotation-header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quotation-header h1 {
  color: #2d3748;
  font-size: 28px;
  font-weight: 700;
}

.quotation-header .user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.quotation-header .user-info span {
  color: #4a5568;
  font-weight: 500;
}

/* Main Content */
.quotation-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-height: 600px;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.toolbar h2 {
  color: #2d3748;
  font-size: 24px;
}

.toolbar-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.filter-select {
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.filter-select:hover {
  border-color: #cbd5e0;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #004d7a 50%, #00bf72 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

.btn-danger {
  background: #fc8181;
  color: white;
}

.btn-danger:hover {
  background: #f56565;
}

.btn-success {
  background: #48bb78;
  color: white;
}

.btn-success:hover {
  background: #38a169;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Quotations Grid */
.quotations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.quotation-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.quotation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.quotation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.quotation-number {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
}

.quotation-type {
  font-size: 14px;
  color: #718096;
  margin-top: 4px;
}

.quotation-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.quotation-status.draft {
  background: #fed7d7;
  color: #c53030;
}

.quotation-status.completed {
  background: #c6f6d5;
  color: #2f855a;
}

.quotation-client {
  color: #4a5568;
  font-size: 14px;
  margin-bottom: 10px;
}

.quotation-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.quotation-date {
  color: #718096;
  font-size: 13px;
}

.quotation-amount {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
}

.quotation-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.quotation-actions button {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
  grid-column: 1 / -1;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 20px;
}

/* Form View */
.view-container {
  width: 100%;
}

.form-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.form-header h2 {
  color: #2d3748;
  font-size: 24px;
}

/* Form Sections */
.form-section {
  margin-bottom: 30px;
}

.form-section h3 {
  color: #2d3748;
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  color: #4a5568;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #2d3748;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #4a5568;
  font-weight: 500;
}

.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Line Items */
.line-item {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
}

.line-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.line-item-header h4 {
  color: #2d3748;
  font-size: 16px;
}

.line-item-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 15px;
  align-items: end;
}

.line-item-amount {
  display: flex;
  align-items: center;
  height: 46px;
  padding: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 600;
  color: #667eea;
}

/* Totals Section */
.totals-section {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
}

.totals-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
  margin-left: auto;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: #4a5568;
}

.total-row.total-final {
  padding-top: 15px;
  border-top: 2px solid #cbd5e0;
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e2e8f0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 15px 25px;
  background: #2d3748;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1001;
  max-width: 400px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #48bb78;
}

.toast.error {
  background: #f56565;
}

/* Login Modal Styles */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.login-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-header {
  background: #2c3e50;
  color: white;
  padding: 30px;
  text-align: center;
}

.login-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-header p {
  opacity: 0.9;
  font-size: 14px;
}

.login-form-container {
  padding: 30px;
}

.login-form-container h3 {
  color: #2d3748;
  margin-bottom: 20px;
  text-align: center;
  font-size: 20px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #4a5568;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-wrapper {
  position: relative;
}

.password-toggle-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #718096;
  cursor: pointer;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #004d7a 50%, #00bf72 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.error-message {
  background: #fed7d7;
  color: #c53030;
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
}

.login-options {
  padding: 20px;
  text-align: center;
  border-top: 1px solid #e2e8f0;
}

.login-options a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.login-options a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .quotation-container {
    padding: 10px;
  }

  .quotation-header .header-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .toolbar-actions {
    width: 100%;
    flex-direction: column;
  }

  .filter-select,
  .toolbar-actions .btn {
    width: 100%;
  }

  .quotations-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .line-item-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .totals-grid {
    max-width: 100%;
  }

  .login-modal {
    margin: 10px;
  }

  .line-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .quotation-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .quotation-actions {
    flex-direction: column;
  }

  .radio-group {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .quotation-content {
    padding: 15px;
  }

  .quotation-header {
    padding: 15px 20px;
  }

  .quotation-header h1 {
    font-size: 24px;
  }

  .toolbar h2 {
    font-size: 20px;
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .form-header h2 {
    font-size: 20px;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}

/* Animation for smooth transitions */
.view-container {
  transition: opacity 0.3s ease;
}

.quotation-card,
.line-item {
  transition: all 0.3s ease;
}

/* Focus states for accessibility */
.btn:focus,
.filter-select:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

::selection {
  background: rgba(102, 126, 234, 0.2);
}

::-moz-selection {
  background: rgba(102, 126, 234, 0.2);
}
.predefined-item-select {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #2d3748;
  transition: all 0.3s ease;
  background: white;
  width: 100%;
}

.predefined-item-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.line-item-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr 1fr;
  gap: 15px;
  align-items: end;
}

@media (max-width: 768px) {
  .line-item-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
