/* ==========================================
   MODALS - Premium Design
   ========================================== */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: modal-fade-in 0.3s ease-out;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-closing {
  animation: modal-fade-out 0.3s ease-out;
}

@keyframes modal-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Modal Container */
.modal-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-slide-up 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-large {
  max-width: 800px;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.modal-header {
  padding: 30px 30px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #64748b;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #1e3c3c;
  transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Modal Footer */
.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Sections */
.form-section {
  margin-bottom: 30px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1e3c3c;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #1e3c3c;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-textarea {
  resize: vertical;
  font-family: inherit;
}

/* Input with Button */
.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button .form-input {
  flex: 1;
}

.input-button {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.input-button:hover {
  background: #1e3c3c;
  color: white;
  border-color: #1e3c3c;
}

.input-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* CV Upload Dropzone */
.cv-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s;
  background: #f8fafc;
}

.cv-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cv-dropzone-active {
  border-color: #1e3c3c;
  background: #f1f5f9;
  transform: scale(1.02);
}

.cv-file-preview {
  padding: 20px;
  background: white;
  border-radius: 6px;
}

/* Rating Input */
.rating-input {
  display: flex;
  gap: 8px;
}

.rating-star {
  cursor: pointer;
  position: relative;
}

.rating-star input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rating-star i {
  font-size: 24px;
  color: #cbd5e1;
  transition: all 0.2s;
}

.rating-star:hover i,
.rating-star input:checked ~ i,
.rating-star input:checked + i {
  color: #fbbf24;
  transform: scale(1.1);
}

/* Branches Checkboxes */
.branches-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.branch-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.branch-checkbox:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.branch-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.branch-checkbox input:checked + span {
  font-weight: 600;
  color: #1e3c3c;
}

.branch-checkbox span {
  font-size: 14px;
  color: #475569;
}

/* AI Tags */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #1e3c3c 0%, #163030 100%);
  color: white;
  border-radius: 20px;
  font-size: 13px;
  animation: tag-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes tag-pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ai-tag-name {
  font-weight: 500;
}

.ai-tag-confidence {
  font-size: 11px;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
}

.ai-tag-remove {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
}

.ai-tag-remove:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Contact Person Item */
.contact-person-item {
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.contact-person-item:last-child {
  margin-bottom: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #475569;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Buttons */
.btn-primary {
  padding: 12px 24px;
  background: #1e3c3c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: #163030;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 12px 24px;
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

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

/* Responsive */
@media (max-width: 768px) {
  .modal-container {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .modal-large {
    max-width: 100%;
  }
  
  .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }
}
