/* Admin Global Styles */

/* Dark Theme Color Palette */
:root {
    --admin-dark-bg: #abbcd3; /* Very dark grey, almost black - main background */
    --admin-content-bg: #d6e8ff; /* Dark grey - for cards, sidebars, content areas */
    --admin-border-color: #444C56; /* Medium grey - for borders, dividers */
    --admin-text-primary: #181A1F; /* Very dark grey, almost black */
    --admin-text-secondary: #8a8a8a; /* Dark grey */
    --admin-accent-primary: #000000; /* Bright blue - for links, buttons, active states */
    --admin-accent-primary-hover: #79C0FF; /* Lighter blue for hover */
    --admin-accent-secondary: #3FB950; /* Green - for success, confirmation */
    --admin-accent-danger: #F85149; /* Red - for errors, warnings */
    --admin-input-bg: #b6b3b3; /* Same as main background for inputs */
    --admin-input-border: #444C56;
    --admin-input-focus-border: #58A6FF;
    --admin-table-header-bg: #90c0ff; /* Slightly lighter than content-bg for table headers */
    --admin-table-row-hover-bg: #afd2ff; /* Hover for table rows */
    --admin-scrollbar-thumb: #444C56;
    --admin-scrollbar-track: #b0c6e4;
    --admin-accent-primary-rgb: 88, 166, 255; 
    --admin-card-form-bg: #EBF4FF; /* MODIFIED: Added light blue for cards/forms */
}

html, body.admin-page {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body.admin-page {
    font-family: 'Arial', sans-serif;
    background-color: var(--admin-dark-bg); 
    color: var(--admin-text-primary); /* This will now be very dark */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Scrollbar Styling */
body.admin-page::-webkit-scrollbar {
    width: 8px;
}

body.admin-page::-webkit-scrollbar-track {
    background: var(--admin-scrollbar-track);
}

body.admin-page::-webkit-scrollbar-thumb {
    background-color: var(--admin-scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--admin-scrollbar-track);
}

.admin-sidebar {
    width: 250px;
    height: calc(100vh - 50px); 
    position: fixed;
    top: 50px; 
    left: 0;
    background-color: var(--admin-content-bg);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(184, 200, 230, 0.25); /* Darker shadow */
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    border-right: 1px solid var(--admin-border-color);
    display: none;
    transform: translateX(-100%);
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--admin-scrollbar-thumb);
    border-radius: 3px;
}
.admin-sidebar::-webkit-scrollbar-track {
    background: var(--admin-content-bg); /* Match sidebar bg */
}


.admin-top-bar {
    background-color: var(--admin-content-bg); 
    padding: 10px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25); /* Darker shadow */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001; 
    height: 50px; 
    box-sizing: border-box;
    border-bottom: 1px solid var(--admin-border-color);
}

.sidebar-toggle-button {
    background-color: transparent;
    color: var(--admin-text-primary);
    border: none;
    padding: 8px;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    display: none; 
}
.sidebar-toggle-button:hover {
    color: var(--admin-accent-primary);
}

.admin-content-wrapper {
    display: flex;
    padding-top: 50px; 
    flex-grow: 1; 
}

.admin-main-content {
    margin-left: 0; 
    padding: 20px 15px; /* MODIFIED: Adjusted padding */
    width: 100%; 
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out; 
    box-sizing: border-box;
    background-color: var(--admin-dark-bg); 
    flex-grow: 1; 
}

/* Initially hide sidebar and main content intended for authenticated admins */
.admin-sidebar {
    width: 250px;
    height: calc(100vh - 50px); /* Assuming top bar is 50px */
    position: fixed;
    top: 50px; /* Position below top bar */
    left: 0;
    background-color: #ffffff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;

    /* Default state: display:none to remove from layout, and transformed off-screen */
    display: none;
    transform: translateX(-100%);
}

.admin-top-bar {
    background-color: #ffffff; /* Barra superior branca */
    padding: 10px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed; /* Fixa a barra superior */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001; /* Acima do sidebar e overlay */
    height: 50px; /* Altura fixa para a top-bar */
    box-sizing: border-box;
}

.sidebar-toggle-button {
    background-color: transparent;
    color: #333;
    border: none;
    padding: 8px;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    display: none; /* Oculto em desktop, visível em mobile pela media query */
}

.admin-content-wrapper {
    display: flex;
    padding-top: 50px; /* Altura da top-bar para não sobrepor o conteúdo */
    flex-grow: 1; /* Permite que este wrapper cresça */
}

.admin-main-content {
    margin-left: 0; /* Default when sidebar is hidden */
    padding: 15px; /* MODIFIED: Reduced padding from 25px to 15px */
    width: 100%; /* Default when sidebar is hidden */
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out; /* Keep these transitions */
    box-sizing: border-box;
    background-color: #f0f2f5; /* Fundo do conteúdo principal */
    flex-grow: 1; /* Faz o conteúdo principal crescer e empurrar o rodapé para baixo */
}

/* Styles for when user is authenticated as admin */
body.admin-auth-visible .admin-sidebar {
    display: block; /* Make sidebar part of the layout, it's still transformed out by default */
}

/* Desktop view for authenticated admin */
@media (min-width: 769px) {
    body.admin-auth-visible .admin-sidebar {
        transform: translateX(0); /* Slide in for desktop */
    }
    body.admin-auth-visible .admin-main-content {
        /* Reverted to previous value, or a common value for form pages */
        margin-left: 130px; 
        width: calc(100% - 130px); /* Adjust width accordingly */
    }
    /* New style for full-width content, like the activity log page */
    body.admin-auth-visible .admin-main-content--full-width {
        margin-left: 250px; /* Corrected: Start after 250px sidebar */
        width: calc(100% - 250px);     /* Corrected: Adjust width accordingly */
        /* padding-left and padding-right are inherited or can be set if needed */
    }

    /* Sidebar toggle button should be hidden on desktop */
    .sidebar-toggle-button {
        display: none;
    }
}

/* Mobile-specific adjustments for authenticated admin */
@media (max-width: 768px) {
    .sidebar-toggle-button {
        display: block; /* Show toggle button on mobile */
    }

    /* On mobile, when admin-auth-visible, sidebar is display:block but still transformed out. */
    /* The .open class (toggled by JS) brings it into view. */
    body.admin-auth-visible .admin-sidebar.open {
        transform: translateX(0); /* Slide in when toggled */
    }

    /* Main content always full width on mobile, sidebar overlays */
    .admin-main-content { /* This applies to both auth and non-auth states on mobile */
        margin-left: 0;
        width: 100%;
    }
}


/* Login section should be visible by default if body does not have .admin-auth-visible */
#admin-login-section {
    display: block;
}

/* Dashboard content should be hidden by default */
#admin-dashboard-content {
    display: none;
}

/* When admin is authenticated, show dashboard and hide login */
body.admin-auth-visible #admin-login-section {
    display: none !important; /* Added !important */
}

body.admin-auth-visible #admin-dashboard-content {
    display: block !important; /* Added !important */
}

/* Styles for protected content on other admin pages */
#admin-protected-content {
    display: none; /* Hidden by default */
}

body.admin-auth-visible #admin-protected-content {
    display: block !important; /* Show when admin is authenticated */
}

/* Auth message for non-index admin pages */
#admin-auth-message {
    padding: 20px;
    text-align: center;
}

.admin-sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar nav ul li a {
    display: block;
    padding: 12px 15px;
    color: var(--admin-text-secondary); /* Will become dark grey */
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 5px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-sidebar nav ul li a:hover,
.admin-sidebar nav ul li a.active {
    background-color: var(--admin-accent-primary);
    color: #FFFFFF; /* MODIFIED: Explicitly white text on active/hover for blue background */
}

.admin-sidebar .logo-link a {
    color: var(--admin-text-primary); /* Will become very dark */
    text-decoration: none;
}
.admin-sidebar .logo-link a:hover {
    color: var(--admin-accent-primary);
}
.admin-sidebar .sidebar-user-info {
    color: var(--admin-text-secondary);
    border-top: 1px solid var(--admin-border-color);
    padding-top: 10px;
    margin-top: 15px;
}
.admin-sidebar .sidebar-user-info p {
    color: var(--admin-text-primary);
    font-weight: bold;
}


.body-overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65); /* Darker overlay */
    z-index: 999; /* Abaixo do sidebar, mas acima do conteúdo se o sidebar estiver sobreposto */
}

.body-overlay.active {
    display: block;
}

/* Formulários Responsivos */
.admin-form .form-group {
    margin-bottom: 1rem; /* Espaçamento padrão entre grupos de formulário */
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--admin-text-primary);
}

.admin-form input[type="text"],
.admin-form input[type="email"], /* Added email */
.admin-form input[type="password"], /* Added password */
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form input[type="file"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--admin-input-border);
    border-radius: 0.25rem;
    box-sizing: border-box;
    font-size: 0.95rem;
    background-color: var(--admin-input-bg);
    color: var(--admin-text-primary);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.admin-form input[type="file"] { /* Specific for file input text color */
    color: var(--admin-text-secondary);
}
.admin-form input::placeholder,
.admin-form textarea::placeholder {
    color: var(--admin-text-secondary);
}


.admin-form input[type="text"]:focus,
.admin-form input[type="email"]:focus, /* Added email */
.admin-form input[type="password"]:focus, /* Added password */
.admin-form input[type="url"]:focus,
.admin-form input[type="number"]:focus,
.admin-form input[type="file"]:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: var(--admin-input-focus-border);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--admin-accent-primary-rgb, 88, 166, 255),.25); /* Fallback if CSS var in rgba not supported */
}
/* Helper for box-shadow with RGB values from --admin-accent-primary */
:root {
    --admin-accent-primary-rgb: 88, 166, 255; 
}


.admin-form textarea {
    min-height: 80px;
    resize: vertical;
}

.admin-form .form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8em;
    color: var(--admin-text-secondary);
}

.admin-form .button, .button { /* General button styling for admin */
    background-color: var(--admin-dark-bg);         /* MODIFIED: Inverted to Very Dark Grey BG */
    color: var(--admin-accent-primary);           /* MODIFIED: Inverted to Bright Blue text */
    border: 1px solid var(--admin-accent-primary);  /* MODIFIED: Bright Blue border */
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-weight: 500;
}
.admin-form .button:hover, .button:hover {
    background-color: var(--admin-accent-primary);      /* MODIFIED: Inverted to Bright Blue BG (was accent-primary-hover) */
    border-color: var(--admin-accent-primary);          /* MODIFIED: Bright Blue border */
    color: var(--admin-dark-bg);                      /* MODIFIED: Inverted to Very Dark Grey text */
}
.admin-form .button--secondary, .button--secondary {
    background-color: var(--admin-content-bg);
    color: var(--admin-text-primary);
    border-color: var(--admin-border-color);
}
.admin-form .button--secondary:hover, .button--secondary:hover {
    background-color: var(--admin-border-color);
    color: var(--admin-text-primary);
}
.admin-form .button--danger, .button--danger {
    background-color: var(--admin-accent-danger);
    color: white; /* White text on danger button */
    border-color: var(--admin-accent-danger);
}
.admin-form .button--danger:hover, .button--danger:hover {
    background-color: #d83a33; /* Darker red on hover */
    border-color: #d83a33;
}


.admin-form fieldset {
    border: 1px solid var(--admin-border-color);
    padding: 1.5rem;
    border-radius: 0.3rem;
    margin-bottom: 1.5rem;
}

.admin-form legend {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0 0.5rem;
    color: var(--admin-accent-primary);
    margin-bottom: 1rem;
}

.admin-form #affiliate-links-group .form-group {
    padding-left: 1rem; 
    border-left: 3px solid var(--admin-accent-primary);
    margin-bottom: 1rem;
}
.admin-form #affiliate-links-group .form-group__title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--admin-text-primary);
}

/* Admin Footer Styles */
.admin-footer {
    background-color: var(--admin-content-bg); 
    color: var(--admin-text-secondary);
    text-align: center;
    padding: 15px 20px;
    border-top: 1px solid var(--admin-border-color);
    margin-top: auto; 
    font-size: 0.9rem;
}
/* Fim Admin Footer Styles */


/* Tabelas Responsivas */
.table-responsive-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem; 
    border: 1px solid var(--admin-border-color);
    border-radius: .25rem;
}

.admin-table {
    width: 100%;
    min-width: 700px; 
    border-collapse: collapse;
    background-color: var(--admin-content-bg); /* Table background */
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem; 
    text-align: left;
    border-bottom: 1px solid var(--admin-border-color);
    font-size: 0.9rem; 
    vertical-align: middle; 
    color: var(--admin-text-primary); /* Text color for table cells */
}

.admin-table thead th {
    background-color: var(--admin-table-header-bg); 
    font-weight: 600; 
    color: var(--admin-text-primary);
    border-top: 1px solid var(--admin-border-color); 
    border-bottom-width: 2px; /* Thicker bottom border for header */
}

.admin-table tbody tr:hover {
    background-color: var(--admin-table-row-hover-bg); 
}
.admin-table tbody tr td {
    border-bottom: 1px solid var(--admin-border-color); /* Ensure consistent border */
}
.admin-table tbody tr:last-child td {
    border-bottom: none; /* No border for the last row cells */
}

/* Ajustes específicos para telas menores */
@media (max-width: 768px) {
    .sidebar-toggle-button {
        display: block; /* Mostra o botão em telas menores */
    }

    .admin-sidebar { /* General mobile styles for sidebar, transform handled by .admin-auth-visible context */
        top: 0; 
        height: 100vh; 
        z-index: 1002; 
    }

    /* .admin-sidebar.open is already correctly defined for transform: translateX(0); */

    .admin-main-content {
        margin-left: 0;
        width: 100%;
    }

    .admin-form fieldset {
        padding: 1rem;
    }
    .admin-form legend {
        font-size: 1.15rem;
    }

    .admin-form .button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .admin-form .button:last-child {
        margin-bottom: 0;
    }

    .admin-form #affiliate-links-group .form-group {
        padding-left: 0.5rem;
    }
    
    /* Para tabelas, o wrapper .table-responsive-wrapper já cuida do scroll.
       Poderíamos adicionar estilos para transformar linhas em cards aqui, se desejado no futuro. */
}

@media (max-width: 576px) {
    .admin-main-content {
        padding: 15px; /* Reduz o padding do conteúdo principal em telas muito pequenas */
    }
    .admin-page-title {
        font-size: 1.5rem; /* Reduz o título da página */
    }
    .admin-section__subtitle {
        font-size: 1.1rem;
    }
}

/* New styles for review products page */
.admin-table-responsive {
    overflow-x: auto;
}

.review-products-table img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
}

.review-products-table input[type="text"],
.review-products-table input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 0; 
    border: 1px solid var(--admin-input-border);
    border-radius: 3px;
    font-size: 0.95em;
    background-color: var(--admin-input-bg);
    color: var(--admin-text-primary);
}
.review-products-table input::placeholder {
    color: var(--admin-text-secondary);
}

.review-products-table .actions button {
    margin-right: 5px;
    margin-bottom: 5px; /* Add some space if buttons wrap */
}

.review-products-table .actions button i {
    margin-right: 5px;
}

/* Ensure buttons in table actions are consistently sized if needed */
.admin-table .actions .button-small, /* From dashboard, can be reused or made more specific */
.review-products-table .actions .button-small {
    padding: 6px 10px;
    font-size: 0.85em;
}

.error-message { /* General error message styling */
    color: white; /* White text for better contrast on dark red */
    font-weight: bold;
    padding: 10px;
    border: 1px solid var(--admin-accent-danger);
    background-color: var(--admin-accent-danger); /* Use accent color */
    border-radius: 4px;
}
.success-message { /* General success message styling */
    color: white;
    font-weight: bold;
    padding: 10px;
    border: 1px solid var(--admin-accent-secondary);
    background-color: var(--admin-accent-secondary);
    border-radius: 4px;
}


/* Estilos para os filtros de produtos */
.admin-filters-container {
    margin-bottom: 20px;
    background-color: var(--admin-card-form-bg); /* MODIFIED: Light blue background */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--admin-border-color);
}

/* Dashboard specific styles */
.admin-page-title {
    color: var(--admin-text-primary); /* Will become very dark */
    margin-bottom: 20px;
    font-size: 1.8rem;
}
.admin-page-title i {
    margin-right: 10px;
    color: var(--admin-accent-primary);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stats__card, .admin-inner-card { /* General card style for dashboard items */
    background-color: var(--admin-card-form-bg); /* MODIFIED: Light blue background */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--admin-border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Softened shadow for light bg */
}

.admin-stats__title {
    font-size: 1rem;
    color: var(--admin-text-secondary); /* Will become dark grey */
    margin-bottom: 10px;
    font-weight: 500;
}
.admin-stats__title i {
    margin-right: 8px;
    color: var(--admin-accent-primary);
}

.admin-stats__value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--admin-text-primary); /* Will become very dark */
}

.admin-section__title {
    font-size: 1.3rem;
    color: var(--admin-text-primary); /* Will become very dark */
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--admin-border-color);
}
.admin-section__title i {
    margin-right: 8px;
    color: var(--admin-accent-primary);
}

.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--admin-border-color);
    color: var(--admin-text-secondary); /* Will become dark grey */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}
.dashboard-list li:last-child {
    border-bottom: none;
}
.dashboard-list .item-name {
    font-weight: 500;
    color: var(--admin-text-primary); /* Will become very dark */
    flex-basis: 50%; /* Give more space to name */
}
.dashboard-list .item-details {
    font-size: 0.85rem;
    color: var(--admin-text-secondary);
    flex-basis: 30%;
}
.dashboard-list .item-actions {
    flex-basis: 15%;
    text-align: right;
}
.dashboard-list .item-details.expiring-soon {
    color: var(--admin-accent-danger);
    font-weight: bold;
}

.admin-quick-actions .quick-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-quick-actions .button i {
    margin-right: 5px;
}

/* Ensure login form is also styled for dark theme */
#admin-login-section .admin-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: var(--admin-card-form-bg); /* MODIFIED: Light blue background */
    border-radius: 8px;
    border: 1px solid var(--admin-border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); /* Softened shadow */
}
#admin-login-section .admin-page-title {
    text-align: center;
    margin-bottom: 25px;
}
#admin-login-form .error-message { /* Specific for login error */
    margin-top: 15px;
    text-align: center;
}

/* Ensure TinyMCE iframe content is readable with dark theme */
/* This might need more specific selectors if TinyMCE loads its own CSS */
.tox-edit-area__iframe {
    background-color: var(--admin-input-bg) !important; /* Force background */
}
/* Attempt to style TinyMCE content - this is often tricky */
body.mce-content-body {
    background-color: var(--admin-input-bg) !important;
    color: var(--admin-text-primary) !important;
}

/* Ensure select dropdowns are styled for dark theme */
.admin-form select {
    appearance: none; /* Remove default system appearance */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ADBAC7%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: .65em auto;
    padding-right: 2.5rem; /* Make space for the arrow */
}
.admin-form select:focus {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2358A6FF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
}

/* Pagination styles for dark theme */
.pagination-container .pagination .page-item .page-link {
    background-color: var(--admin-content-bg);
    color: var(--admin-text-secondary);
    border-color: var(--admin-border-color);
}
.pagination-container .pagination .page-item.active .page-link {
    background-color: var(--admin-accent-primary);
    color: var(--admin-dark-bg);
    border-color: var(--admin-accent-primary);
}
.pagination-container .pagination .page-item .page-link:hover {
    background-color: var(--admin-border-color);
    color: var(--admin-text-primary);
}
.pagination-container .pagination .page-item.disabled .page-link {
    background-color: var(--admin-content-bg);
    color: var(--admin-text-secondary);
    opacity: 0.6;
   ============================================================================= */

/* TinyMCE customizations for dark theme compatibility */
.tox-tinymce {
    border: 1px solid var(--admin-border-color, #ccc) !important;
}

.tox .tox-edit-area__iframe {
    background-color: var(--admin-input-bg, white) !important;
}

.tox .tox-toolbar-overlord {
    background: var(--admin-content-bg, #f8f9fa) !important;
}

/* =============================================================================
   TINYMCE FALLBACK AND ERROR HANDLING STYLES
   ============================================================================= */

/* Fallback notice styles */
.tinymce-fallback-notice {
    background: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
    color: #856404 !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.tinymce-fallback-notice::before {
    content: "⚠️";
    font-size: 14px;
}

/* Enhanced textarea when TinyMCE is not available */
.admin-form textarea.fallback-notified {
    min-height: 350px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    resize: vertical !important;
    border: 2px solid var(--admin-input-border) !important;
    background-color: var(--admin-input-bg) !important;
    color: var(--admin-text-primary) !important;
}

.admin-form textarea.fallback-notified:focus {
    border-color: var(--admin-accent-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25) !important;
}

/* TinyMCE loading indicator */
.tinymce-loading {
    position: relative;
}

.tinymce-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--admin-accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status messages for TinyMCE initialization */
.tinymce-status {
    margin-top: 5px;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
}

.tinymce-status.loading {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.tinymce-status.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.tinymce-status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.tinymce-status.fallback {
    background-color: #fff8e1;
    color: #ef6c00;
    border: 1px solid #ffecb3;
}

/* Override readonly styling for TinyMCE */
.tox .tox-edit-area--readonly .tox-edit-area__iframe {
    background-color: var(--admin-input-bg) !important;
    cursor: text !important;
}

/* Hide TinyMCE branding when in fallback mode */
.tox .tox-statusbar a[href*="tiny.cloud"] {
    display: none !important;
}

/* TinyMCE error state styling */
.tinymce-error .tox-tinymce {
    border: 2px solid var(--admin-accent-danger) !important;
    background-color: #ffebee !important;
}

/* Enhanced editor container */
.editor-container {
    position: relative;
    margin-bottom: 15px;
}

.editor-container .editor-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--admin-text-primary);
}

.editor-container .editor-help {
    font-size: 0.8em;
    color: var(--admin-text-secondary);
    margin-top: 5px;
    line-height: 1.4;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus management for keyboard navigation */
.editor-container:focus-within {
    outline: 2px solid var(--admin-accent-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* =============================================================================
   TINYMCE EDITOR STYLES - Moved from tinymce-custom.css
   ============================================================================= */

/* Garantir que a toolbar do TinyMCE seja exibida corretamente */
.tox-toolbar__group {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tox-toolbar {
    display: flex !important;
    visibility: visible !important;
    border-bottom: 1px solid #ccc;
    padding: 4px 0;
}

.tox .tox-toolbar__primary {
    display: flex !important;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.tox .tox-tbtn {
    margin: 0 2px;
}

/* Corrigir possível problema com menus do TinyMCE */
.tox .tox-menu {
    z-index: 1500 !important; /* Garantir que fique acima de outros elementos */
}

/* Garantir que o container do editor seja exibido corretamente */
.tox-tinymce {
    min-height: 350px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    margin-bottom: 10px;
}

/* Melhorar a aparência do editor */
.tox-editor-container {
    background-color: #fff !important;
}

/* Ajuste para a área de edição */
.tox .tox-edit-area__iframe {
    background-color: #fff !important;
}

/* Destacar o editor quando em foco */
.tox-tinymce:focus-within {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Garantir que o editor apareça mesmo em dispositivos móveis */
@media (max-width: 768px) {
    .tox-toolbar__group {
        display: flex !important;
        flex-wrap: wrap;
    }
}

/* Estilos para a área de visualização da descrição do produto */
.product-description-preview {
    overflow-wrap: break-word;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Estilos para listas dentro da descrição do produto */
.product-description-preview ul, 
.product-description-preview ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.product-description-preview li {
    margin-bottom: 5px;
}

/* Estilos para tabelas dentro da descrição do produto */
.product-description-preview table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 15px;
}

.product-description-preview table, 
.product-description-preview th, 
.product-description-preview td {
    border: 1px solid #ddd;
}

.product-description-preview th, 
.product-description-preview td {
    padding: 8px;
    text-align: left;
}

.product-description-preview th {
    background-color: #f2f2f2;
}

/* ==========================================
   PRICE UPDATE ALERTS SYSTEM
   ========================================== */

/* Sistema de alertas para última atualização de preços */
.last-update-cell {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Estado normal - atualizado recentemente (menos de 24h) */
.last-update-normal {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Aviso - entre 24-36 horas */
.last-update-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    animation: pulse-warning 2s infinite;
}

/* Urgente - mais de 36 horas */
.last-update-urgent {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f1aeb5;
    animation: pulse-urgent 1.5s infinite;
}

/* Nunca atualizado */
.last-update-never {
    background-color: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
    font-style: italic;
}

/* Animações de pulsação para chamar atenção */
@keyframes pulse-warning {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes pulse-urgent {
    0% { transform: scale(1); background-color: #f8d7da; }
    50% { transform: scale(1.03); background-color: #f5c6cb; }
    100% { transform: scale(1); background-color: #f8d7da; }
}

/* Tooltip para mostrar data/hora completa */
.last-update-cell[title] {
    cursor: help;
}

/* Ícones para diferentes estados */
.last-update-cell::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.last-update-normal::before {
    background-color: #28a745;
}

.last-update-warning::before {
    background-color: #ffc107;
}

.last-update-urgent::before {
    background-color: #dc3545;
}

.last-update-never::before {
    background-color: #6c757d;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .last-update-cell {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .last-update-cell::before {
        width: 6px;
        height: 6px;
        margin-right: 4px;
    }
}

/* Homepage Settings Styles */
.admin-homepage-settings {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: var(--admin-input-bg);
    border: 2px solid var(--admin-input-border);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid var(--admin-dark-bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-label input:checked + .checkmark {
    background-color: var(--admin-accent-primary);
    border-color: var(--admin-accent-primary);
}

.checkbox-label input:checked + .checkmark::after {
    opacity: 1;
}

.checkbox-label:hover .checkmark {
    border-color: var(--admin-accent-primary);
}

.setting-description {
    font-size: 0.9rem;
    color: var(--admin-text-secondary);
    margin: 0.5rem 0;
    line-height: 1.4;
}

.setting-status {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: var(--admin-table-header-bg);
}

.status-indicator {
    font-size: 0.9rem;
    font-weight: 500;
}

.status-indicator.active {
    color: var(--admin-accent-secondary);
}

.status-indicator.inactive {
    color: var(--admin-text-secondary);
}

.status-indicator.loading {
    color: var(--admin-accent-primary);
}