/* Google API Access Modal Styles */
.api-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.api-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.api-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.api-modal.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.api-modal-content {
  padding: 0;
  position: relative;
}

.api-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 30px 20px 30px;
  border-bottom: 2px solid #f8f9fa;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border-radius: 20px 20px 0 0;
}

.api-modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: white;
}

.api-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.api-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Form Styles */
.api-form {
  padding: 30px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: flex;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f8f9fa;
  color: #2c3e50;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #95a5a6;
  opacity: 1;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
  background: white;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* Checkbox Styles */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  opacity: 0;
  position: absolute;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #3498db;
  border-radius: 4px;
  background: white;
  position: relative;
  flex-shrink: 0; 
  transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #3498db;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-label a {
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* Submit Button */
.form-actions {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #f8f9fa;
}

.api-submit-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.api-submit-btn:hover {
  background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.api-submit-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Success Message */
.api-success-message {
  padding: 40px 30px;
  text-align: center;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: #27ae60;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: bold;
  margin: 0 auto 20px auto;
}

.api-success-message h4 {
  color: #2c3e50;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 15px 0;
}

.api-success-message p {
  color: #7f8c8d;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 25px 0;
}

.api-close-btn {
  padding: 12px 24px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.api-close-btn:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

/* Loading State */
.api-submit-btn.loading {
  position: relative;
  color: transparent;
}

.api-submit-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .api-modal {
    width: 95%;
    max-height: 95vh;
  }
  
  .api-modal-header {
    padding: 20px 20px 15px 20px;
  }
  
  .api-modal-header h3 {
    font-size: 20px;
  }
  
  .api-form {
    padding: 20px;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .api-submit-btn {
    padding: 14px 20px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .api-modal {
    width: 98%;
    border-radius: 15px;
  }
  
  .api-modal-header {
    padding: 15px 15px 10px 15px;
    border-radius: 15px 15px 0 0;
  }
  
  .api-modal-header h3 {
    font-size: 18px;
  }
  
  .api-form {
    padding: 15px;
  }
  
  .form-group label {
    font-size: 13px;
  }
  
  .checkbox-label {
    font-size: 13px;
  }
  
  .api-success-message {
    padding: 30px 15px;
  }
  
  .success-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .api-modal {
    background: #2c3e50;
    color: #ecf0f1;
  }
  
  .api-modal-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  }
  
  .form-group label {
    color: #ecf0f1;
  }
  
  .form-group input,
.form-group select,
.form-group textarea {
  background: #34495e;
  border-color: #4a5a6a;
  color: #ecf0f1;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #bdc3c7;
  opacity: 1;
}
  
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    background: #3a4a5a;
    border-color: #3498db;
  }
  
  .checkbox-label {
    color: #ecf0f1;
  }
  
  .checkmark {
    background: #34495e;
    border-color: #3498db;
  }
  
  .api-success-message h4 {
    color: #ecf0f1;
  }
  
  .api-success-message p {
    color: #bdc3c7;
  }
  
  .form-actions {
    border-top-color: #4a5a6a;
  }
}
