.deployments-page {
  padding: 2rem;
}

.deployments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.view-toggle {
  display: flex;
  background: #f5f5f5;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}

.view-toggle-btn:hover {
  background: #eee;
}

.view-toggle-btn.active {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-toggle-btn .icon {
  font-size: 1.2rem;
}

.view-toggle-btn .label {
  font-size: 0.9rem;
  font-weight: 500;
}

.new-deployment-btn {
  background: var(--primary-color, #2196f3);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.deployment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.progress-bar {
  display: none;
}

.progress {
  height: 100%;
  background: var(--primary-color, #2196f3);
  border-radius: 2px;
  transition: width 0.3s;
}

.step-1 { width: 33.33%; }
.step-2 { width: 66.66%; }
.step-3 { width: 100%; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.template-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.template-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.template-card.selected {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

.template-card .card-body {
  padding: 15px;
}

.template-card .template-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.template-card .card-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.template-card .card-text {
  font-size: 0.9rem;
  color: #666;
}

.deployments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.deployment-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 1.5rem;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.deployment-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-dot.running { background: #4caf50; }
.status-dot.paused { background: #ff9800; }
.status-dot.failed { background: #f44336; }

.deployment-card footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: #f5f5f5;
}

.icon-btn.danger:hover {
  background: #ffebee;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  grid-column: 1 / -1;
}

.empty-state img {
  max-width: 200px;
  margin-bottom: 1rem;
}

.icon-btn[title="Edit"]:hover {
  background: #e3f2fd;
  color: #1976d2;
}

.modal-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #f5f5f5;
}

.step {
  margin: 2rem 0;
}

.step h3 {
  margin-bottom: 1rem;
  color: #333;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.input-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  margin-bottom: 0;
}

.input-group input[type="text"]:focus {
  border-color: var(--primary-color, #2196f3);
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

input[type="text"] {
  margin-bottom: 0;
}

.modal-content footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.modal-content footer button {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-content footer button.primary {
  background: var(--primary-color, #2196f3);
  color: white;
  border: none;
}

.modal-content footer button:not(.primary) {
  background: none;
  border: 2px solid #eee;
}

.modal-content footer button:hover {
  opacity: 0.9;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.region-card {
  position: relative;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.region-card:hover {
  border-color: var(--primary-color, #2196f3);
  background: var(--primary-color-light, #e3f2fd);
}

.region-card.selected {
  border-color: var(--primary-color, #2196f3);
  background: var(--primary-color-light, #e3f2fd);
}

.region-selected-mark {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--primary-color, #2196f3);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.region-location {
  font-size: 0.8rem;
  color: #666;
}

.helper-text {
  color: #666;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.ha-notice {
  margin: 1rem 0;
  padding: 1rem;
  background: #f3f9ff;
  border-radius: 8px;
  border: 1px solid #bbdefb;
}

.ha-notice p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: #1976d2;
}

.ha-icon {
  font-size: 1.2rem;
}

.regions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.region-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #666;
}

.git-url {
  color: #666;
  font-family: monospace;
  font-size: 0.9rem;
  margin: 0;
}

.resources-config {
  margin-top: 2rem;
}

.resource-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.9rem;
  color: #666;
}

.input-group select {
  padding: 0.75rem;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
}

.domain-config {
  margin-bottom: 2rem;
}

.domain-toggle {
  margin: 1rem 0;
}

.domain-toggle label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.env-vars {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
}

.env-vars-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.env-vars-header h5 {
  margin: 0;
  color: #666;
  font-weight: normal;
}

.env-vars-list {
  background: white;
  border-radius: 8px;
  border: 1px solid #eee;
  overflow: hidden;
}

.env-var-header {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.env-var-row {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 0.5rem;
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.env-var-row:last-child {
  border-bottom: none;
}

.env-var-row input {
  padding: 0.5rem;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: monospace;
}

.env-var-row input:focus {
  border-color: var(--primary-color, #2196f3);
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.env-var-row input.error {
  border-color: #f44336;
}

.env-vars-empty {
  text-align: center;
  padding: 2rem;
  color: #666;
  background: white;
  border-radius: 8px;
  border: 1px solid #eee;
}

.add-env-btn {
  background: var(--primary-color, #2196f3);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.add-env-btn:hover {
  opacity: 0.9;
}

.remove-env-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.remove-env-btn:hover {
  background: #ffebee;
  color: #f44336;
}

.step h4 {
  margin: 1.5rem 0 1rem;
  color: #666;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

.status-dot.running {
  background: #4caf50;
  box-shadow: 0 0 4px #4caf50;
}

.status-dot.paused {
  background: #ff9800;
  box-shadow: 0 0 4px #ff9800;
}

.status-dot.failed {
  background: #f44336;
  box-shadow: 0 0 4px #f44336;
}

.status-dot.deleted {
  background: #666;
  box-shadow: 0 0 4px #666;
}

.deployment-card[data-status='paused'] {
  opacity: 0.8;
}

.deployment-card[data-status='deleted'] {
  opacity: 0.5;
}

.source-type-toggle {
  margin: 1rem 0 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  display: flex;
  gap: 2rem;
}

.source-type-toggle label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
}

.source-type-toggle input[type="radio"] {
  accent-color: var(--primary-color, #2196f3);
}

.error-message {
  color: #f44336;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

.input-group input[type="text"].error {
  border-color: #f44336;
}

/* Update the existing input styles */
.input-group input[type="text"]:focus {
  border-color: var(--primary-color, #2196f3);
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.subdomain-options {
  margin-top: 1rem;
}

.subdomain-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.subdomain-card {
  padding: 1rem;
  border: 2px solid #eee;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: monospace;
  font-size: 0.9rem;
}

.subdomain-card:hover {
  border-color: var(--primary-color, #2196f3);
  background: var(--primary-color-light, #e3f2fd);
}

.subdomain-card.selected {
  border-color: var(--primary-color, #2196f3);
  background: var(--primary-color-light, #e3f2fd);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.regenerate-btn {
  background: none;
  border: 2px dashed #ccc;
  padding: 0.75rem;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.regenerate-btn:hover {
  border-color: var(--primary-color, #2196f3);
  color: var(--primary-color, #2196f3);
}

.form-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 1px;
}

.tab-button {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--primary-color, #2196f3);
}

.tab-button.active {
  color: var(--primary-color, #2196f3);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color, #2196f3);
  border-radius: 3px 3px 0 0;
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-content {
  min-height: 400px;
  padding: 2rem 0;
}

.tab-pane {
  animation: fadeIn 0.2s ease-in-out;
}

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

.logs-viewer {
  background: #1e1e1e;
  border-radius: 8px;
  height: 500px;
  display: flex;
  flex-direction: column;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #2d2d2d;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #3d3d3d;
}

.logs-header h4 {
  color: #fff;
  margin: 0;
}

.logs-controls {
  display: flex;
  gap: 0.5rem;
}

.container-select {
  background: #3d3d3d;
  border: 1px solid #4d4d4d;
  color: #fff;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.refresh-btn,
.auto-scroll-btn {
  background: #3d3d3d;
  border: 1px solid #4d4d4d;
  color: #fff;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover,
.auto-scroll-btn:hover {
  background: #4d4d4d;
}

.auto-scroll-btn.active {
  background: var(--primary-color, #2196f3);
  border-color: var(--primary-color, #2196f3);
}

.logs-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.logs {
  margin: 0;
  color: #d4d4d4;
}

.log-line {
  display: flex;
  gap: 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #2d2d2d;
}

.log-line:last-child {
  border-bottom: none;
}

.log-timestamp {
  color: #888;
  white-space: nowrap;
}

.log-level {
  min-width: 60px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.log-line.info .log-level { color: #64b5f6; }
.log-line.warn .log-level { color: #ffb74d; }
.log-line.error .log-level { color: #e57373; }
.log-line.debug .log-level { color: #81c784; }

.log-message {
  flex: 1;
  word-break: break-all;
}

.logs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  gap: 1rem;
}

.logs-empty button {
  background: #3d3d3d;
  border: 1px solid #4d4d4d;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.logs-empty button:hover {
  background: #4d4d4d;
}

.deployment-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.deployment-title h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.deployment-created {
  font-size: 0.8rem;
  color: #888;
}

.deployment-card.has-error {
  border-color: #ffebee;
  background: #fff5f5;
}

.error-banner {
  margin: 1rem -1.5rem;
  padding: 1rem 1.5rem;
  background: #ffebee;
  color: #d32f2f;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid #ffcdd2;
  border-bottom: 1px solid #ffcdd2;
}

.error-icon {
  font-size: 1.2rem;
}

/* Update status styles */
.status-dot.error {
  background: #f44336;
  box-shadow: 0 0 4px #f44336;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 4px #f44336;
  }
  50% {
    box-shadow: 0 0 8px #f44336;
  }
  100% {
    box-shadow: 0 0 4px #f44336;
  }
}

/* Add validation error indicators */
.region-grid.error {
  border: 2px solid #ffebee;
  border-radius: 8px;
  padding: 1rem;
  background: #fff5f5;
}

.domain-config.error {
  border: 2px solid #ffebee;
  border-radius: 8px;
  padding: 1rem;
  background: #fff5f5;
}

.validation-error {
  color: #f44336;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.deployment-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.domain-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.domain-icon {
  font-size: 1rem;
}

.status-dot.deploying {
  background: #2196f3;
  box-shadow: 0 0 4px #2196f3;
  animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
  0% {
    box-shadow: 0 0 4px #2196f3;
  }
  50% {
    box-shadow: 0 0 8px #2196f3;
  }
  100% {
    box-shadow: 0 0 4px #2196f3;
  }
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status.deploying {
  color: #2196f3;
}

.status.deploying::after {
  content: '...';
  animation: ellipsis 1.5s infinite;
  width: 12px;
  display: inline-block;
}

@keyframes ellipsis {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

.credentials-form {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.credentials-form h4 {
  margin: 0 0 1rem 0;
  color: #333;
}

.auth-type-selector {
  margin-bottom: 1rem;
}

.auth-type-selector select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.password-input {
  display: flex;
  gap: 0.5rem;
}

.password-input input {
  flex: 1;
}

.toggle-password {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.5rem;
}

.test-credentials {
  margin-top: 1rem;
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.test-credentials:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.source-type-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.source-type {
  flex: 1;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #666;
}

.source-type:hover {
  border-color: #2196f3;
  background: #f5f9ff;
}

.source-type.active {
  border-color: #2196f3;
  background: #f5f9ff;
  color: #2196f3;
}

.source-type .icon {
  font-size: 1.2rem;
}

/* Add some spacing between the source type selector and the input fields */
.source-type-selector + .input-group {
  margin-top: 1.5rem;
}

.reconcile-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.reconcile-btn:hover {
  opacity: 1;
  transform: rotate(180deg);
}

.deployment-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.template-card {
  background: white;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.template-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.template-card.selected {
  border-color: var(--primary-color);
  background: var(--primary-color-light);
}

.template-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.template-card h3 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.template-card p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.resources-section {
  margin-bottom: 1.5rem;
}

.resource-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.source-type-selector button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f5f5f5;
}

.source-type-selector button:disabled.active {
  opacity: 1;
  cursor: default;
  background: var(--primary-color-light);
  border-color: var(--primary-color);
}

.regions-grid.horizontal {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.regions-grid.horizontal .region-card {
  flex: 1;
  min-width: 0;
  max-width: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid #eee;
  border-radius: 8px;
  transition: all 0.2s;
}

.regions-grid.horizontal .region-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.regions-grid.horizontal .region-card.selected {
  border-color: var(--primary-color);
  background: var(--primary-color-light);
}

.region-info {
  flex: 1;
}

.region-info h3 {
  margin: 0;
  font-size: 1rem;
}

.region-info p {
  margin: 0.25rem 0 0;
  color: #666;
  font-size: 0.9rem;
}

.region-selected-mark {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.ha-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #e3f2fd;
  border-radius: 8px;
  border: 1px solid #90caf9;
}

.ha-notice p {
  margin: 0;
  color: #1976d2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ha-icon {
  font-size: 1.2rem;
}

.validation-error {
  color: #d32f2f;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-errors {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.form-errors p {
  color: #c62828;
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #d32f2f;
}

.form-errors li {
  margin: 0.25rem 0;
}

.input-group.error input,
.input-group.error select {
  border-color: #ef5350;
}

.error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.deployments-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.view-controls {
  display: flex;
  gap: 0.5rem;
}

.view-mode-btn {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.view-mode-btn.active {
  background: var(--primary-color-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.list-controls {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-filter {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.search-filter input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-filter select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 150px;
}

.deployments-list {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.deployments-list table {
  width: 100%;
  border-collapse: collapse;
}

.deployments-list th {
  background: #f5f5f5;
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.deployments-list th:hover {
  background: #eee;
}

.deployments-list td {
  padding: 1rem;
  border-top: 1px solid #eee;
}

.deployments-list tr:hover {
  background: #f9f9f9;
}

.region-tag-small {
  margin-right: 0.25rem;
  font-size: 1rem;
}

.deployments-list .actions {
  display: flex;
  gap: 0.5rem;
}

.deployments-list .actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.deployments-list .actions button:hover {
  background: #f0f0f0;
}

.region-tag-small, .region-tag {
  position: relative;
  cursor: help;
}

/* Optional: Custom tooltip styling */
.region-tag-small:hover::after,
.region-tag:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

/* Optional: Add a small arrow to the tooltip */
.region-tag-small:hover::before,
.region-tag:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  margin-bottom: -12px;
  pointer-events: none;
}

.action-btn {
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  font-size: 1.2rem;
  transition: all 0.2s;
  border-radius: 4px;
}

.action-btn:hover {
  background: #f0f0f0;
}

.action-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

.action-btn[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  margin-bottom: -12px;
  pointer-events: none;
}

/* Adjust the danger button style while keeping the tooltip */
.action-btn.danger:hover {
  background: #ffebee;
  color: #d32f2f;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffd700;
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.admin-icon {
  font-size: 1.2rem;
}

.admin-region {
  border-color: #ffd700 !important;
  background: #fffbeb;
}

.admin-region:hover {
  border-color: #ffd700 !important;
  background: #fff8e1;
}

.admin-only-badge {
  display: inline-block;
  background: #ffd700;
  color: #000;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.region-card.admin-region.selected {
  background: #fff8e1;
  border-color: #ffd700;
}

/* Add these styles for template parameters */
.template-parameters {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.template-parameters h4 {
  margin-bottom: 15px;
  font-size: 1rem;
  color: #333;
}

.template-parameters .input-group {
  margin-bottom: 12px;
}

.template-parameters label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.template-parameters .required-asterisk {
  color: #e53935;
  margin-left: 3px;
}

.template-parameters input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.template-parameters input.error {
  border-color: #e53935;
}

.template-parameters input:disabled {
  background-color: #f0f0f0;
  color: #666;
  cursor: not-allowed;
}

.template-parameters .auto-generated-notice {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
  font-style: italic;
}

.template-parameters .error-message {
  color: #e53935;
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Additional styles for template cards */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.template-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.template-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.template-card.selected {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

.template-card .card-body {
  padding: 15px;
}

.template-card .template-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.template-card .card-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.template-card .card-text {
  font-size: 0.9rem;
  color: #666;
}

/* Add header actions styling */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-btn, 
.auto-refresh-btn {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.refresh-btn:hover, 
.auto-refresh-btn:hover {
  background: #e0e0e0;
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auto-refresh-btn.active {
  background: #e3f2fd;
  color: #1976d2;
  border-color: #90caf9;
}

/* Loading indicator */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #666;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Error banner */
.error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #d32f2f;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.error-icon {
  font-size: 1.2rem;
}

.retry-btn {
  margin-left: auto;
  background: #f44336;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.retry-btn:hover {
  background: #e53935;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px dashed #ddd;
  margin: 2rem 0;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #bdbdbd;
}

.empty-state h3 {
  margin: 0 0 0.5rem;
  color: #616161;
}

.empty-state p {
  margin: 0 0 1.5rem;
  color: #757575;
}

.deployment-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.deployment-form {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.form-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.form-tab {
  border: none;
  background: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-tab:hover {
  opacity: 1;
  background: #f9f9f9;
}

.form-tab.active {
  opacity: 1;
  color: var(--primary-color, #2196f3);
  font-weight: 500;
}

.form-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color, #2196f3);
}

.tab-icon {
  font-size: 1.2rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.cancel-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  background: none;
  border: 2px solid #eee;
  transition: all 0.2s;
}

.deploy-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  background: var(--primary-color, #2196f3);
  color: white;
  border: none;
  transition: all 0.2s;
}

.deploy-btn:hover, .cancel-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.deploy-btn:disabled {
  background: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.source-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.source-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #f5f5f5;
  border: 2px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  max-width: 150px;
}

.source-option:hover {
  background: #e3f2fd;
  border-color: #bbdefb;
}

.source-option.active {
  background: #e3f2fd;
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

.option-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.option-label {
  font-weight: 500;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
