@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;700;800&family=Syne:wght@600;800&display=swap');

:root {
  --primary: #167DFF;
  --primary-hover: #0A5CC4;
  --dark-blue: #062B6E;
  --light-blue: #7DBFFF;
  --bg-tint: #E0EEFF;
  --bg-main: #f3f7fd;
  --card-bg: #ffffff;
  
  --text-dark: #062B6E;
  --text-body: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #167DFF;
  
  --success: #10B981;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(6, 43, 110, 0.08), 0 4px 6px -2px rgba(6, 43, 110, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(6, 43, 110, 0.1), 0 10px 10px -5px rgba(6, 43, 110, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 24px;
}

/* Dashboard Layout */
.dashboard-header {
  max-width: 1300px;
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-logo {
  height: 85px;
  max-width: 240px;
  object-fit: contain;
}

.dashboard-title-container h1 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
  font-size: 26px;
  font-weight: 800;
}

.dashboard-title-container p {
  color: var(--text-muted);
  font-size: 14px;
}

.dashboard-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: block;
}

#issueSection {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

#recentSection {
  width: 100%;
}

/* Tab Navigation */
.tab-container-nav {
  display: flex;
  gap: 8px;
  max-width: 1300px;
  margin: 0 auto 24px auto;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 10px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary);
  background-color: var(--bg-tint);
}

.tab-btn.active {
  color: white;
  background-color: var(--primary);
  box-shadow: 0 4px 12px rgba(22, 125, 255, 0.25);
}

/* Common Card Styling */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(224, 238, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  border-bottom: 2px solid var(--bg-tint);
  padding-bottom: 12px;
}

/* Form Elements */
.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-body);
  background-color: #fafbfc;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(22, 125, 255, 0.15);
}

input::placeholder {
  color: #a0aec0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  gap: 8px;
}

.btn-primary {
  background-color: var(--dark-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(22, 125, 255, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-tint);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background-color: #cce3ff;
}

.btn-outline {
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-dark);
}

.btn-outline:hover {
  background-color: var(--bg-tint);
  border-color: var(--light-blue);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
  padding: 12px;
}

/* Recent Certificates List */
.table-container {
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background-color: var(--bg-tint);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

tr:hover td {
  background-color: #fafcfe;
}

.cert-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.credential-badge {
  font-family: monospace;
  background-color: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.action-btns {
  display: flex;
  gap: 8px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Modals & Alerts */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(6, 43, 110, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 550px;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  border: 1px solid var(--border-color);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-title {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body {
  margin-bottom: 24px;
}

.success-icon-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.success-icon {
  width: 56px;
  height: 56px;
  background-color: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.danger-icon-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.danger-icon {
  width: 56px;
  height: 56px;
  background-color: var(--danger-bg);
  color: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-danger {
  background-color: #ef4444;
  color: white;
  border: 1px solid #ef4444;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  border-color: #dc2626;
}

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

.modal-message {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.result-card {
  background-color: var(--bg-tint);
  border: 1px solid var(--light-blue);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.result-row:last-child {
  margin-bottom: 0;
}

.result-label {
  font-weight: 600;
  color: var(--text-dark);
}

.result-val {
  font-weight: 500;
  color: var(--text-body);
  max-width: 70%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.url-input {
  flex-grow: 1;
  background-color: #ffffff;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
}

.verify-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-main);
  box-sizing: border-box;
}

@media (min-width: 768px) and (min-height: 700px) {
  .verify-body {
    height: 100vh;
    overflow: hidden;
  }
}

.verify-card {
  max-width: 750px;
  margin: 0 auto;
  background: white;
  padding: 28px 36px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(220, 230, 245, 0.8);
}

.verify-header {
  text-align: center;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.verify-logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px auto;
}

.verify-title {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
  font-size: 28px;
  font-weight: 800;
  margin: 16px 0 8px 0;
}

.verify-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

.verify-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.details-box {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  background-color: #fafbfc;
  transition: all 0.2s ease;
}

.details-box:hover {
  border-color: var(--light-blue);
  box-shadow: var(--shadow-sm);
  background-color: #ffffff;
}

.details-box span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.details-box strong {
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 700;
}

.details-box .badge {
  margin-top: 4px;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark-blue);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    padding: 16px;
  }
  .form-group-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .verify-details {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .verify-card {
    padding: 24px;
    margin: 20px auto;
  }
  .dashboard-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}
