:root {
    --primary-color: #3b82f6; /* Um azul mais vibrante e moderno */
    --primary-dark: #2980b9;
    --secondary-color: #1f2937; /* Cinza escuro para textos */
    --background-light: #f9fafb; /* Fundo bem claro */
    --card-background: #ffffff;
    --text-color: #374151;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- Importação da fonte --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Transições Suaves --- */
.text, .button, a, #admin_menu li, #main_table tbody tr {
    transition: all 0.25s ease-in-out;
}

/* --- Estilos Globais e Reset --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-light);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* --- Wrapper Principal --- */
#wrap {
    width: 95%;
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0;
    box-shadow: none;
    background-color: transparent;
}

/* --- Cabeçalho e Navegação --- */
header[role="banner"] {
    text-align: center;
    padding: 1.5rem 0;
}

ul#admin_menu {
        border-radius: 16px 16px 0px 0px;
    background: #91c7f2;
    min-height: 20px!important;
}



/* Estilo para todos os botões de ação do plugin */
.plugin_actions a {
  display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s ease-in-out;
    white-space: nowrap;
}

/* Estilo específico para o botão "Deactivate" */
.plugin_actions a[href*="deactivate"] {
    background-color: #ef4444; /* Vermelho vibrante */
    color: #ffffff;
}

.plugin_actions a[href*="deactivate"]:hover {
   background-color: #dc2626; /* Darker red on hover */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}



body.desktop td.actions input, body.desktop td.actions a {
     visibility: visible!important; 
}


.sub_wrap{
    max-width:100%;
}


/* Esconder o logo */
#yourls-logo {
    display: none;
}

nav[role="navigation"] {
    margin-bottom: 2rem;
}

#admin_menu {
    list-style: none;
    padding: 0;
    margin-top: 0.0rem;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#admin_menu li {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
      list-style: none !important;
}
#admin_menu li:hover {
    background-color: var(--border-color);
}

#admin_menu li a, #admin_menu li strong {
    color: var(--text-color);
    padding: 0.75rem 1rem; /* Aplica o padding e as bordas ao link */
    transition: color 0.2s;
}
#admin_menu li a:hover {
    color: #000;
    text-decoration:none!important;
}

/*logout li*/
#admin_menu li#admin_menu_logout_link {
    background-color: transparent;
    display: inline-block; /* Garante que o item de lista se comporte como um bloco */
    padding: 0; /* Remove padding desnecessário */
    line-height: normal;
}

#admin_menu li#admin_menu_logout_link strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

#admin_menu li#admin_menu_logout_link a {
  color: #ef4444; /* Cor vermelha para o link de Logout */
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    background-color: transparent;
    margin-left: 0.2rem;
}

#admin_menu li#admin_menu_logout_link a:hover {
    color: #dc2626!important;
    text-decoration: underline!important;
}


header[role="banner"] {
    display: none;
}

/* --- Mensagens de Resumo --- */
p#overall_tracking {
    text-align: center;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

p:not([id="overall_tracking"]) {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* --- Seção de Adicionar URL --- */
#add-url{
    width:200px!important;
}
#new_url{
    border-radius:16px;
}
#new_url div {
    border-radius: 16px;
}

#new_url div {
    background: #F8F9FA;
}

Input.text, select, textarea {
    border:1px solid #e5e5e5!important;
}

.text {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: #ffffff;
    transition: background-color 0.25s ease-in-out, transform 0.1s;
}

.button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Oculta as quebras de linha (<br>) que causavam o desalinhamento */
#new_url br {
    display: none;
}


.text {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: #ffffff;
    transition: background-color 0.25s ease-in-out, transform 0.1s;
}

.button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* --- Responsividade do Formulário --- */
@media (max-width: 768px) {
    #new_url form div {
        flex-direction: column;
        align-items: stretch;
    }

    #new_url label {
        text-align: left;
        margin-right: 0;
    }

    #add-url, #add-keyword {
        width: 100%;
    }

    .button {
        width: 100%;
        margin-top: 1rem;
    }
}



.text {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    flex: 1 1 auto;
    min-width: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.text[size="80"] {
    flex-grow: 2;
}

.button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: #ffffff;
}
/* CORRIGIDO: A cor do texto no hover é alterada para branco para melhor legibilidade */
.button:hover {
    background-color: var(--primary-dark);
    color: #ffffff; /* Garante que o texto continue branco e legível */
    transform: translateY(-2px);
}
.button.primary {
    background-color: var(--primary-color);
}
.button.primary:hover {
    background-color: var(--primary-dark);
}

/* --- Seções de Compartilhamento --- */
#shareboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.share {
    flex: 1 1 45%;
    min-width: 280px;
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.share h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    color: var(--secondary-color);
}

#copylink {
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    border-style: dashed;
}

#share_links a {
    display: inline-block;
    margin: 0 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #ffffff;
    transition: opacity 0.2s;
}
#share_links a:hover { opacity: 0.8; }
#share_tw { background-color: #1da1f2; }
#share_fb { background-color: #3b5998; }

/* --- Tabela de Links --- */
main[role="main"] {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

/* Oculta o fundo original da tabela */
table.tblSorter {
    background-color: transparent !important;
}

#main_table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
    margin-top: 1.5rem;
    /*table-layout: fixed;*/
    background-color: #f1f9ff;
    border-radius: 0.75rem;
}

#main_table thead tr {
    background-color: transparent;
}

#main_table th {
    font-weight: 600;
    color: var(--text-light);
    text-align: left;
    padding: 1rem 1rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-left: 0.5rem;
}
#main_table th:first-child { padding-left: 1rem; }

#main_table tbody tr {
    background-color: var(--card-background);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}
#main_table tbody tr.alt-row {
    background-color: #f9fafb;
}
#main_table tbody tr:hover {
    background-color: #e3e8eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
#main_table tbody tr.alt-row:hover {
    background-color: #e3e8eb;
}

#main_table td {
    padding: 1rem;
    border: none;
    font-size: 0.9rem;
    vertical-align: top;
}
#main_table tbody tr td:first-child { border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem; padding-left: 1rem; }
#main_table tbody tr td:last-child { border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem; }

/* Colunas específicas */
.keyword a { font-weight: 600; }
.url a { font-size: 0.8rem; color: var(--text-light); word-break: break-all; }
.timestamp { font-size: 0.8rem; color: var(--text-light); }
.clicks { font-weight: 700; font-size: 1.2rem; }
.actions { white-space: nowrap; }

.actions a.button {
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    border-radius: 0.375rem;
    color: #ffffff;
    text-transform: none;
}
.button_stats { background-color: #60a5fa; }
.button_share { background-color: #4ade80; }
.button_edit { background-color: #fcd34d; }
.button_delete { background-color: #f87171; }

.button_stats:hover { background-color: #3b82f6; }
.button_share:hover { background-color: #22c55e; }
.button_edit:hover { background-color: #fbbf24; }
.button_delete:hover { background-color: #ef4444; }

/* --- Rodapé da Tabela (Filtros e Paginação) --- */
#filter_form {
    background-color: #f1f9ff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    max-width:100%!important;
}
#filter_form form div {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
#filter_form input, #filter_form select {
    color:#fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}
#filter_form input:focus, #filter_form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#submit-clear-filter{
    /*background-color:transparent!important;*/
    color:#000!important;
}
#filter_buttons {
    margin-top: 1rem;
}
#pagination {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
}

/* --- Rodapé Global --- */
footer#footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2.5rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
}

/* --- Responsividade --- */
@media (max-width: 768px) {
    #wrap {
        width: 100%;
        padding: 0.5rem;
    }
    #admin_menu {
        flex-direction: column;
    }
    #new_url form div {
        flex-direction: column;
        align-items: stretch;
    }
    .text, .button {
        width: 100%;
    }
    #shareboxes {
        flex-direction: column;
    }
    .share {
        min-width: unset;
        width: 100%;
    }
    #main_table thead {
        display: none;
    }
    #main_table tbody tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 1.25rem;
        box-shadow: var(--shadow);
    }
    #main_table td {
        display: block;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
    }
    .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .actions a.button {
        flex: 1 1 auto;
        text-align: center;
    }
}