/* Botão Front-end */
.sredir-button {
    color: #fff;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: inline-block;
}

.sredir-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sredir-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Admin Dashboard */
.sredir-admin {
    max-width: 1200px;
}

/* Dashboard Cards */
.sredir-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.sredir-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    width: calc(33.333% - 20px);
    box-sizing: border-box;
}

.sredir-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.sredir-card-header {
    padding: 16px 24px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.sredir-card-header h2 {
    margin: 0;
    color: #23282d;
    font-size: 18px;
}

.sredir-card-content {
    padding: 24px;
}

.sredir-info-box {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sredir-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sredir-info-item .dashicons {
    color: #666;
    font-size: 20px;
    padding-top: 2px;
}

.sredir-info-item label {
    display: block;
    margin-bottom: 4px;
    color: #666;
    font-size: 12px;
}

.sredir-info-item code {
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 3px;
}

.sredir-action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.sredir-card h3 {
    color: #23282d;
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.sredir-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.sredir-card table {
    width: 100%;
    border-collapse: collapse;
}

.sredir-card table th,
.sredir-card table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.sredir-card table td a {
    word-break: break-all;
}

.sredir-card table th {
    font-weight: 600;
    background-color: #f9f9f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Form Elements */
.sredir-form-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.sredir-form-card h2 {
    margin-top: 0;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 18px;
}

.sredir-color-picker {
    width: 80px;
    height: 40px;
    padding: 0;
    border: 1px solid #ddd;
}

.button-link {
    background: none;
    border: none;
    color: #0073aa;
    text-decoration: none;
    padding: 0 4px;
    cursor: pointer;
}

.button-link:hover {
    color: #006799;
}

/* Empty State */
.sredir-empty-state {
    text-align: center;
    padding: 60px 0;
    margin-top: 20px;
}

.sredir-empty-state p {
    margin-top: 10px;
    font-size: 16px;
    color: #666;
}

/* Links Únicos */
.sredir-unique-link {
    display: inline-block;
    font-weight: 500;
    color: #0073aa;
    word-break: break-all;
}

.sredir-unique-link:hover {
    color: #0096dd;
}

/* Estilos para dropdown de ações */
.sredir-dropdown-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.sredir-dropdown-actions .sredir-select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: #fafbfc;
    font-size: 15px;
}

/* DeepSites Styles */
.sredir-deepsite-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

.sredir-deepsite-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sredir-info-notice {
    background-color: #f0f8ff;
    border-left: 4px solid #0073aa;
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 2px;
}

.sredir-info-notice p {
    margin: 0.5em 0;
}

.sredir-info-notice strong {
    color: #23282d;
}

/* Diagnostic Page Styles */
.sredir-debug-box pre {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 12px; /* Smaller font for readability */
    line-height: 1.5;
}

/* Tabs de navegação */
.sredir-tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    display: flex;
    gap: 4px;
}

.sredir-tab {
    padding: 8px 16px;
    background: #f8f8f8;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    color: #444;
    font-weight: 500;
}

.sredir-tab:hover {
    background: #f0f0f0;
}

.sredir-tab.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    color: #0073aa;
}

/* Responsividade */
@media screen and (max-width: 1200px) {
    .sredir-card {
        width: calc(50% - 20px);
    }
}

@media screen and (max-width: 782px) {
    .sredir-card {
        width: 100%;
    }
    
    .sredir-action-buttons {
        flex-direction: column;
    }
    
    .sredir-button {
        width: 100%;
        max-width: 100%;
    }
    
    .sredir-tabs {
        flex-direction: column;
        gap: 1px;
        border-bottom: none;
    }
    
    .sredir-tab {
        border-radius: 0;
        border: 1px solid #ccc;
    }
    
    .sredir-tab.active {
        border-bottom: 1px solid #0073aa;
    }
}

/* --- WordPress Admin Table Styles --- */
.sredir-admin .widefat {
    border-spacing: 0;
    width: 100%;
    clear: both;
    margin: 0;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.sredir-admin .widefat thead th {
    background-color: #f9f9f9;
    padding: 10px 12px;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.sredir-admin .widefat tbody th,
.sredir-admin .widefat tbody td {
    padding: 10px 12px;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0; /* Lighter border for rows */
}

.sredir-admin .widefat tbody tr:last-child td,
.sredir-admin .widefat tbody tr:last-child th {
    border-bottom: none;
}

.sredir-admin .widefat tbody tr:nth-child(odd) {
    background-color: #fcfcfc;
}

.sredir-admin .widefat tbody tr:hover {
    background-color: #f5f5f5;
}

/* Actions on Hover (for tables) */
.sredir-admin .widefat tbody tr .row-actions {
    position: relative;
    z-index: 10010 !important;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 2px 0;
    margin-top: 2px;
    display: flex;
    gap: 8px;
    border-radius: 4px;
}

.sredir-admin .widefat tbody tr:hover .row-actions {
    visibility: visible;
}

.sredir-admin .widefat .row-actions span {
    padding: 0 5px;
    border-right: 1px solid #ddd;
}
.sredir-admin .widefat .row-actions span:last-child {
    border-right: none;
    padding-right: 0;
}
.sredir-admin .widefat .row-actions .delete a {
    color: #a00;
}
.sredir-admin .widefat .row-actions .delete a:hover {
    color: #c00;
}

/* Specific Column Styles */
.sredir-admin .widefat .column-name strong {
    font-weight: 600;
}

.sredir-admin .widefat .column-shortcode code {
     padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
}

.sredir-admin .widefat .column-clicks {
    text-align: center;
    font-weight: 600;
}

.sredir-admin .widefat .column-stats button.button-link {
    padding: 0;
    font-size: 13px;
}

/* --- Enhancements for Form Cards --- */
.sredir-form-card h2 {
    font-size: 16px; /* Slightly smaller heading */
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sredir-form-card h2 .dashicons {
    vertical-align: text-bottom;
    margin-right: 5px;
    color: #555;
}

.sredir-form-card .form-table th {
    width: 200px; /* Fixed width for labels */
    padding-right: 20px;
}

.sredir-form-card .form-table td {
    padding-bottom: 15px; /* More spacing between rows */
}

.sredir-form-card p.description {
    color: #666;
    font-size: 13px;
}

/* Remove outdated card styles if they conflict */
.sredir-cards, .sredir-card {
    /* Comment out or remove if using tables instead */
    /* display: flex; */ 
    /* ... other flex/card styles ... */
    /* We'll keep .sredir-form-card for edit pages */
}

/* Dropdowns, Menus e Tooltips - Correção de z-index */
.sredir-admin select,
.sredir-admin .dropdown,
.sredir-admin .dropdown-menu,
.sredir-admin .ui-menu,
.sredir-admin .select2-container,
.sredir-admin .select2-dropdown,
.sredir-admin .sredir-tooltip,
.sredir-admin .sredir-popover,
.sredir-admin .autocomplete-suggestions,
.sredir-admin .context-menu {
    position: absolute !important;
    z-index: 999999 !important;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    border-radius: 6px;
    border: 1px solid #d0d0d0;
    min-width: 180px;
    padding: 8px 0;
    font-size: 15px;
    color: #222;
    margin-top: 2px;
    overflow: visible !important;
}

.sredir-admin .dropdown.open,
.sredir-admin .dropdown-menu.open,
.sredir-admin .ui-menu.open,
.sredir-admin .select2-container--open,
.sredir-admin .select2-dropdown--above,
.sredir-admin .select2-dropdown--below,
.sredir-admin .autocomplete-suggestions.open,
.sredir-admin .context-menu.open {
    display: block !important;
}

.sredir-admin .dropdown-menu li,
.sredir-admin .ui-menu li,
.sredir-admin .select2-results__option,
.sredir-admin .autocomplete-suggestion {
    padding: 8px 18px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: none;
}
.sredir-admin .dropdown-menu li:hover,
.sredir-admin .ui-menu li:hover,
.sredir-admin .select2-results__option--highlighted,
.sredir-admin .autocomplete-suggestion:hover {
    background: #f0f8ff;
    color: #0073aa;
}

.sredir-admin .select2-container--default .select2-selection--single {
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    height: 38px;
    padding: 6px 12px;
    font-size: 15px;
    background: #fff;
    box-shadow: none;
}

.sredir-admin .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 8px;
}

.sredir-admin .select2-dropdown {
    border-radius: 6px;
    border: 1px solid #d0d0d0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 999999 !important;
}

.sredir-admin .form-table th,
.sredir-admin .form-table td {
    vertical-align: middle;
    padding: 12px 10px;
}

.sredir-admin .form-table input[type="text"],
.sredir-admin .form-table input[type="email"],
.sredir-admin .form-table input[type="url"],
.sredir-admin .form-table input[type="number"],
.sredir-admin .form-table select {
    width: 100%;
    max-width: 350px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    font-size: 15px;
    background: #fafbfc;
    box-sizing: border-box;
}

.sredir-admin .form-table input[type="color"] {
    width: 50px;
    height: 32px;
    padding: 0;
    border: 1px solid #d0d0d0;
}

.sredir-admin .form-table textarea {
    width: 100%;
    min-height: 80px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    font-size: 15px;
    background: #fafbfc;
    padding: 8px 10px;
    box-sizing: border-box;
}

.sredir-admin .form-table .description {
    color: #666;
    font-size: 13px;
    margin-top: 4px;
}

.sredir-admin .button, .sredir-admin .button-primary {
    border-radius: 4px;
    font-size: 15px;
    padding: 8px 18px;
    margin: 2px 0;
}

.sredir-admin .button-primary {
    background: #0073aa;
    color: #fff;
    border: none;
}
.sredir-admin .button-primary:hover {
    background: #005177;
}

.sredir-admin .sredir-form-card {
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sredir-admin .sredir-form-card h2 {
    font-size: 18px;
    margin-bottom: 18px;
    color: #23282d;
}

.sredir-admin .widefat thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f9f9f9;
}

.sredir-admin .widefat tbody tr:hover {
    background: #f0f8ff;
}

.sredir-admin .widefat td, .sredir-admin .widefat th {
    vertical-align: middle;
}

.sredir-admin .sredir-empty-state {
    padding: 40px 0;
    color: #888;
    font-size: 16px;
}

/* Corrigir overflow para containers */
.sredir-admin,
.sredir-admin .wrap {
    overflow: visible !important;
}

/* Garantir que .row-actions fique sempre acima dos outros elementos da tabela */
.sredir-admin .widefat .row-actions {
    position: relative;
    z-index: 10010 !important;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 2px 0;
    margin-top: 2px;
    display: flex;
    gap: 8px;
    border-radius: 4px;
}

.sredir-admin .widefat td.column-name {
    position: relative;
    z-index: 10000;
    background: #fff;
}

.sredir-admin .widefat .row-actions span a {
    color: #0073aa;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.sredir-admin .widefat .row-actions span a:hover {
    color: #005177;
    text-decoration: underline;
}

/* Estilos para Modal de Estatísticas */
.sredir-modal {
    display: none; /* Oculto por padrão */
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* Fundo escurecido */
}

.sredir-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sredir-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    z-index: 100001;
}

.sredir-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sredir-modal-close:hover,
.sredir-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.sredir-modal-content h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.sredir-modal-content table {
    width: 100%;
    margin-top: 15px;
}
