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

.vehicle-status-modal-container {
  width: 100%;
  max-width: 600px;
  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: 95vw;
    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;
  
  .status-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
    transition: all 0.3s ease;
    
    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;
  }
}

/* ========================================
   🚗 SEÇÃO DE VEÍCULOS SELECIONADOS
======================================== */
.selected-vehicles-section {
  padding: 0 32px 24px;
  border-bottom: 1px solid #f0f0f0;
  
  .vehicles-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    
    i {
      color: #666666;
    }
  }
  
  .vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    
    &::-webkit-scrollbar {
      width: 4px;
    }
    
    &::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 2px;
    }
    
    &::-webkit-scrollbar-thumb {
      background: #c1c1c1;
      border-radius: 2px;
    }
  }
  
  .vehicle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    
    &:hover {
      background: #e9ecef;
      border-color: #dee2e6;
    }
    
    .vehicle-info {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
      
      .vehicle-plate {
        font-weight: 700;
        color: #1a1a1a;
        font-size: 14px;
        letter-spacing: 1px;
      }
      
      .vehicle-model {
        color: #666666;
        font-size: 13px;
      }
      
      .vehicle-current-status {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        
        &.status-available { background: #d4edda; color: #155724; }
        &.status-maintenance { background: #fff3cd; color: #856404; }
        &.status-under_maintenance { background: #fff3cd; color: #856404; }
        &.status-sold { background: #e1bee7; color: #4a148c; }
        &.status-rented { background: #d7ccc8; color: #3e2723; }
        &.status-stolen { background: #ffecb3; color: #e65100; }
        &.status-unknown { background: #f5f5f5; color: #666666; }
      }
    }
    
    .remove-btn {
      width: 24px;
      height: 24px;
      border: none;
      background: rgba(244, 67, 54, 0.1);
      border-radius: 50%;
      color: #f44336;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      
      &:hover:not(:disabled) {
        background: rgba(244, 67, 54, 0.2);
        transform: scale(1.1);
      }
      
      &:disabled {
        opacity: 0.4;
        cursor: not-allowed;
      }
    }
  }
}

/* ========================================
   🚗 VEÍCULO ÚNICO
======================================== */
.single-vehicle-section {
  padding: 0 32px 24px;
  border-bottom: 1px solid #f0f0f0;
  
  .vehicle-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #dee2e6;
    
    .vehicle-details {
      .vehicle-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 8px;
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
        
        i {
          color: #FF9800;
        }
      }
      
      .vehicle-description {
        margin: 0;
        color: #666666;
        font-size: 14px;
        
        .current-status {
          display: block;
          margin-top: 8px;
          font-size: 13px;
          
          .status-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            
            &.status-available { background: #d4edda; color: #155724; }
            &.status-maintenance { background: #fff3cd; color: #856404; }
            &.status-under_maintenance { background: #fff3cd; color: #856404; }
            &.status-sold { background: #e1bee7; color: #4a148c; }
            &.status-rented { background: #d7ccc8; color: #3e2723; }
            &.status-stolen { background: #ffecb3; color: #e65100; }
            &.status-unknown { background: #f5f5f5; color: #666666; }
          }
        }
      }
    }
  }
}

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

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

.input-group {
  margin-bottom: 20px;
  
  .input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
    
    i {
      color: #666666;
      width: 16px;
    }
  }
  
  .status-select,
  .person-select,
  .cliente-select,
  .fornecedor-select,
  .date-input,
  .text-input {
    width: 100%;
    height: 44px;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.2s ease;
    
    &::placeholder {
      color: #999999;
    }
    
    &:focus {
      outline: none;
      border-color: #FF9800;
      box-shadow: 0 0 0 3px rgba(255, 152, 0, 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;
    }
  }
  
  .textarea-input {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.2s ease;
    resize: vertical;
    font-family: inherit;
    
    &::placeholder {
      color: #999999;
    }
    
    &:focus {
      outline: none;
      border-color: #FF9800;
      box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.08);
      background: #fafafa;
    }
    
    &:disabled {
      background: #f5f5f5;
      color: #bdbdbd;
      cursor: not-allowed;
    }
  }
  
  .error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #f44336;
    font-size: 12px;
    font-weight: 500;
    
    i {
      font-size: 11px;
    }
  }
  
  .input-hint {
    margin-top: 6px;
    color: #999999;
    font-size: 12px;
    line-height: 1.4;
  }
  
  .loading-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: #666666;
    font-size: 12px;
    
    i {
      animation: spin 1s linear infinite;
    }
  }
}

.conditional-fields {
  .input-group {
    animation: slideDown 0.3s ease-out;
  }
}

/* ========================================
   🎯 BOTÕES DE AÇÃO
======================================== */
.modal-actions {
  padding: 0 32px 32px;
  display: flex;
  gap: 12px;
  
  .btn {
    flex: 1;
    height: 48px;
    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, #FF9800 0%, #F57C00 100%);
      color: #ffffff;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(255, 152, 0, 0.25);
      
      &:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
      }
      
      &:active:not(:disabled) {
        transform: translateY(0);
      }
      
      &:disabled {
        background: var(--surface-disabled, #f5f5f5);
        color: var(--text-disabled, #bdbdbd);
        box-shadow: none;
      }
      
      .vehicle-count {
        font-size: 12px;
        opacity: 0.9;
      }
    }
  }
  
  .submit-content,
  .loading-content {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .loading-content 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: #FF9800;
      margin-bottom: 12px;
      display: block;
    }
    
    p {
      margin: 0 0 8px;
      color: #1a1a1a;
      font-weight: 500;
      font-size: 14px;
    }
    
    .progress-info {
      small {
        color: #666666;
        font-size: 12px;
      }
    }
  }
}

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

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.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-status-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 {
    .status-icon {
      background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25) !important;
    }
    
    .modal-title {
      color: #1a1a1a !important;
    }
    
    .modal-subtitle {
      color: #666666 !important;
    }
  }
  
  .selected-vehicles-section {
    border-bottom-color: #f0f0f0 !important;
    
    .vehicles-header {
      color: #1a1a1a !important;
    }
    
    .vehicle-item {
      background: #f8f9fa !important;
      border-color: #e9ecef !important;
      
      &:hover {
        background: #e9ecef !important;
        border-color: #dee2e6 !important;
      }
    }
  }
  
  .single-vehicle-section {
    border-bottom-color: #f0f0f0 !important;
    
    .vehicle-card {
      background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
      border-color: #dee2e6 !important;
    }
  }
  
  .input-group {
    .input-label {
      color: #1a1a1a !important;
    }
    
    .status-select,
    .person-select,
    .cliente-select,
    .fornecedor-select,
    .date-input,
    .text-input,
    .textarea-input {
      background: #ffffff !important;
      border-color: #e0e0e0 !important;
      color: #1a1a1a !important;
      
      &::placeholder {
        color: #999999 !important;
      }
      
      &:focus {
        background: #fafafa !important;
        border-color: #FF9800 !important;
        box-shadow: 0 0 0 3px rgba(255, 152, 0, 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: #FF9800 !important;
      }
      
      p {
        color: #1a1a1a !important;
      }
    }
  }
}

/* ========================================
   🌙 MODO ESCURO
======================================== */
:host-context(.dark-theme) {
  .vehicle-status-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 {
    .status-icon {
      background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
    }
    
    .modal-title {
      color: #ffffff;
    }
    
    .modal-subtitle {
      color: #aaaaaa;
    }
  }
  
  .selected-vehicles-section {
    border-bottom-color: #404040;
    
    .vehicles-header {
      color: #ffffff;
    }
    
    .vehicle-item {
      background: #2e2e2e;
      border-color: #404040;
      
      &:hover {
        background: #383838;
        border-color: #505050;
      }
      
      .vehicle-info {
        .vehicle-plate {
          color: #ffffff;
        }
        
        .vehicle-model {
          color: #aaaaaa;
        }
      }
    }
  }
  
  .single-vehicle-section {
    border-bottom-color: #404040;
    
    .vehicle-card {
      background: linear-gradient(135deg, #2e2e2e 0%, #383838 100%);
      border-color: #404040;
      
      .vehicle-details {
        .vehicle-title {
          color: #ffffff;
        }
        
        .vehicle-description {
          color: #aaaaaa;
        }
      }
    }
  }
  
  .input-group {
    .input-label {
      color: #ffffff;
    }
    
    .status-select,
    .person-select,
    .cliente-select,
    .fornecedor-select,
    .date-input,
    .text-input,
    .textarea-input {
      background: #2e2e2e;
      border-color: #404040;
      color: #ffffff;
      
      &::placeholder {
        color: #aaaaaa;
      }
      
      &:focus {
        background: #383838;
        border-color: #FFB74D;
        box-shadow: 0 0 0 3px rgba(255, 183, 77, 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: #FFB74D;
      }
      
      p {
        color: #ffffff;
      }
      
      .progress-info small {
        color: #aaaaaa;
      }
    }
  }
}

/* ========================================
   📱 RESPONSIVIDADE MOBILE
======================================== */
@media (max-width: 768px) {
  .vehicle-status-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;
    
    .status-icon {
      width: 56px;
      height: 56px;
      font-size: 24px;
      margin-bottom: 16px;
    }
    
    .modal-title {
      font-size: 20px;
    }
    
    .modal-subtitle {
      font-size: 13px;
    }
  }
  
  .selected-vehicles-section,
  .single-vehicle-section {
    padding: 0 24px 20px;
  }
  
  .form-content {
    padding: 20px 24px;
  }
  
  .modal-actions {
    padding: 0 24px 24px;
    flex-direction: column;
    gap: 8px;
    
    .btn {
      width: 100%;
      height: 48px;
    }
  }
  
  .input-group {
    .status-select,
    .person-select,
    .cliente-select,
    .fornecedor-select,
    .date-input,
    .text-input {
      height: 48px;
      font-size: 15px;
    }
  }
}

@media (max-width: 480px) {
  .vehicle-status-modal-container {
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  
  .loading-overlay {
    border-radius: 0;
  }
  
  .selected-vehicles-section {
    .vehicles-list {
      max-height: 150px;
    }
    
    .vehicle-item {
      padding: 10px 12px;
      
      .vehicle-info {
        gap: 8px;
        
        .vehicle-plate {
          font-size: 13px;
        }
        
        .vehicle-model {
          font-size: 12px;
        }
      }
    }
  }
}
