/* Credential Manager Styles */

.credential-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.credential-modal-content {
  background: white;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.credential-header {
  background: #007bff;
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.credential-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.credential-section {
  padding: 20px;
}

.credential-section h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.credential-section h5 {
  margin: 20px 0 10px 0;
  color: #555;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.credential-section input {
  width: 100%;
  padding: 10px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.credential-section input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.credential-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.credential-buttons button,
.credential-section button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.credential-buttons button {
  background: #007bff;
  color: white;
  flex: 1;
  min-width: 120px;
}

.credential-buttons button:hover {
  background: #0056b3;
}

.add-credential button {
  background: #28a745;
  color: white;
  width: 100%;
  margin-top: 10px;
}

.add-credential button:hover {
  background: #1e7e34;
}

.credential-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
  margin: 5px 0;
  background: #f8f9fa;
}

.credential-name {
  font-family: monospace;
  font-size: 13px;
  color: #495057;
  flex: 1;
}

.remove-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.remove-btn:hover {
  background: #c82333;
}

.credential-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.credential-actions button {
  background: #6c757d;
  color: white;
  flex: 1;
  min-width: 100px;
}

.credential-actions button:hover {
  background: #545b62;
}

.credential-actions button.danger {
  background: #dc3545;
}

.credential-actions button.danger:hover {
  background: #c82333;
}

.credential-toggle-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 10px;
}

.credential-toggle-btn:hover {
  background: #0056b3;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .credential-modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .credential-buttons {
    flex-direction: column;
  }
  
  .credential-buttons button {
    min-width: auto;
  }
  
  .credential-actions {
    flex-direction: column;
  }
  
  .credential-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .credential-name {
    word-break: break-all;
  }
}

/* Success/Error messages */
.credential-message {
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 14px;
}

.credential-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.credential-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Loading state */
.credential-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: credential-spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes credential-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}