:root {
  --primary-color: #990000;
  --primary-dark: #7a0000;
  --primary-light: #b30000;
  --secondary-color: #f8f9fa;
  --accent-color: #ffd700;
  --text-dark: #333333;
  --text-light: #666666;
  --success-color: #28a745;
  --error-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --border-radius: 12px;
  --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
    background: white !important;
    color: black !important;
  }

  .printable-area,
  .printable-area * {
    visibility: visible;
  }

  .printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 20px !important;
  }

  .print-header {
    text-align: center;
    border-bottom: 2px solid #000;
    margin-bottom: 25px;
    padding-bottom: 15px;
  }

  .print-title {
    font-size: 24px !important;
    color: #000 !important;
    margin: 0 0 10px 0 !important;
    font-weight: bold;
  }

  .print-subtitle {
    font-size: 16px;
    color: #444;
    margin-bottom: 5px;
  }

  .print-timestamp {
    font-size: 14px;
    color: #666;
    direction: rtl;
  }

  .print-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
  }

  .print-results-table th {
    background: #f5f5f5 !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    padding: 10px;
    text-align: center;
    font-weight: bold;
  }

  .print-results-table td {
    border: 1px solid #000 !important;
    padding: 8px 10px;
    text-align: right;
  }

  .print-results-table tr:nth-child(even) {
    background: #f9f9f9;
  }

  .print-footer {
    margin-top: 40px;
    padding-top: 15px;
    border-top: 1px solid #000;
    text-align: center;
    font-size: 12px;
    color: #666;
  }

  .print-no-results {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
  }

  .no-print {
    display: none !important;
  }

  /* A4 and A5 page size support */
  @page {
    size: A4;
    margin: 15mm;
  }

  @page a5 {
    size: A5;
    margin: 10mm;
  }

  /* Auto-detect page size based on content */
  .a4-print {
    page: auto;
  }

  .a5-print {
    page: a5;
  }

  /* Responsive font sizes for different paper sizes */
  .a5-print .print-title {
    font-size: 18px !important;
  }

  .a5-print .print-subtitle {
    font-size: 13px !important;
  }

  .a5-print .print-timestamp {
    font-size: 11px !important;
  }

  .a5-print .print-results-table {
    font-size: 11px !important;
  }

  .a5-print .print-results-table th,
  .a5-print .print-results-table td {
    padding: 6px 8px !important;
  }

  .a5-print .print-footer {
    font-size: 10px !important;
    margin-top: 25px !important;
  }

  /* Scale down content for A5 if needed */
  .a5-print {
    transform-origin: top left;
  }
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  background: white;
  border-radius: var(--border-radius);
  padding: 16px 20px;
  box-shadow: var(--box-shadow);
  border-left: 4px solid var(--primary-color);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(400px);
  opacity: 0;
  transition: var(--transition);
  cursor: pointer;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left-color: var(--success-color);
}

.toast.error {
  border-left-color: var(--error-color);
}

.toast.warning {
  border-left-color: var(--warning-color);
}

.toast.info {
  border-left-color: var(--info-color);
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--text-dark);
  font-size: 14px;
}

.toast-message {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
}

/* Main Layout */
.banking-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.banking-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px;
}

.banking-title {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.banking-subtitle {
  color: var(--text-light);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tabs System */
.tabs-container {
  margin-bottom: 30px;
}

.tabs {
  display: flex;
  background: white;
  border-radius: var(--border-radius);
  padding: 5px;
  box-shadow: var(--box-shadow);
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 15px 20px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
  font-weight: bold;
  color: var(--text-light);
}

.tab.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 10px rgba(153, 0, 0, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.banking-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.banking-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.banking-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
  text-align: center;
  margin-bottom: 25px;
}

.card-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.card-title {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-weight: bold;
}

.card-description {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.input-with-prefix {
  display: flex;
  align-items: stretch;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-prefix {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  min-width: 60px;
  cursor: default;
  user-select: none;
}

.form-input {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 16px;
  background: white;
  transition: var(--transition);
  direction: ltr;
  text-align: left;
}

.form-input:focus {
  outline: none;
  background: #f8f9fa;
}

.form-input::placeholder {
  color: #999;
  text-align: right;
  direction: rtl;
}

.bank-select {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--border-radius);
  background: white;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: var(--transition);
  text-align: right;
}

.bank-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.1);
}

/* Buttons */
.submit-btn {
  width: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(153, 0, 0, 0.3);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(153, 0, 0, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Results Display */
.results-container {
  margin-top: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: none;
}

.results-container.show {
  display: block;
  animation: fadeIn 0.5s ease;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: var(--transition);
  border-radius: 6px;
  padding: 12px;
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-dark);
  font-weight: bold;
  font-size: 14px;
  min-width: 120px;
}

.result-value {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 14px;
  direction: ltr;
  text-align: left;
  flex: 1;
  margin-left: 15px;
  word-break: break-all;
}

.copy-indicator {
  color: var(--success-color);
  font-size: 12px;
  opacity: 0;
  transition: var(--transition);
  min-width: 60px;
  text-align: left;
}

.result-item.copied .copy-indicator {
  opacity: 1;
}

/* Print Button Styles */
.print-btn {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.print-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.print-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.print-btn-group {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.print-btn-group:hover {
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

/* Loading Animation */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  flex-direction: column;
}

.loading.show {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  color: var(--primary-color);
  font-size: 16px;
  font-weight: bold;
}

/* Bulk Processing Styles */
.bulk-section {
  padding: 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.bulk-header {
  text-align: center;
  margin-bottom: 30px;
}

.bulk-title {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.bulk-subtitle {
  color: var(--text-light);
  font-size: 1rem;
}

.template-section {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.template-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.template-btn {
  background: linear-gradient(135deg, var(--info-color), #138496);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.template-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.upload-area {
  border: 3px dashed #ddd;
  border-radius: var(--border-radius);
  padding: 40px 20px;
  text-align: center;
  transition: var(--transition);
  background: rgba(248, 249, 250, 0.5);
  cursor: pointer;
  margin-bottom: 20px;
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(153, 0, 0, 0.05);
}

.upload-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.upload-text {
  color: var(--text-dark);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.upload-hint {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.file-input {
  display: none;
}

.file-info {
  display: none;
  padding: 15px;
  background: var(--secondary-color);
  border-radius: var(--border-radius);
  margin-top: 15px;
  text-align: right;
}

.file-info.show {
  display: block;
}

.file-name {
  font-weight: bold;
  color: var(--primary-color);
}

.file-size {
  color: var(--text-light);
  font-size: 0.9rem;
}

.process-type-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.process-type {
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: white;
}

.process-type:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.process-type.selected {
  border-color: var(--primary-color);
  background: rgba(153, 0, 0, 0.05);
}

.process-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.process-name {
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.process-desc {
  font-size: 0.8rem;
  color: var(--text-light);
}

.bulk-results {
  margin-top: 30px;
  display: none;
}

.bulk-results.show {
  display: block;
  animation: fadeIn 0.5s ease;
}

.bulk-results-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.bulk-results-table th {
  background: var(--primary-color);
  color: white;
  padding: 12px 15px;
  text-align: right;
  font-weight: bold;
  position: sticky;
  top: 0;
}

.bulk-results-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e9ecef;
  text-align: right;
}

.bulk-results-table tr:hover {
  background: #f8f9fa;
}

.status-success {
  color: var(--success-color);
  font-weight: bold;
}

.status-error {
  color: var(--error-color);
  font-weight: bold;
}

.download-btn {
  background: linear-gradient(135deg, var(--success-color), #218838);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 0;
  display: none;
}

.progress-bar.show {
  display: block;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: none;
}

.progress-text.show {
  display: block;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 1.1rem;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}

.results-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
}

/* National Code Field Styles */
.national-code-section {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f2ff 100%);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 123, 255, 0.2);
}

.national-code-title {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.national-code-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.national-code-option:hover {
  background: #f8f9fa;
}

.national-code-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.national-code-label {
  color: var(--text-dark);
  font-weight: bold;
  font-size: 14px;
}

.national-code-hint {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 5px;
  padding-right: 28px;
}

.national-code-input-container {
  display: none;
  margin-top: 15px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.national-code-input-container.show {
  display: block;
}

.national-code-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.national-code-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  font-size: 14px;
  direction: ltr;
  text-align: left;
}

.national-code-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.1);
}

.national-code-input::placeholder {
  color: #999;
  text-align: right;
  direction: rtl;
}

.national-code-example {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 8px;
  padding-right: 10px;
}

/* Bank Search Styles */
.bank-search-container {
  position: relative;
}

.bank-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
}

.bank-search-results.show {
  display: block;
}

.bank-search-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid #f8f9fa;
}

.bank-search-item:hover {
  background: #f8f9fa;
}

.bank-search-item:last-child {
  border-bottom: none;
}

.bank-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bank-name {
  color: var(--text-dark);
  font-weight: 500;
}

.bank-number {
  color: var(--primary-color);
  font-family: monospace;
  font-size: 0.9rem;
}

.selected-bank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid #e9ecef;
  margin-top: 10px;
}

.selected-bank.hidden {
  display: none;
}

.clear-bank-btn {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.clear-bank-btn:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .banking-container {
    padding: 15px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .banking-card {
    padding: 20px;
  }

  .banking-title {
    font-size: 2rem;
  }

  .toast-container {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .result-value {
    margin-left: 0;
    text-align: right;
    width: 100%;
  }

  .process-type-selector {
    grid-template-columns: 1fr;
  }

  .bulk-section {
    padding: 20px;
  }

  .tabs {
    flex-direction: column;
  }

  .results-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .results-actions .print-btn,
  .results-actions .download-btn {
    width: 100%;
    justify-content: center;
  }

  .template-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .banking-title {
    font-size: 1.6rem;
  }

  .banking-subtitle {
    font-size: 1rem;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .print-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.items-center {
  align-items: center;
}

.gap-10 {
  gap: 10px;
}

.w-full {
  width: 100%;
}
