/* Base Styles */
:root {
  --primary: #fc2b5f;
  --primary-light: rgba(252, 43, 95, 0.1);
  --primary-dark: #e01e4f;
  --secondary: #fd5c82;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --background: #f9fafb;
  --card-background: #ffffff;
  --border-color: #e5e7eb;
  --border-color-focus: #fc2b5f;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.2s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 16px;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 1.875rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

/* Header */
.app-header {
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 2.5rem;
}

.header-title {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

.header-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Environment Selector */
.environment-selector-container {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}

.environment-selector {
  background-color: var(--card-background);
  border-radius: var(--radius);
  padding: 0.5rem;
  display: flex;
  position: relative;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.environment-selector-slider {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  height: calc(100% - 1rem);
  width: calc(50% - 0.5rem);
  background-color: var(--primary-light);
  border-radius: var(--radius);
  transition: var(--transition);
  z-index: 0;
}

.environment-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

.environment-option.active {
  color: var(--primary);
}

.environment-option:hover:not(.active) {
  color: var(--text-secondary);
}

.environment-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
}

/* Card */
.card {
  background-color: var(--card-background);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.main-card {
  position: relative;
  margin-top: 1.5rem;
}

.main-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.25rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.card-content {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Progress Bar */
.progress-container {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-bar {
  height: 0.625rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 9999px;
  width: 0;
  transition: width 0.5s ease;
}

/* Hexagonal Menu */
.hexagonal-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.hexagon-button {
  position: relative;
  width: 6rem;
  height: 6rem;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.hexagon-button.active {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.hexagon-button:hover:not(.active) {
  background-color: #f9fafb;
}

.hexagon-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.hexagon-icon {
  font-size: 1.5rem;
}

.hexagon-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

/* Form Container */
.form-container {
  padding: 1.5rem;
}

/* Form Sections */
.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-box {
  background-color: #f9fafb;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.subsection-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.section-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Form Fields */
.form-field {
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid.three-columns {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--card-background);
  font-size: 0.875rem;
  transition: var(--transition);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 2px rgba(252, 43, 95, 0.2);
}

.textarea {
  min-height: 6.25rem;
  resize: vertical;
}

.select-container {
  position: relative;
}

.select-container::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  width: 0.75rem;
  height: 0.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}

/* Date Picker */
.date-picker-container {
  position: relative;
}

/* Country Selector */
.country-selector {
  position: relative;
}

.country-selector-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--card-background);
  cursor: pointer;
  transition: var(--transition);
}

.country-selector-button:hover {
  background-color: #f9fafb;
}

.country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 15rem;
  overflow-y: auto;
  display: none;
}

.country-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.country-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.5rem;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: var(--transition);
}

.country-option:hover {
  background-color: #f9fafb;
}

.country-option.selected {
  background-color: var(--primary-light);
  color: var(--primary);
}

.country-flag {
  font-size: 1.5rem;
}

.country-name {
  font-size: 0.875rem;
}

.country-placeholder {
  color: var(--text-muted);
}

/* File Upload */
.file-upload-container {
  width: 100%;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 10rem;
  border: 2px dashed rgba(252, 43, 95, 0.3);
  border-radius: var(--radius);
  background-color: var(--card-background);
  cursor: pointer;
  transition: var(--transition);
  padding: 1.5rem;
}

.file-upload-label:hover {
  background-color: #f9fafb;
}

.upload-icon-container {
  position: relative;
  margin-bottom: 0.75rem;
}

.upload-icon-container i {
  font-size: 3rem;
  color: var(--primary);
}

.upload-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.upload-text {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0;
}

.file-input {
  display: none;
}

/* Image Preview */
.image-preview-container {
  margin-top: 1.5rem;
}

.preview-count {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: 0.75rem;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-preview-item:hover .preview-image {
  transform: scale(1.1);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
}

.image-preview-item:hover .preview-overlay {
  opacity: 1;
}

.remove-image-btn {
  background-color: rgba(239, 68, 68, 0.8);
  color: white;
  border: none;
  border-radius: 9999px;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.remove-image-btn:hover {
  background-color: var(--error);
}

/* Transactions */
.transaction-form-card {
  margin-bottom: 1.5rem;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transaction-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--card-background);
  box-shadow: var(--shadow-sm);
}

.transaction-content {
  padding: 1.5rem;
}

.transaction-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.transaction-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.transaction-actions {
  display: flex;
  gap: 0.5rem;
}

.transaction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.transaction-field {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.field-value {
  font-size: 0.875rem;
  font-weight: 500;
}

.transaction-images-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.transaction-images-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Alert Box */
.alert-box {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #92400e;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.alert-message {
  color: #92400e;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.alert-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  background-color: rgba(245, 158, 11, 0.2);
  color: #92400e;
}

/* Form Navigation */
.form-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

/* Certificate Preview */
.certificate-preview-container {
  margin-top: 2rem;
}

.certificate-preview-card {
  background-color: var(--card-background);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.certificate-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.25rem;
}

.certificate-preview-content {
  padding: 1.5rem;
  max-height: 30rem;
  overflow-y: auto;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.toast {
  background-color: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 18rem;
  max-width: 24rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--error);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--error);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info .toast-icon {
  color: var(--primary);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.font-semibold {
  font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .form-navigation {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-navigation button {
    width: 100%;
  }
}
