* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #87CEEB, #32CD32);
    color: #2F4F4F;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    position: relative;
    display: none;
}

h1 {
    text-align: center;
    background: linear-gradient(276deg, #0072bb, #32CD32);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: clamp(1.5em, 4vw, 2.5em); /* Mínimo 1.5em, ideal 4vw, máximo 2.5em */
    flex:1
}

.search-box {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #4682B4;
    border-radius: 5px;
    background: #E6E6FA;
    color: #2F4F4F;
    font-size: 1em;
    margin-top: 10px;
}

.search-box::placeholder {
    color: #708090;
}

.phrase-item {
    background: #F0F8FF;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #4682B4;
    position: relative;
    min-height: 120px;
    transition: background 0.3s ease;
}

.phrase-item:hover {
    background: #E0FFFF;
}

.phrase-item.private {
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    border-left: 4px solid #ccc;
    opacity: 0.88;
    position: relative;
    transition: all 0.2s ease;
}

.phrase-item.private:hover {
    opacity: 1;
    background-color: #f1f3f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.phrase-item .content {
    display: flex;
    flex-direction: column;
    /*gap: 10px;*/
    /*width: 85%;*/
}

.phrase-item h3 {
    margin: 0;
    color: #4682B4;
    font-size: 1.2em;
}

.phrase-item.private h3 {
    color: #555;
    font-weight: 500;
}

.phrase-item p {
    margin: 10px 0;
    padding: 5px 8px;
    color: #2F4F4F;
    border: 1px solid #4682B430;
    border-radius: 7px;
    text-align: justify;
}

.phrase-item.private h3 {
    color: #2b2b2b;
}

.phrase-item .tags {
    font-size: 0.9em;
    color: #6A5ACD;
}

.phrase-item.private .tags, .phrase-item.private .author {
    color: #777;
}

.phrase-item .copy-btn {
    background: #FFD700;
    color: #1C2526;
    border: none;
    padding: 8px 15px;
    border-radius: 0 5px 0 5px;
    cursor: pointer;
    font-weight: bold;
    position: absolute;
    top: 0;
    right: 0;
    transition: background 0.3s ease;
}

.phrase-item .copy-btn:hover {
    background: #FFA500;
}

.phrase-item .like-btn, .phrase-item .private-btn {
    background: none;
    border: none;
    color: #4682B4;
    font-size: 1em;
    cursor: pointer;
    position: absolute;
    bottom: 5px;
    right: 5px;
    transition: color 0.3s ease;
}

.phrase-item .private-btn {
    cursor: default !important;
}

.phrase-item .like-btn:hover {
    color: #FFA500;
}

.phrase-item .delete-btn {
    background: none;
    border: none;
    color: #FF6347;
    font-size: 0.8em;
    cursor: pointer;
    position: absolute;
    bottom: 3px;
    left: 3px;
    transition: color 0.3s ease;
}

.phrase-item .delete-btn:hover {
    color: #FF4500;
}

.add-btn, .load-more-btn {
    background: #FFD700;
    color: #1C2526;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.add-btn:hover, .load-more-btn:hover {
    background: #FFA500;
}

.add-phrase-modal,
.delete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.add-phrase-form,
.delete-modal-content {
    background: #E6E6FA;
    padding: 20px;
    border-radius: 5px;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.add-phrase-form h2,
.delete-modal-content h3 {
    background: linear-gradient(178deg, #0072bb, #32CD32);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.add-phrase-form input,
.add-phrase-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #4682B4;
    border-radius: 5px;
    background: #F0F8FF;
    color: #2F4F4F;
    font-size: 1em;
}

.add-phrase-form textarea {
    height: 160px;
}

.add-phrase-form button:not(.toastui-editor-toolbar-icons),
.delete-modal-content button:not(.toastui-editor-toolbar-icons) {
    background: #FFD700;
    color: #1C2526;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
    margin: 5px;
}

.add-phrase-form button:not(.toastui-editor-toolbar-icons):hover,
.delete-modal-content button:not(.toastui-editor-toolbar-icons):hover {
    background: #FFA500;
}

button.close-btn {
    background: #FF6347 !important;
    color: #FFFFFF !important;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.3s ease;
}

button.close-btn:hover {
    background: #FF4500 !important;
}

.user-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    margin-top: 10px;
}

.user-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #4682B4;
    color: #2F4F4F;
}

.user-item:hover {
    background: #F0F8FF;
}

.user-item:first-child {
    border-top: 1px solid #4682B4;
}

.author {
    font-size: 0.8em;
    color: #778899;
    /*margin-top: 5px;*/
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #cf920f;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: #4682B4;
}

.toast.error {
    background: #FF6347;
}
.tag-link {
    color: #6A5ACD; /* Cor original das tags */
    text-decoration: none; /* Remove sublinhado padrão */
}

.tag-link:hover,
.tag-link:visited,
.tag-link:active,
.tag-link:focus {
    color: #6A5ACD; /* Mantém a cor em todos os estados */
    text-decoration: none; /* Sem sublinhado em nenhum estado */
}

.author-link {
    color: #778899; /* Cor original do autor */
    text-decoration: none; /* Remove sublinhado padrão */
}

.author-link:hover,
.author-link:visited,
.author-link:active,
.author-link:focus {
    color: #778899; /* Mantém a cor em todos os estados */
    text-decoration: none; /* Sem sublinhado em nenhum estado */
}

.phrase-item .edit-btn {
    background: none;
    border: none;
    color: #4682B4; /* Cor azul para combinar com o tema */
    font-size: 0.9em;
    cursor: pointer;
    position: absolute;
    top: 3px;
    left: 3px; /* Ajustado para ficar ao lado do delete-btn */
    transition: color 0.3s ease;
}

.phrase-item .edit-btn:hover {
    color: #FFA500; /* Hover laranja para consistência */
}

/* Botão Tags */
.tags-btn {
    background: #FFD700;
    color: #1C2526;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.tags-btn:hover {
    background: #FFA500;
}

/* Container das tags */
.tags-container {
    display: none; /* Inicialmente oculto */
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    width: 100%;
}

/* Grid de tags */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 10px;
}

@media (max-width: 800px) {
    .tags-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .tags-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilo dos grupos de tags */
.tag-group {
    margin-bottom: 20px;
}

.tag-group h2 {
    background: linear-gradient(276deg, #0072bb, #32CD32);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.tag-item {
    background: #F0F8FF;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #4682B4;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tag-item:hover {
    background: #E0FFFF;
}

.tag-link-grid {
    color: #6A5ACD;
    text-decoration: none;
    display: block;
}
.flex-top {
    display: flex;
    align-items: center;
    justify-content: space-between
}
.category-tabs {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    background: #E6E6FA;
    color: #2F4F4F;
    border: 1px solid #4682B4;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.category-tab.active {
    background: #4682B4;
    color: white;
    border-color: #0072bb;
}

.category-tab:hover:not(.active) {
    background: #D8BFD8;
}


/* ====== OVERLAY DO MODAL ====== */
.magic-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.30);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ====== CONTEÚDO DO MODAL ====== */
.magic-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  width: 25rem;
  padding: 2rem;
  position: relative;
  animation: fadeInUp 0.3s ease;
  text-align: center;
  top: 3rem;
  margin: 0 auto;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== CONTEÚDO INTERNO ====== */
.magic-header {
  margin-bottom: 1rem;
}
.magic-header h3 {
  font-weight: 600;
  color: #1e1e1e;
  margin: 0;
  font-size: 1.25rem;
  line-height: 2rem;
}
.magic-header p {
  color: #666;
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}

/* ====== INPUT ====== */
.magic-input {
  width: inherit;
  width: -webkit-fill-available;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-top: 1rem;
  transition: border-color 0.2s ease;
}
.magic-input:focus {
  border-color: #402fc3;
  outline: none;
}

/* ====== BOTÃO CONTINUAR ====== */
.magic-submit {
  width: 100%;
  margin-top: 1.25rem;
  background: #6851ff;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.magic-submit:hover {
  opacity: 0.9;
}

/* ====== RODAPÉ "Secured by Magic" ====== */
.magic-footer {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}



.load-more-btn:disabled {
    cursor: not-allowed;
}

.load-more-btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-container {
    display: flex;
    justify-content: center;   /* Centraliza horizontalmente */
    margin: 25px 0;            /* Espaço acima e abaixo */
    padding: 10px 0;
}


/* Efeito de exclusão */
.phrase-item.deleting {
    background-color: #ffebee !important;
    border-left: 4px solid #f44336;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.phrase-item.fade-out {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Animação de entrada para nova frase */
.phrase-item.new {
    opacity: 0;
    transform: translateY(-20px);
    animation: slideInFade 0.5s ease forwards;
}

@keyframes slideInFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Opcional: destaque temporário */
.phrase-item.new-highlight {
    background-color: #e8f5e9 !important;
    border-left: 4px solid #4caf50;
    transition: background-color 1s ease;
}

/* Efeito ao editar frase */
.phrase-item.editing {
    background-color: #fffde7 !important;
    border-left: 4px solid #ffeb3b;
    transition: all 0.3s ease;
}

.selects {
    width: 100%; 
    padding: 10px; 
    margin-bottom: 10px; 
    border: 1px solid #4682B4; 
    border-radius: 5px; 
    background: #F0F8FF; 
    color: #2F4F4F; 
    font-size: 1em;
}

.public-toggle-container .knob,
.public-toggle-container .btn-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.public-toggle-container {
  position: relative;
  top: 50%;
  width: 120px;
  height: 36px;
  margin: 10px auto;
  overflow: hidden;
  border-radius: 2px;
}

.public-toggle-container .checkbox {
  position: relative;
  width: 100% !important;
  height: 100% !important;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.public-toggle-container .knob {
  z-index: 2;
}

.public-toggle-container .btn-bg {
  width: 100%;
  background-color: #ebf7fc;
  transition: 0.3s ease all;
  z-index: 1;
}

.public-toggle-container .knob:before,
.public-toggle-container .knob:after,
.public-toggle-container .knob span {
  position: absolute;
  top: 4px;
  width: 50px;
  height: 10px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1;
  padding: 9px 4px;
  border-radius: 2px;
  transition: 0.3s ease all;
}

.public-toggle-container .knob:before {
  content: "";
  left: 4px;
  background-color: #03a9f4;
}

.public-toggle-container .knob:after {
  content: "Privado";
  right: 4px;
  color: #4e4e4e;
}

.public-toggle-container .knob span {
  display: inline-block;
  left: 4px;
  color: #fff;
  z-index: 1;
}

.public-toggle-container .checkbox:checked + .knob span {
  color: #4e4e4e;
}

.public-toggle-container .checkbox:checked + .knob:before {
  left: 57px;
  background-color: #f44336;
}

.public-toggle-container .checkbox:checked + .knob:after {
  color: #fff;
}

.public-toggle-container .checkbox:checked ~ .btn-bg {
  background-color: #fcebeb;
}

.message-alert {
    padding: 10px;
    text-align: center;
    color: red;
}

@media (max-width: 960px) {
    .magic-modal, .add-phrase-form {
        max-width: 90%;
    }
}

/* ---------- TABELA DENTRO DE .phrase-item ---------- */
.phrase-item table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.95em;
    background: #F8FDFF;
    border: 1px solid #B0C4DE;
    border-radius: 6px;
    overflow: hidden;
}

.phrase-item table th {
    background: linear-gradient(180deg, #4682B4, #5A9BD4);
    color: #fff;
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.phrase-item table td {
    padding: 8px 12px;
    border-bottom: 1px solid #E1E8ED;
    color: #2F4F4F;
}

/* hover nas linhas */
.phrase-item table tr:hover td {
    background: #E0F7FA;
    transition: background .2s ease;
}

/* remove borda da última linha */
.phrase-item table tr:last-child td { border-bottom: none; }

/* Highlight do Algolia */
em.search-highlight, tr.search-highlight {
    background-color: #fff3cd; /* amarelo suave */
    color: #856404;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    font-weight: bold;
}

tr.search-highlight td {
    color: #856404 !important;
}

/* Animação sutil para chamar atenção */
em.search-highlight, tr.search-highlight {
    animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
    0%, 100% { background-color: #fff3cd; }
    50% { background-color: #ffeaa7; }
}

/* Nas tags, se quiser */
.tag-link em.search-highlight {
    background-color: #d4edda; /* verde suave para tags */
}

/* ---------- RESPONSIVO (sem rótulos) ---------- */
@media (max-width: 600px) {
    .phrase-item table,
    .phrase-item table thead,
    .phrase-item table tbody,
    .phrase-item table th,
    .phrase-item table td,
    .phrase-item table tr { display: block; }

    .phrase-item table thead tr { 
        position: absolute; top: -9999px; left: -9999px; 
    }

    .phrase-item table tr {
        margin-bottom: 12px;
        border: 1px solid #B0C4DE;
        border-radius: 6px;
        background: #F8FDFF;
        padding: 8px;
    }

    .phrase-item table td {
        border: none;
        padding: 6px 0;
        text-align: left;
        font-size: 0.9em;
    }

    .phrase-item table td:first-child {
        font-weight: 600;
        color: #4682B4;
    }
}
