/* SSL Manager Styles */

.ssl-manager {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.ssl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #dbcdbf;
}

.ssl-header-left h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  color: #2d2218;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: #f4efe8;
  padding: 4px;
  border-radius: 8px;
}

.view-toggle-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #7f6a56;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.view-toggle-btn.active {
  background: #fffdf8;
  color: #0e8c6a;
  box-shadow: 0 1px 2px rgba(45, 34, 24, 0.1);
}

.ssl-header-right {
  display: flex;
  gap: 12px;
}

button {
  font-family: inherit;
}

.btn-primary {
  padding: 10px 20px;
  background: #0e8c6a;
  color: #fffdf8;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  background: #066a52;
}

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

.btn-secondary {
  padding: 10px 20px;
  background: #f8f4ed;
  color: #2d2218;
  border: 1px solid #dbcdbf;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f4efe8;
  border-color: #d7c6b4;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f4ed;
  border: 1px solid #dbcdbf;
  border-radius: 8px;
  color: #7f6a56;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #f4efe8;
  color: #0e8c6a;
}

/* Stats */
.ssl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fffdf8;
  border: 1px solid #e5ddd5;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #0e8c6a;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: #7f6a56;
}

/* Domain Cards */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.domain-card {
  background: #fffdf8;
  border: 1px solid #e5ddd5;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(45, 34, 24, 0.05);
}

.domain-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 34, 24, 0.1);
  border-color: #d7c6b4;
}

.domain-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.domain-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4efe8;
  border-radius: 8px;
  color: #0e8c6a;
  font-size: 18px;
}

.domain-info {
  flex: 1;
}

.domain-name {
  font-size: 16px;
  font-weight: 600;
  color: #2d2218;
  margin-bottom: 4px;
}

.cert-type-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: #e8f5ed;
  color: #066a52;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.domain-card-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-text {
  font-size: 13px;
  font-weight: 600;
}

/* Certificate Cards */
.certificate-card {
  background: #fffdf8;
  border: 1px solid #e5ddd5;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(45, 34, 24, 0.05);
}

.certificate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 34, 24, 0.1);
  border-color: #d7c6b4;
}

.cert-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.cert-header-left {
  flex: 1;
}

.cert-type {
  font-size: 12px;
  font-weight: 600;
  color: #0e8c6a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.cert-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  background: #f8f4ed;
}

.btn-renew-small {
  padding: 6px 12px;
  background: #066a52;
  color: #fffdf8;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-renew-small:hover {
  background: #0e8c6a;
}

.cert-name {
  font-size: 18px;
  font-weight: 600;
  color: #2d2218;
  margin-bottom: 12px;
}

.cert-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.domain-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: #f4efe8;
  color: #2d2218;
  border-radius: 4px;
  border: 1px solid #e5ddd5;
}

.domain-tag-large {
  font-size: 13px;
  padding: 6px 12px;
  background: #f4efe8;
  color: #2d2218;
  border-radius: 6px;
  border: 1px solid #e5ddd5;
}

.cert-expiry {
  font-size: 13px;
  color: #7f6a56;
  margin-bottom: 16px;
}

.btn-view-details {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #0e8c6a;
  border: 1px solid #0e8c6a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-details:hover {
  background: #0e8c6a;
  color: #fffdf8;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(45, 34, 24, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #fffdf8;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(45, 34, 24, 0.2);
  animation: slideUp 0.3s ease;
}

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

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5ddd5;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #2d2218;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #7f6a56;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

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

.modal-body {
  padding: 24px;
}

.cert-detail-row {
  display: flex;
  margin-bottom: 16px;
}

.cert-detail-row label {
  font-weight: 600;
  color: #7f6a56;
  min-width: 120px;
  font-size: 14px;
}

.cert-detail-row span {
  color: #2d2218;
  font-size: 14px;
  word-break: break-all;
}

.cert-detail-section {
  margin: 20px 0;
  padding: 16px;
  background: #f8f4ed;
  border-radius: 8px;
}

.cert-detail-section label {
  display: block;
  font-weight: 600;
  color: #2d2218;
  margin-bottom: 12px;
  font-size: 14px;
}

.cert-domains-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cert-serial {
  font-family: monospace;
  font-size: 11px;
  color: #7f6a56;
}

.cert-path {
  font-family: monospace;
  font-size: 12px;
  color: #7f6a56;
  word-break: break-all;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #2d2218;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #dbcdbf;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fffdf8;
  color: #2d2218;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0e8c6a;
  box-shadow: 0 0 0 3px rgba(14, 140, 106, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: monospace;
}

.info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #e8f5ed;
  border: 1px solid #b9dfcc;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #066a52;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Notification */
.notification {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #2d2218;
  color: #fffdf8;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(45, 34, 24, 0.2);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Nginx Section */
.nginx-section {
  background: #fffdf8;
  border: 1px solid #e5ddd5;
  border-radius: 12px;
  padding: 24px;
}

.nginx-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #2d2218;
}

.nginx-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.nginx-configs-list {
  border-top: 1px solid #e5ddd5;
  padding-top: 16px;
}

.nginx-config-item {
  padding: 12px;
  background: #f8f4ed;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.loading {
  text-align: center;
  padding: 60px;
  color: #7f6a56;
  font-size: 16px;
}
