/* 🚗 Modal de Criação de Veículo - Design Moderno */

.vehicle-create-modal-container {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 8px 40px rgba(0, 0, 0, 0.12);
  position: relative;
  
  @media (max-width: 768px) {
    max-width: 90vw;
    border-radius: 0;
  }
}

/* ========================================
   ❌ BOTÃO DE FECHAR (CANTO SUPERIOR DIREITO)
======================================== */
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: #666666;
  font-size: 14px;
  transition: all 0.2s ease;
  
  &:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
  }
  
  &:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

/* ========================================
   📱 HEADER CENTRALIZADO
======================================== */
.modal-header {
  padding: 40px 32px 24px;
  text-align: center;
  background: transparent;
  
  .vehicle-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--idt-primary-color) 0%, var(--idt-primary-tint) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--idt-primary-contrast);
    box-shadow: 0 4px 12px rgba(255, 200, 46, 0.15);
    
    i {
      animation: float 3s ease-in-out infinite;
    }
  }
  
  .modal-title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
  }
  
  .modal-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.4;
  }
}

/* ========================================
   📝 FORMULÁRIO
======================================== */
.modal-form {
  display: flex;
  flex-direction: column;
}

.form-content {
  padding: 0 32px 24px;
}

.input-group {
  .input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
  }
  
  .plate-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.2s ease;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
    
    &::placeholder {
      color: #999999;
      font-weight: 400;
      letter-spacing: 1px;
    }
    
    &:focus {
      outline: none;
      border-color: #2196F3;
      box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.08);
      background: #fafafa;
    }
    
    &.error {
      border-color: #f44336;
      background: rgba(244, 67, 54, 0.03);
      
      &:focus {
        box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.08);
      }
    }
    
    &:disabled {
      background: #f5f5f5;
      color: #bdbdbd;
      cursor: not-allowed;
    }
  }
  
  .error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #f44336;
    font-size: 12px;
    font-weight: 500;
    
    i {
      font-size: 11px;
    }
  }
  
  .input-hint {
    margin-top: 8px;
    color: #999999;
    font-size: 12px;
    line-height: 1.4;
  }
}

/* ========================================
   🎯 BOTÕES DE AÇÃO
======================================== */
.modal-actions {
  padding: 0 32px 32px;
  display: flex;
  gap: 12px;
  
  .btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none !important;
    }
    
    &.btn-cancel {
      background: #f5f5f5;
      color: #666666;
      border: 1px solid #e0e0e0;
      
      &:hover:not(:disabled) {
        background: #eeeeee;
        transform: translateY(-1px);
      }
    }
    
    &.btn-submit {
      background: linear-gradient(135deg, #FFC107 0%, #FF8F00 100%);
      color: #1a1a1a;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(255, 193, 7, 0.25);
      
      &:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
      }
      
      &:active:not(:disabled) {
        transform: translateY(0);
      }
      
      &:disabled {
        background: var(--surface-disabled, #f5f5f5);
        color: var(--text-disabled, #bdbdbd);
        box-shadow: none;
      }
    }
  }
  
  .loading-content {
    display: flex;
    align-items: center;
    gap: 8px;
    
    i {
      animation: spin 1s linear infinite;
    }
  }
}

/* ========================================
   🔄 OVERLAY DE LOADING
======================================== */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(2px);
  border-radius: 20px;
  
  .loading-spinner {
    text-align: center;
    
    i {
      font-size: 32px;
      color: #2196F3;
      margin-bottom: 12px;
      display: block;
    }
    
    p {
      margin: 0;
      color: #1a1a1a;
      font-weight: 500;
      font-size: 14px;
    }
  }
}

/* ========================================
   🎨 ANIMAÇÕES
======================================== */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

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

.fa-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ========================================
   ☀️ MODO CLARO (EXPLÍCITO)
======================================== */
:host-context(.light-theme) {
  .vehicle-create-modal-container {
    background: #ffffff !important;
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.08),
      0 8px 40px rgba(0, 0, 0, 0.12);
  }
  
  .modal-close-btn {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #666666 !important;
    
    &:hover:not(:disabled) {
      background: rgba(0, 0, 0, 0.1) !important;
    }
  }
  
  .modal-header {
    .vehicle-icon {
      background: linear-gradient(135deg, var(--idt-primary-color) 0%, var(--idt-primary-tint) 100%) !important;
      color: var(--idt-primary-contrast) !important;
      box-shadow: 0 4px 12px rgba(255, 200, 46, 0.15) !important;
    }
    
    .modal-title {
      color: #1a1a1a !important;
    }
    
    .modal-subtitle {
      color: #666666 !important;
    }
  }
  
  .input-group {
    .input-label {
      color: #1a1a1a !important;
    }
    
    .plate-input {
      background: #ffffff !important;
      border-color: #e0e0e0 !important;
      color: #1a1a1a !important;
      
      &::placeholder {
        color: #999999 !important;
      }
      
      &:focus {
        background: #fafafa !important;
        border-color: #2196F3 !important;
        box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.08) !important;
      }
      
      &.error {
        background: rgba(244, 67, 54, 0.03) !important;
      }
      
      &:disabled {
        background: #f5f5f5 !important;
        color: #bdbdbd !important;
      }
    }
    
    .input-hint {
      color: #999999 !important;
    }
  }
  
  .modal-actions {
    .btn.btn-cancel {
      background: #f5f5f5 !important;
      color: #666666 !important;
      border-color: #e0e0e0 !important;
      
      &:hover:not(:disabled) {
        background: #eeeeee !important;
      }
    }
  }
  
  .loading-overlay {
    background: rgba(255, 255, 255, 0.95) !important;
    
    .loading-spinner {
      i {
        color: #2196F3 !important;
      }
      
      p {
        color: #1a1a1a !important;
      }
    }
  }
}

/* ========================================
   📱 RESPONSIVIDADE MOBILE
======================================== */
@media (max-width: 768px) {
  .vehicle-create-modal-container {
    max-width: 95vw;
    margin: 12px;
  }
  
  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .modal-header {
    padding: 32px 24px 20px;
    
    .vehicle-icon {
      width: 56px;
      height: 56px;
      font-size: 24px;
      margin-bottom: 16px;
    }
    
    .modal-title {
      font-size: 20px;
    }
    
    .modal-subtitle {
      font-size: 13px;
    }
  }
  
  .form-content {
    padding: 0 24px 20px;
  }
  
  .modal-actions {
    padding: 0 24px 24px;
    flex-direction: column;
    gap: 8px;
    
    .btn {
      width: 100%;
      height: 48px;
    }
  }
  
  .input-group .plate-input {
    height: 52px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .vehicle-create-modal-container {
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .loading-overlay {
    border-radius: 0;
  }
}
  
/* ========================================
   🌙 MODO ESCURO
======================================== */
:host-context(.dark-theme) {
  .vehicle-create-modal-container {
    background: #1e1e1e !important;
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.3),
      0 8px 40px rgba(0, 0, 0, 0.4);
  }
  
  .modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    
    &:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.2);
    }
  }
  
  .modal-header {
    .vehicle-icon {
      background: linear-gradient(135deg, var(--idt-primary-color) 0%, var(--idt-primary-tint) 100%);
      color: var(--idt-primary-contrast);
      box-shadow: 0 4px 12px rgba(255, 200, 46, 0.25);
    }
    
    .modal-title {
      color: #ffffff;
    }
    
    .modal-subtitle {
      color: #aaaaaa;
    }
  }
  
  .input-group {
    .input-label {
      color: #ffffff;
    }
    
    .plate-input {
      background: #2e2e2e;
      border-color: #404040;
      color: #ffffff;
      
      &::placeholder {
        color: #aaaaaa;
      }
      
      &:focus {
        background: #383838;
        border-color: #64B5F6;
        box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.15);
      }
      
      &.error {
        background: rgba(244, 67, 54, 0.1);
      }
      
      &:disabled {
        background: #1a1a1a;
        color: #666666;
      }
    }
    
    .input-hint {
      color: #aaaaaa;
    }
  }
  
  .modal-actions {
    .btn.btn-cancel {
      background: #2e2e2e;
      color: #ffffff;
      border-color: #404040;
      
      &:hover:not(:disabled) {
        background: #3e3e3e;
      }
    }
  }
  
  .loading-overlay {
    background: rgba(30, 30, 30, 0.95);
    
    .loading-spinner {
      i {
        color: #64B5F6;
      }
      
      p {
        color: #ffffff;
      }
    }
  }
}