/* ==========================================================================
   CCNA & CCNP Malayalam Interactive Learning Platform - Components Stylesheet
   Terminal Emulator, Subnetting Calculator, Mock Exam, Glossary & Certificate
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CISCO IOS CLI TERMINAL SIMULATOR
   -------------------------------------------------------------------------- */
.terminal-tab-wrapper {
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.terminal-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.lab-selector-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lab-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
}

.btn-verify-lab {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-verify-lab:hover {
  box-shadow: 0 0 12px rgba(0, 188, 235, 0.4);
}

.cisco-terminal-window {
  background: #060a12;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  height: 580px;
}

.terminal-titlebar {
  background: #0c1424;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
  color: var(--cisco-cyan);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.terminal-tools {
  display: flex;
  gap: 8px;
}

.term-tool-btn {
  background: #1e293b;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.term-tool-btn:hover {
  color: #ffffff;
  background: #334155;
}

.terminal-screen {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #38bdf8;
  line-height: 1.5;
  cursor: text;
}

.term-welcome-msg pre {
  color: #64748b;
  font-family: inherit;
  font-size: 0.8rem;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 3px;
  color: #e2e8f0;
}

.term-system-line {
  color: #34d399;
  font-weight: 700;
}

.term-echo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.echo-prompt {
  color: #10b981;
  font-weight: 700;
}

.echo-cmd {
  color: #f1f5f9;
}

.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.term-prompt {
  color: #10b981;
  font-weight: 700;
  white-space: nowrap;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  caret-color: #00bceb;
}

/* --------------------------------------------------------------------------
   2. SUBNETTING CALCULATOR & PRACTICE ENGINE
   -------------------------------------------------------------------------- */
.subnet-wrapper {
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.subnet-input-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.subnet-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--cisco-blue);
  box-shadow: 0 0 10px var(--border-glow);
}

.btn-calc {
  background: linear-gradient(135deg, #00bceb 0%, #0284c7 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  height: 44px;
}

.btn-calc:hover {
  box-shadow: 0 0 16px rgba(0, 188, 235, 0.4);
}

.subnet-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cisco-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

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

/* Subnet Practice Quiz Card */
.practice-quiz-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.practice-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.practice-question-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.practice-question-ml {
  font-size: 0.95rem;
  color: var(--cisco-cyan);
  margin-bottom: 18px;
}

.practice-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.practice-feedback {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  display: none;
}

.practice-feedback.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
}

.practice-feedback.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
}

/* --------------------------------------------------------------------------
   3. CCNA / CCNP MOCK EXAM SIMULATOR
   -------------------------------------------------------------------------- */
.exam-wrapper {
  padding: 28px 36px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.exam-status-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.exam-timer {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.exam-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.exam-category-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 188, 235, 0.15);
  color: var(--cisco-cyan);
}

.exam-question-en {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
}

.exam-question-ml {
  font-size: 1rem;
  color: #93c5fd;
  margin-bottom: 24px;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.option-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  color: var(--text-main);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--cisco-blue);
}

.option-btn.selected {
  border-color: var(--cisco-blue);
  background: rgba(0, 188, 235, 0.15);
  box-shadow: 0 0 10px rgba(0, 188, 235, 0.2);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.exam-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-nav-exam {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-nav-exam:hover {
  background: var(--bg-card-hover);
}

.btn-finish-exam {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-finish-exam:hover {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

/* Exam Results Screen */
.exam-results-card {
  text-align: center;
  padding: 40px;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, #0284c7 0%, #002c52 100%);
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--cisco-blue);
  box-shadow: 0 0 24px rgba(0, 188, 235, 0.5);
}

.score-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
}

.score-label {
  font-size: 0.75rem;
  color: #93c5fd;
}

/* --------------------------------------------------------------------------
   4. GLOSSARY (DICTIONARY)
   -------------------------------------------------------------------------- */
.glossary-wrapper {
  padding: 28px 36px;
}

.glossary-search-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}

.glossary-card:hover {
  border-color: var(--cisco-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.glossary-term {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cisco-cyan);
  margin-bottom: 4px;
}

.glossary-cat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.glossary-ml-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 10px;
}

.glossary-en-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
}

/* --------------------------------------------------------------------------
   5. CERTIFICATE OF COMPLETION
   -------------------------------------------------------------------------- */
.certificate-tab-wrapper {
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.cert-input-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cert-frame {
  width: 100%;
  max-width: 860px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  position: relative;
  border: 10px solid #002c52;
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
}

.cert-inner-border {
  border: 2px solid #00bceb;
  padding: 30px;
  text-align: center;
}

.cert-cisco-logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #002c52;
}

.cert-heading {
  font-size: 1.8rem;
  font-weight: 800;
  color: #002c52;
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cert-subheading {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 24px;
}

.cert-recipient-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0284c7;
  font-family: Georgia, serif;
  border-bottom: 2px solid #cbd5e1;
  display: inline-block;
  padding: 0 40px 6px;
  margin-bottom: 18px;
}

.cert-desc {
  font-size: 1rem;
  color: #334155;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.cert-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.cert-seal {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.75rem;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.cert-signature {
  text-align: center;
}

.cert-sig-line {
  width: 160px;
  border-bottom: 1px solid #0f172a;
  margin-bottom: 4px;
}

.cert-sig-title {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
}

/* Print Certificate Media */
@media print {
  body * {
    visibility: hidden;
  }
  .cert-frame, .cert-frame * {
    visibility: visible;
  }
  .cert-frame {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    box-shadow: none;
    border: none;
  }
}
