/* Modern and Fancy CSS for Lead Collection System */
:root {
  --primary-color: #4361ee;
  --primary-dark: #3a56d4;
  --secondary-color: #7209b7;
  --accent-color: #f72585;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4cc9f0;
  --error-color: #e63946;
  --gray-light: #e9ecef;
  --gray-medium: #adb5bd;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Card styles */
.card {
  background-color: white;
  border-radius: 15px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Form styles */
.form-container {
  max-width: 400px;
  width: 100%;
  padding: 40px;
  text-align: center;
}

.form-title {
  margin-bottom: 30px;
  color: var(--dark-color);
  font-weight: 700;
  font-size: 28px;
  position: relative;
}

.form-title:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  border-radius: 5px;
}

.input-group {
  position: relative;
  margin-bottom: 25px;
}

.input-group input {
  width: 100%;
  padding: 15px 15px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  outline: none;
  font-size: 16px;
  color: var(--dark-color);
  transition: var(--transition);
}

.input-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.1);
}

.input-group label {
  position: absolute;
  top: -10px;
  left: 10px;
  background-color: white;
  padding: 0 5px;
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.btn {
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: var(--transition);
  width: 100%;
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(67, 97, 238, 0.2);
}

/* Logo and branding */
.logo-container {
  margin-bottom: 30px;
}

.logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: white;
  font-size: 28px;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* Alert messages */
.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
  animation: fadeIn 0.5s ease;
}

.alert-error {
  background-color: rgba(230, 57, 70, 0.1);
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: var(--error-color);
}

.alert-success {
  background-color: rgba(76, 201, 240, 0.1);
  border: 1px solid rgba(76, 201, 240, 0.3);
  color: var(--success-color);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(67, 97, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0); }
}

/* Loader */
.loader {
  display: none;
  width: 25px;
  height: 25px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Media Queries */
@media screen and (max-width: 768px) {
  .form-container {
    padding: 20px;
  }
  
  .form-title {
    font-size: 24px;
  }
  
  .input-group input {
    padding: 12px;
    font-size: 14px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Main page styles */
.dashboard {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
}

.dashboard-header {
  background: white;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* Dropdown menu styles */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: var(--dark-color);
  font-weight: 500;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 5px;
  transition: var(--transition);
}

.dropdown-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-toggle::after {
  content: '▼';
  font-size: 10px;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.dropdown.active .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(5px);
}

.dropdown-item {
  display: block;
  padding: 12px 15px;
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition);
  opacity: 0.8;
}

.dropdown-item:hover {
  background-color: rgba(67, 97, 238, 0.05);
  opacity: 1;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

/* Business card button styles */
.business-card-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  margin-left: 15px;
  transition: var(--transition);
  font-weight: 500;
}

.business-card-btn:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
  transform: translateY(-2px);
}

.business-card-btn:active {
  transform: translateY(0);
}

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

.dashboard-main {
  flex: 1;
  padding: 30px;
  background: #f5f7fa;
}

.card-container {
  background: white;
  border-radius: 15px;
  box-shadow: var(--box-shadow);
  padding: 30px;
  margin-bottom: 30px;
  animation: fadeIn 0.5s ease;
}

.section-title {
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--dark-color);
  position: relative;
  padding-left: 15px;
}

.section-title:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 5px;
  background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
  border-radius: 5px;
}

/* Form styles for lead collection */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.form-col {
  flex: 1;
  padding: 0 10px;
  min-width: 200px;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  font-size: 16px;
  transition: var(--transition);
  height: 48px;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.1);
}

/* Safari-specific styling for selects */
select.form-control {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23adb5bd' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 30px;
}

/* Fix for input type specific styling */
input[type="email"].form-control,
input[type="tel"].form-control,
input[type="text"].form-control,
input[type="password"].form-control {
  height: 48px;
}

/* Additional fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
  select.form-control,
  input.form-control {
    font-size: 16px; /* Prevents zoom on focus in iOS */
    line-height: 1.3;
    height: 48px;
  }
}

textarea.form-control {
  min-height: 120px;
  height: auto;
  resize: vertical;
  padding: 12px 15px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Card scan section */
.scan-card-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
  padding: 20px;
  border: 2px dashed var(--gray-medium);
  border-radius: 10px;
  text-align: center;
  transition: var(--transition);
  background-color: rgba(248, 249, 250, 0.5);
}

.scan-card-section:hover {
  border-color: var(--primary-color);
  background-color: rgba(248, 249, 250, 0.8);
}

.scan-icon {
  font-size: 48px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.drag-text {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.camera-btn {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
}

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

#recognize-btn {
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#recognize-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* Image preview area */
.preview-container {
  margin-top: 20px;
  display: none;
  position: relative;
  text-align: center;
}

.preview-image {
  width: 100%;
  max-width: 300px;
  height: 200px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  background-color: #f8f9fa;
}

/* Delete photo button */
.delete-photo {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--error-color);
  color: white;
  border: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 2;
  transition: all 0.3s ease;
}

.delete-photo:hover {
  background-color: #d32f2f;
  transform: scale(1.1);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(67, 97, 238, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

.loading-text {
  margin-top: 20px;
  font-size: 18px;
  color: var(--primary-color);
  font-weight: 500;
}

/* Actions */
.actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

/* Submit button hover effect */
.btn-submit {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-submit:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s ease;
  z-index: -1;
}

.btn-submit:hover:after {
  transform: scaleX(1);
  transform-origin: left;
}
