﻿/* ---------- RESET ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------- BODY ---------- */
body {
    background: #f2f4f7;
    color: #333;
    line-height: 1.6;
}

/* ---------- NAVBAR ---------- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 50px;
    background: #2980ff;
    color: #fff;
}
.navbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s;
}
.navbar a:hover {
    color: #ffeb3b;
}
.navbar_logo img {
    height: 40px;
}

/* ---------- TITULO ---------- */
.centered_text {
    text-align: center;
    margin: 30px 0;
}
.centered_text h2 {
    font-size: 28px;
    color: #2980ff;
    letter-spacing: 1px;
}

/* ---------- BARRA DE CATEGORIAS ---------- */
.category-bar {
    text-align: center;
    margin: 30px 0;
}
.category-bar button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    margin: 0 8px;
    background: #2980ff;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.category-bar button:hover,
.category-bar button.active {
    background: #1b60c7;
    transform: translateY(-2px);
}

/* ---------- CONTAINER DE CARDS ---------- */
.quests-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 10px;
}

/* ---------- CARD DE QUEST ---------- */
.quest-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
}

.card-badge{
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ffb020;
    color: #1f1f1f;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    z-index: 2;
}

.card-delete{
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 26px;
    text-decoration: none;
    z-index: 3;
    box-shadow: 0 6px 14px rgba(229,57,53,0.35);
}

.card-dup{
    position: absolute;
    top: 8px;
    right: 42px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 26px;
    text-decoration: none;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: "Arial Black", Arial, sans-serif;
    line-height: 1;
}
.card-dup .dup-icon{
    position: relative;
    top: -1px;
}
.card-dup:hover{
    background: rgba(0,0,0,0.8);
}
.card-delete:hover{
    background: #c62828;
}
.quest-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.quest-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.quest-card img:hover {
    transform: scale(1.05);
}
.quest-card .content {
    padding: 15px;
}
.quest-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #2980ff;
    transition: color 0.3s;
}
.quest-card h3:hover {
    color: #1b60c7;
}
.quest-card p {
    color: #555;
    font-size: 14px;
}
.quest-card a {
    display: block;
    margin-top: 15px;
    padding: 10px;
    background: #2980ff;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.quest-card a:hover {
    background: #1b60c7;
    transform: translateY(-2px);
}

/* ---------- CARD ADICIONAR (ADMIN) ---------- */
.admin-add-card {
    border: 2px dashed #2980ff;
    background: #f7f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}
.admin-add-card a,
.admin-add-card button {
    background: transparent;
    color: #2980ff;
    font-size: 42px;
    line-height: 1;
    padding: 0;
    margin: 0;
    border: 0;
    cursor: pointer;
}
.admin-add-card a:hover,
.admin-add-card button:hover {
    background: transparent;
    transform: none;
}

/* ---------- MODAL DE CRIACAO ---------- */
.card-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.55);
    z-index: 9999;
    padding: 20px;
}
.card-modal.active {
    display: flex;
}
.card-modal-content {
    width: min(720px, 92%);
    background: #ffffff;
    color: #1f2937;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
    max-height: 85vh;
    overflow: auto;
    position: relative;
}
.card-modal-content h3 {
    margin-bottom: 10px;
    color: #111827;
}
.card-modal-content p {
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: 600;
}
.card-modal-content input,
.card-modal-content textarea,
.card-modal-content select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
}
.card-modal-content button[type="submit"] {
    margin-top: 8px;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.card-modal-close {
    position: absolute;
    right: 18px;
    top: 14px;
    background: transparent;
    border: 0;
    font-size: 24px;
    color: #374151;
    cursor: pointer;
}

.card_modal_light {
  background: #fff;
  color: #111827;
  text-align: left;
  max-width: 560px;
  width: min(560px, 92%);
  max-height: 85vh;
  overflow-y: auto;
  padding: 18px 20px;
}

/* ---------- ANIMAÇÃO ---------- */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---------- CORES POR CATEGORIA ---------- */
.iniciante { border-top: 4px solid #2ecc71; }
.intermediario { border-top: 4px solid #3498db; }
.avancado { border-top: 4px solid #e74c3c; }

/* HOVER EXTRA PARA CORES */
.iniciante:hover { box-shadow: 0 12px 30px rgba(46, 204, 113, 0.35) !important; }
.intermediario:hover { box-shadow: 0 12px 30px rgba(52, 152, 219, 0.35) !important; }
.avancado:hover { box-shadow: 0 12px 30px rgba(231, 76, 60, 0.35) !important; }

/* ---------- BOTÃO VOLTAR ---------- */
.back-btn {
    display: inline-block;
    padding: 10px 15px;
    background: #2980ff;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}
.back-btn:hover {
    background: #1b60c7;
    transform: translateX(-3px);
}

/* ---------- FOOTER ---------- */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 50px;
    background: #2980ff;
    color: #fff;
}

/* ---------- RESPONSIVIDADE ---------- */
@media (max-width: 1024px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 20px;
    }
    .navbar_contents a {
        margin-left: 0;
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    .quests-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    .category-bar button {
        margin: 5px 3px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .quests-container {
        grid-template-columns: 1fr;
    }
    .quest-card img {
        height: 150px;
    }
}

