/* ============================================
   SKILL VAULT - MAIN CSS
   Layout + Componentes + Markdown (unificado)
   ============================================ */

/* ============================================
   1. RESET GLOBAL
   ============================================ */

* {
   box-sizing: border-box;
}

/* ============================================
   2. VARIÁVEIS CSS
   ============================================ */

:root {
   --bg: #0f172a;
   --card: #111827;
   --text: #e5e7eb;
   --muted: #9ca3af;
   --accent: #38bdf8;
   --success: #22c55e;
   --danger: #ef4444;
   --gradient-start: #1e293b;
   --gradient-end: #334155;
}

/* ============================================
   3. BASE - BODY
   ============================================ */

body {
   margin: 0;
   font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
   background: linear-gradient(135deg, #020617, #020617);
   color: var(--text);
   min-height: 100vh;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 20px;
}

/* ============================================
   4. ESTRUTURA - LAYOUT CONTAINERS
   ============================================ */

.card {
   width: 100%;
   max-width: 1000px;
   background: var(--card);
   border-radius: 16px;
   padding: 32px;
   box-shadow: 0 20px 40px rgba(0, 0, 0, .6);
}

.content {
   display: none;
}

.conteudo-visualizacao {
   margin-top: 32px;
   animation: fadeIn 0.3s ease-in-out;
}

.indice {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: 20px;
   margin-top: 32px;
   padding-top: 32px;
   border-top: 2px solid #334155;
}

/* ============================================
   5. ANIMAÇÕES
   ============================================ */

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

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes pulse {

   0%,
   100% {
      opacity: 0.6;
   }

   50% {
      opacity: 1;
   }
}

/* ============================================
   6. TIPOGRAFIA - TÍTULOS
   ============================================ */

.card>h1,
#login>h1,
#curso>h1 {
   margin-top: 0;
   font-size: 2rem;
   margin-bottom: 8px;
   background: linear-gradient(135deg, var(--accent), #06b6d4);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.card>h2,
#login>h2,
#curso>h2 {
   margin-top: 0;
}

.card>h3,
#login>h3,
#curso>h3 {
   margin-top: 0;
}

.subtitle {
   color: var(--muted);
   margin-bottom: 24px;
   line-height: 1.6;
}

.titulo-conteudo {
   font-size: 2.2rem;
   margin-bottom: 24px;
   padding-bottom: 16px;
   border-bottom: 2px solid #334155;
   line-height: 1.3;
   word-break: break-word;
   background: linear-gradient(135deg, var(--accent), #06b6d4);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

/* ============================================
   7. FORMULÁRIOS - INPUTS
   ============================================ */

input {
   width: 100%;
   padding: 14px;
   border-radius: 10px;
   border: 2px solid #334155;
   outline: none;
   font-size: 1rem;
   margin-bottom: 12px;
   background: #1e293b;
   color: var(--text);
   transition: border-color 0.3s ease;
}

input:focus {
   border-color: var(--accent);
}

/* ============================================
   8. BOTÕES
   ============================================ */

button {
   width: 100%;
   padding: 14px;
   border-radius: 10px;
   border: none;
   background: linear-gradient(135deg, var(--accent), #06b6d4);
   color: #020617;
   font-size: 1rem;
   font-weight: bold;
   cursor: pointer;
   transition: all 0.3s ease;
}

button:hover {
   transform: translateY(-2px);
   box-shadow: 0 10px 25px rgba(56, 189, 248, 0.3);
}

button:active {
   transform: translateY(0);
}

button:disabled {
   opacity: 0.6;
   cursor: not-allowed;
   transform: none;
}

.btn-voltar {
   width: auto;
   padding: 12px 24px;
   margin-bottom: 24px;
   background: rgba(56, 189, 248, 0.1);
   border: 2px solid var(--accent);
   color: var(--accent);
   font-size: 0.95rem;
   font-weight: 600;
   display: inline-flex;
   align-items: center;
   gap: 8px;
}

.btn-voltar:hover {
   background: var(--accent);
   color: #020617;
   transform: translateX(-4px);
}

.btn-voltar-final {
   margin-top: 48px;
   margin-bottom: 0;
}

/* ============================================
   9. MENSAGENS E ESTADOS
   ============================================ */

.error {
   color: var(--danger);
   margin-top: 12px;
   display: none;
   padding: 12px;
   background: rgba(239, 68, 68, 0.1);
   border-radius: 8px;
   border-left: 4px solid var(--danger);
}

.success {
   color: var(--success);
}

.loading {
   text-align: center;
   padding: 60px 20px;
   color: var(--muted);
   font-size: 1.1rem;
   animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   10. FOOTER
   ============================================ */

.footer {
   margin-top: 40px;
   font-size: .85rem;
   color: var(--muted);
   text-align: center;
   padding-top: 20px;
   border-top: 1px solid #334155;
}

.footer p {
   margin: 8px 0;
}

.footer a {
   color: var(--accent);
   text-decoration: none;
   transition: color 0.2s;
}

.footer a:hover {
   color: #06b6d4;
}

/* ============================================
   11. CARDS DO ÍNDICE
   ============================================ */

.indice-card {
   background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
   border: 2px solid transparent;
   border-radius: 12px;
   padding: 24px;
   cursor: pointer;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   position: relative;
   overflow: hidden;
   display: flex;
   align-items: center;
   justify-content: center;
   min-height: 100px;
}

.indice-card::before {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
   transition: left 0.5s ease;
}

.indice-card:hover::before {
   left: 100%;
}

.indice-card:hover {
   border-color: var(--accent);
   transform: translateY(-4px);
   box-shadow: 0 12px 30px rgba(56, 189, 248, 0.2);
}

.indice-card:active {
   transform: translateY(-2px);
}

.indice-card h3 {
   margin: 0 0 6px 0;
   font-size: 1.15rem;
   color: var(--text);
   line-height: 1.4;
   position: relative;
   z-index: 1;
   word-break: break-word;
   text-align: center;
}

.card-desc {
   margin: 0;
   font-size: 0.85rem;
   color: var(--muted);
   text-align: center;
   position: relative;
   z-index: 1;
   line-height: 1.5;
}

/* ============================================
   12. MARKDOWN ARTICLE
   ============================================ */

.md-article {
   animation: fadeIn 0.3s ease-in-out;
}

.md-body {
   color: var(--text);
   line-height: 1.8;
}

.md-body a {
   color: var(--accent);
   text-decoration: underline;
}

.md-body a:hover {
   color: #06b6d4;
}

.md-body code {
   background: #1e293b;
   border: 1px solid #334155;
   border-radius: 4px;
   padding: 2px 6px;
   font-size: 0.9em;
   font-family: 'Fira Code', 'Cascadia Code', monospace;
   color: #7dd3fc;
}

.md-body pre {
   background: #1e293b;
   border: 1px solid #334155;
   border-radius: 10px;
   padding: 20px;
   overflow-x: auto;
}

.md-body pre code {
   background: none;
   border: none;
   padding: 0;
   font-size: 0.88em;
   color: #e2e8f0;
}

.md-body blockquote {
   border-left: 4px solid var(--accent);
   margin-left: 0;
   padding-left: 16px;
   color: var(--muted);
}

.md-body hr {
   border: none;
   border-top: 1px solid #334155;
   margin: 32px 0;
}

.md-body table {
   width: 100%;
   border-collapse: collapse;
}

.md-body th,
.md-body td {
   border: 1px solid #334155;
   padding: 10px 14px;
   text-align: left;
}

.md-body th {
   background: #1e293b;
   color: var(--accent);
}

/* ============================================
   13. VAULT SECTIONS
   ============================================ */

.vault-section {
   margin-bottom: 40px;
   padding-bottom: 40px;
   border-bottom: 2px solid #334155;
   animation: fadeIn 0.3s ease-in-out;
}

.vault-section:last-child {
   border-bottom: none;
   margin-bottom: 0;
}

.section-title {
   font-size: 1.3rem;
   font-weight: 700;
   color: var(--accent);
   margin: 0 0 20px 0;
   padding: 0;
   letter-spacing: 0.02em;
}

.empty-state {
   color: var(--muted);
   font-size: 0.95rem;
   text-align: center;
   padding: 24px 0;
   margin: 0;
}