/* AWS Key & Root Access Converter Panel - Luxury Dark Gold Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  --bg-dark: #050814;
  --bg-card: rgba(11, 17, 35, 0.88);
  --bg-input: rgba(5, 9, 20, 0.95);
  --bg-inner-box: rgba(7, 12, 26, 0.85);

  --gold-primary: #f3c06b;
  --gold-metallic: #d4af37;
  --gold-bright: #ffe28a;
  --gold-gradient: linear-gradient(135deg, #ffe28a 0%, #d4af37 50%, #a3740e 100%);
  --gold-gradient-hover: linear-gradient(135deg, #fff0b3 0%, #e5c158 50%, #b8860b 100%);
  --gold-glow: rgba(212, 175, 55, 0.28);
  --gold-glow-strong: rgba(243, 192, 107, 0.55);

  --blue-primary: #3b82f6;
  --blue-gradient: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);

  --border-gold: rgba(212, 175, 55, 0.25);
  --border-gold-bright: rgba(243, 192, 107, 0.45);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.14) 0%, transparent 55%),
    radial-gradient(circle at 10% 40%, rgba(30, 58, 138, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(4, 7, 16, 1) 0%, rgba(3, 5, 12, 1) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.bg-grid {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* Main Container */
.app-container {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Master Glass Card */
.master-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 2rem 2.25rem;
  backdrop-filter: blur(24px);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(212, 175, 55, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.master-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-primary) 50%, transparent 100%);
  opacity: 0.8;
}

/* Header Section */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}

.shield-badge-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #131c38 0%, #090e1f 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  box-shadow: 0 0 16px var(--gold-glow);
  flex-shrink: 0;
}

.header-title-group {
  min-width: 0;
}

.header-title-group h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 3.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.header-title-group h1 span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title-group p {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  white-space: nowrap;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 30px;
  font-size: 0.725rem;
  font-weight: 700;
  box-shadow: 0 0 12px var(--gold-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

.app-version-pill {
  background: var(--gold-gradient);
  color: #040712;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.675rem;
  font-weight: 800;
  margin-left: 3px;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  background: rgba(10, 14, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--text-main);
  border-color: rgba(212, 175, 55, 0.3);
}

.tab-btn.active {
  background: var(--gold-gradient);
  color: #040712;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--gold-glow-strong);
  font-weight: 800;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

/* Section Card */
.section-card {
  background: linear-gradient(180deg, rgba(12, 19, 40, 0.95) 0%, rgba(7, 12, 26, 0.98) 100%);
  border: 1.5px solid var(--border-gold);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.card-title-row h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.tag-badge {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.725rem;
  font-weight: 700;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.section-desc code {
  color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Compact Multi-Column Grid System */
.key-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: stretch;
}

.key-textarea-wrap {
  display: flex;
  height: 100%;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.compact-grid .form-group.span-3 { grid-column: span 3; }
.compact-grid .form-group.span-2 { grid-column: span 2; }
.compact-grid .form-group.span-15 { grid-column: span 1; }
.compact-grid .form-group.span-1 { grid-column: span 1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
}

.input-select, .input-field, .input-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-gold);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.25s ease;
}

.input-textarea {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  height: 100%;
  min-height: 85px;
  resize: vertical;
}

.input-select:focus, .input-field:focus, .input-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

.input-with-action {
  display: flex;
  gap: 0.4rem;
}

.btn-input-action {
  background: var(--gold-gradient);
  border: none;
  color: #040712;
  padding: 0 0.85rem;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.775rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px var(--gold-glow);
}

.btn-input-action:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-1px);
}

/* Code Preview Container */
.code-preview-container {
  background: #03060f;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.95);
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
}

.code-header > span {
  flex: 1 1 auto;
  min-width: 140px;
  word-break: break-word;
}

.code-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-code-action {
  background: var(--gold-gradient);
  border: none;
  color: #040712;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-code-action:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-1px);
}

.code-block {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: #38bdf8;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.instruction-box {
  background: rgba(30, 58, 138, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.825rem;
  line-height: 1.6;
}

.instruction-box h4 {
  color: var(--gold-primary);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.instruction-box ol {
  padding-left: 1.25rem;
}

.instruction-box li {
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

/* Key Drop Zone */
.key-upload-zone {
  border: 1.5px dashed var(--border-gold-bright);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  text-align: center;
  background: rgba(5, 9, 20, 0.7);
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 85px;
}

.key-upload-zone:hover, .key-upload-zone.dragover {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 20px var(--gold-glow);
}

.key-upload-zone input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  margin-bottom: 0.6rem;
}

.upload-title {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.upload-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Key Inspection Result Card */
.key-result-card {
  background: rgba(6, 11, 24, 0.95);
  border: 1.5px solid var(--gold-primary);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: 0 0 25px var(--gold-glow);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-indicator.valid {
  color: #4ade80;
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.key-type-tag {
  background: var(--gold-gradient);
  color: #040712;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
}

.meta-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.825rem;
}

.meta-item.full-row {
  flex-direction: column;
  align-items: flex-start;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 700;
}

.meta-val {
  color: var(--gold-bright);
  font-family: var(--font-mono);
}

.code-copy-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.input-readonly {
  width: 100%;
  background: #03060f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.775rem;
}

.btn-sm-gold {
  background: var(--gold-gradient);
  border: none;
  color: #040712;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.775rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.download-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.btn-download-format {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  color: var(--gold-bright);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.btn-download-format:hover {
  background: var(--gold-gradient);
  color: #040712;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--gold-glow);
}

.margin-top-md {
  margin-top: 1.25rem;
}

.margin-bottom-lg {
  margin-bottom: 1.75rem;
}

.margin-top-sm {
  margin-top: 0.65rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #0e172e 0%, #060b19 100%);
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-bright);
  padding: 0.8rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7), 0 0 20px var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 1000;
  opacity: 0;
  white-space: nowrap;
  transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.app-version-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Start Action CTA Button */
.start-action-container {
  display: flex;
  justify-content: center;
}

.btn-start-process {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--gold-gradient);
  border: none;
  border-radius: 14px;
  color: #040712;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 6px 25px var(--gold-glow-strong);
  transition: all 0.3s ease;
}

.btn-start-process:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 35px var(--gold-glow-strong);
}

/* Luxury Process Result Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 6, 15, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content-luxury {
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  background: linear-gradient(180deg, #0e172e 0%, #060b19 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 35px var(--gold-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content-luxury {
  transform: scale(1) translateY(0);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-title-group h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.status-badge-success {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.725rem;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--gold-bright);
}

.modal-body-scroll {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}

.result-box {
  background: #03060f;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  overflow: hidden;
}

.result-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.95);
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
}

.modal-footer-row {
  padding: 0.9rem 1.4rem;
  background: rgba(10, 16, 32, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-done {
  background: var(--gold-gradient);
  border: none;
  color: #040712;
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.825rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-done:hover {
  background: var(--gold-gradient-hover);
}

@media (max-width: 640px) {
  body {
    padding: 0.75rem 0.5rem;
  }
  .master-card {
    padding: 1rem 0.85rem;
    border-radius: 18px;
  }
  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .header-title-group h1 {
    font-size: 1.15rem;
  }
  .header-title-group p {
    font-size: 0.725rem;
  }
  .sync-badge {
    padding: 0.25rem 0.55rem;
    font-size: 0.675rem;
  }
  .key-input-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .compact-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .compact-grid .form-group.span-3,
  .compact-grid .form-group.span-2,
  .compact-grid .form-group.span-15,
  .compact-grid .form-group.span-1 {
    grid-column: span 1;
  }
  .btn-start-process {
    padding: 0.8rem 1rem;
    font-size: 0.875rem;
  }
  .download-actions-grid {
    grid-template-columns: 1fr;
  }
  .modal-content-luxury {
    max-height: 92vh;
  }
}
