/* General Body and Container Styling */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1c2a39;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #1c2a39;
}

/* Abas de Plataformas */
.platform-tabs-container {
    display: flex;
    gap: 5px;
    padding: 8px 10px;
    background-color: transparent;
    width: 95%;
    max-width: 100%;
    margin: 10px auto 0;
    justify-content: center;
}

.platform-tab-button {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    flex: 0 0 auto;
    min-width: auto;
}

.platform-tab-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.platform-tab-button.active {
    background-color: rgba(52, 131, 250, 0.3);
    color: #fff;
    border-color: rgba(52, 131, 250, 0.5);
    box-shadow: none;
}

.platform-tab-button[data-platform="shopee"].active {
    background-color: rgba(238, 77, 45, 0.3);
    border-color: rgba(238, 77, 45, 0.5);
}

.platform-tab-button[data-platform="amazon"].active {
    background-color: rgba(255, 153, 0, 0.3);
    border-color: rgba(255, 153, 0, 0.5);
}

.platform-content {
    display: flex;
    width: 95%;
    max-width: 100%;
    height: calc(100vh - 100px);
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin: 5px auto 20px;
}

.platform-content.active {
    display: flex;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: #1c2a39;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 420px;
    flex-shrink: 0;
    background-color: #303e4e;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.affiliate-config {
    width: 100%;
    margin-bottom: 10px;
    padding: 6px 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.affiliate-config .input-group {
    margin-bottom: 8px;
}

.affiliate-config .input-group:last-child {
    margin-bottom: 0;
}

.affiliate-config label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7em;
    font-weight: normal;
    margin-bottom: 4px;
}

.affiliate-config input,
.affiliate-config textarea {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.75em;
    padding: 4px 6px;
}

.affiliate-config input:focus,
.affiliate-config textarea:focus {
    outline: none;
    border-color: rgba(52, 131, 250, 0.5);
    box-shadow: 0 0 0 1px rgba(52, 131, 250, 0.2);
    background-color: rgba(255, 255, 255, 0.15);
}

.affiliate-config input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.affiliate-config button {
    padding: 4px 10px !important;
    font-size: 0.7em !important;
    font-weight: normal !important;
    background-color: rgba(52, 131, 250, 0.3) !important;
    border: 1px solid rgba(52, 131, 250, 0.4) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.affiliate-config button:hover {
    background-color: rgba(52, 131, 250, 0.4) !important;
    border-color: rgba(52, 131, 250, 0.6) !important;
}

.affiliate-config button[id*="Shopee"]:hover {
    background-color: rgba(238, 77, 45, 0.4) !important;
    border-color: rgba(238, 77, 45, 0.6) !important;
}

.affiliate-config button[id*="Amazon"]:hover {
    background-color: rgba(255, 153, 0, 0.4) !important;
    border-color: rgba(255, 153, 0, 0.6) !important;
}

.sidebar .logo {
    margin-bottom: 10px;
    margin-top: 0;
    margin-left: -15px;
    align-self: flex-start;
    width: 100%;
}

.sidebar .logo img {
    max-width: 150px;
    height: auto;
    display: block;
}

.sidebar h1 {
    font-size: 1.2em;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    margin-top: 0;
    font-weight: 700;
}

/* Sistema de Abas */
.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 45px;
    margin-top: 15px;
    width: 100%;
}

.tab-button {
    flex: 1;
    padding: 8px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
    background-color: #f5b400;
    color: #1c2a39;
    border-color: #f5b400;
}

.tab-content {
    width: 100%;
}

.tab-content.active {
    display: block;
    margin-top: 10px;
}

.tab-main-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-main-content.active {
    display: flex;
}

/* Estilo para o grupo do checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.checkbox-group label {
    font-weight: bold;
    color: #333;
    margin-left: 10px;
    margin-bottom: 0;
}

.sidebar .checkbox-group label {
    color: #fff;
}

/* Estilo para o grupo de checkboxes de flags */
.flags-checkbox-group {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.flag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: #fff;
    margin: 0;
    padding: 5px 0;
    white-space: nowrap;
}

.flag-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: #f5b400;
}

.flag-checkbox-label span {
    user-select: none;
}

.flag-checkbox-label:hover {
    color: #f5b400;
}

.input-group {
    width: 100%;
    margin-top: 20px;
    box-sizing: border-box;
}

.sidebar .input-group {
    margin-bottom: 8px;
}

.sidebar .input-group label {
    color: #fff;
}

.input-group input,
.input-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Estilo para inputs na mesma linha */
.input-group-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.input-group-inline {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
}

.input-group-inline label {
    font-size: 0.85em;
    color: #fff;
    margin-bottom: 0;
}

.input-group-inline input,
.input-group-inline select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    background-color: #fff;
}


.input-group label {
    display: block;
    font-size: 0.85em;
    color: #333;
    margin-bottom: 4px;
    font-weight: bold;
}

.input-group small {
    font-size: 0.75em;
}

.input-group input[type="text"],
.input-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em;
    resize: vertical;
}

.input-group select[multiple] {
    min-height: 80px;
    padding: 6px;
}

.input-group select[multiple] option {
    padding: 4px 8px;
    margin: 2px 0;
}

/* Choices.js Custom Styles for Flags Select */
.flags-choices .choices__inner {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    min-height: 38px;
    background-color: #fff;
}

.flags-choices .choices__list--multiple .choices__item {
    background-color: #f5b400;
    border: 1px solid #e6a300;
    color: #1c2a39;
    padding: 4px 10px;
    margin: 4px 4px 4px 0;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.flags-choices .choices__list--multiple .choices__item.is-highlighted {
    background-color: #e6a300;
    border-color: #d69400;
}

.flags-choices .choices__button {
    border-left: 1px solid #d69400;
    padding: 0 8px;
    opacity: 0.8;
}

.flags-choices .choices__button:hover {
    opacity: 1;
}

.flags-choices .choices__input {
    font-size: 0.9em;
    margin-bottom: 0;
}

.flags-choices.is-focused .choices__inner,
.flags-choices.is-open .choices__inner {
    border-color: #f5b400;
    box-shadow: 0 0 0 1px #f5b400;
}

.flags-choices .choices__list--dropdown {
    border: 1px solid #ccc;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    margin-top: -1px;
}

.flags-choices .choices__list--dropdown .choices__item--selectable {
    padding: 8px 12px;
}

.flags-choices .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #f0f7ff;
    color: #333;
}

.action-button {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 8px;
}

.action-button.primary {
    background-color: #f5b400;
    color: #1c2a39;
    margin-bottom: 20px;
    width: 100%;
}

.action-button.primary:hover:not(:disabled) {
    background-color: #e6a300;
}

.action-button.secondary {
    background-color: #f5b400;
    color: #1c2a39;
    width: 100%;
    margin-bottom: 20px;
}

.action-button.secondary:hover:not(:disabled) {
    background-color: #e6a300;
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Main Content Area Styling */
.content {
    flex-grow: 1;
    max-width: calc(100% - 350px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.products-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-radius: 6px;
    margin-bottom: 5px;
    flex-wrap: wrap;
    position: relative;
    min-height: 20px;
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filters-bar label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-weight: normal;
    color: #333;
}

.filters-bar select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    background-color: #fff;
}

.filters-bar input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.products-section h2 {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}ß

/* Exibição de Produto Único (Aba Gerar Link de Afiliado) */
.single-product-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 20px;
    padding: 20px;
    min-height: 100%;
}

.single-product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 25px;
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto; /* Centralizar horizontalmente */
}

.single-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.single-product-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.single-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.single-product-info h3 {
    font-size: 1.3em;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.single-product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.single-product-price .price-original {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9em;
}

.single-product-price .price-current {
    color: #00a650;
    font-size: 1.2em;
    font-weight: bold;
}

.single-product-message {
    margin-top: 5px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.single-product-message-container {
    width: 100%;
    min-height: 150px;
    position: relative;
}

.single-product-message-editor {
    width: 100%;
}

.single-product-message-editor textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95em;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.4;
    white-space: pre-wrap;
}

.single-product-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.single-product-actions button {
    flex: 1;
}

.products-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    min-height: 0;
}

/* Pagination Styles */
.pagination-container {
    display: none; /* Inicialmente oculto, será mostrado via JS quando necessário */
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(52, 131, 250, 0.2);
    margin: 10px auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    position: relative;
}

/* Forçar exibição quando o JavaScript definir display: flex */
.pagination-container[style*="display: flex"],
.pagination-container[style*="display:flex"],
.pagination-container[style*="display: flex !important"],
.pagination-container[style*="display:flex !important"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Classe adicional para garantir visibilidade */
.pagination-container.visible,
.pagination-container.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-info {
    font-size: 0.9em;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 8px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 12px;
    border: 2px solid #ddd;
    background-color: #fff;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pagination-btn:hover:not(:disabled) {
    background-color: #3483fa;
    border-color: #3483fa;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(52, 131, 250, 0.3);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.pagination-btn.page-number {
    min-width: 40px;
    font-weight: 600;
}

.pagination-btn.page-number.active {
    background-color: #3483fa;
    color: #fff;
    border-color: #3483fa;
    box-shadow: 0 2px 6px rgba(52, 131, 250, 0.4);
    font-weight: 700;
}

.pagination-btn.pagination-nav {
    font-weight: 700;
    padding: 8px 14px;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #999;
    font-size: 1em;
    font-weight: 600;
    user-select: none;
}

/* Responsividade da paginação */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination-container {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 10px;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .pagination-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.85em;
        min-width: 36px;
    }
    
    .pagination-btn.pagination-nav {
        padding: 6px 12px;
    }
}

.product-card-item {
    background-color: #fdfdfd;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative; /* Necessário para o indicador de loading */
}

.product-card-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card-item.selected {
    border-color: #3483fa;
    background-color: #f0f7ff;
    box-shadow: 0 4px 12px rgba(52, 131, 250, 0.2);
}

.product-card-item.sent {
    cursor: default;
    opacity: 0.7;
}

/* Indicador visual de geração de link */
.link-generating-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 100;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.link-generating-indicator .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3483fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.link-generating-indicator .spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

.link-generating-indicator span {
    font-size: 0.9em;
    color: #333;
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.product-card-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f5f5f5;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-info {
    flex-grow: 1;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.product-card-info p {
    font-size: 0.85em;
    margin: 1px 0;
    line-height: 1.2;
}

/* Estilos específicos para elementos de preço dentro do product-card-item */
.product-card-item .price-original {
    text-decoration: line-through;
    color: #777;
    font-size: 0.75em;
    margin-bottom: 1px;
    line-height: 1.2;
}

.product-card-item .price-current {
    font-size: 0.95em;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.2;
}

.product-card-item .discount-percent {
    color: #00a650;
    font-weight: bold;
    font-size: 0.75em;
    margin-bottom: 2px;
    line-height: 1.2;
}

.product-card-item .installments {
    font-size: 0.7em;
    color: #555;
    margin-bottom: 4px;
    line-height: 1.2;
}

.product-message-container {
    width: 100%;
    min-height: 60px;
    position: relative;
}

.product-message-editor {
    margin-top: 0;
    width: 100%;
}

.product-message-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.4;
}

.product-card-info h3 {
    font-size: 0.85em;
    font-weight: bold;
    margin: 0 0 4px 0;
    color: #333;
    line-height: 1.2;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 100%;
}

.select-product-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background-color: #3483fa;
    color: #fff;
}

.edit-message-btn-inline {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ff9800;
    color: #fff;
    white-space: nowrap;
    margin-top: 8px;
}

.save-message-btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #00a650;
    color: #fff;
    white-space: nowrap;
}

.save-message-btn:hover {
    background-color: #008f44;
}

.edit-message-btn-inline:hover:not(:disabled) {
    background-color: #f57c00;
}

.edit-message-btn-inline.saving {
    background-color: #00a650;
}

.edit-message-btn-inline.saving:hover {
    background-color: #008f44;
}

.edit-message-btn-inline:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.select-product-btn:hover {
    background-color: #2968c8;
}

.product-card-item.selected .select-product-btn {
    background-color: #00a650;
}

.product-card-item.selected .select-product-btn:hover {
    background-color: #008f44;
}

.generate-affiliate-link-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f5b400;
    color: #1c2a39;
    white-space: nowrap;
}

.generate-affiliate-link-btn:hover:not(:disabled) {
    background-color: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(245, 180, 0, 0.3);
}

.generate-affiliate-link-btn:disabled {
    background-color: #28a745;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Badge de produto enviado */
.sent-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #00a650;
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Badge de plataforma */
.product-platform-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    z-index: 9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Ajustar posição do badge de plataforma quando houver sent-badge (compatibilidade) */
.product-card-item.sent .product-platform-badge {
    top: 45px;
}

/* Cores específicas para cada plataforma */
.product-platform-badge[data-platform="mercadolivre"] {
    background-color: #3483fa; /* Azul Mercado Livre */
}

.product-platform-badge[data-platform="shopee"] {
    background-color: #ee4d2d; /* Laranja Shopee */
}

.product-platform-badge[data-platform="amazon"] {
    background-color: #ff9900; /* Laranja Amazon */
}

.product-flag-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Cores específicas para cada flag */
.product-flag-badge[data-flag="MAIS VENDIDO"] {
    background-color: #ff9800; /* Laranja */
}

.product-flag-badge[data-flag="OFERTA DO DIA"] {
    background-color: #2196f3; /* Azul */
}

.product-flag-badge[data-flag="OFERTA RELÂMPAGO"],
.product-flag-badge[data-flag="OFERTA RELAMPAGO"] {
    background-color: #f44336; /* Vermelho */
}

.products-count {
    text-align: center;
    margin: 10px 0;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.product-card-item {
    position: relative;
}

.product-card-item.sent {
    opacity: 0.7;
    border-color: #00a650;
}

.product-card-item.sent .select-product-btn {
    background-color: #ccc;
    cursor: not-allowed;
}

.product-card-item.sent .select-product-btn:hover {
    background-color: #ccc;
}

/* Botão de edição no card - agora dentro da imagem no canto inferior direito */
.product-card-image {
    position: relative;
}

.product-card-image .edit-message-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(52, 131, 250, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* Remover o antigo product-card-header */
.product-card-header {
    display: none;
}

.edit-message-btn:hover:not(:disabled) {
    background-color: #3483fa;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.edit-message-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-message-preview {
    margin-top: 8px;
    padding: 8px;
    background-color: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid #1976d2;
}

.custom-message-preview small {
    display: block;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 4px;
    font-size: 0.75em;
}

.custom-message-text {
    color: #333;
    font-size: 0.85em;
    line-height: 1.4;
    word-wrap: break-word;
    max-height: 80px;
    overflow-y: auto;
}

/* Modal de Edição */
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-in;
}

.edit-modal {
    background-color: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.edit-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.close-edit-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-edit-modal:hover {
    background-color: #f5f5f5;
    color: #333;
}

.edit-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.edit-modal-body textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.edit-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.edit-modal-footer .action-button {
    width: auto;
    min-width: 100px;
    margin: 0;
}

/* Overlay de Progresso do Scraping */
.scraping-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.scraping-modal {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.scraping-header {
    text-align: center;
    margin-bottom: 25px;
}

.scraping-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.5em;
}

.scraping-header p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}

.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3483fa 0%, #2968c8 50%, #3483fa 100%);
    background-size: 200% 100%;
    border-radius: 12px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-text {
    text-align: center;
    font-weight: bold;
    color: #3483fa;
    font-size: 0.9em;
}

.scraping-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.step.active {
    background-color: #e3f2fd;
    border-left: 4px solid #3483fa;
}

.step.completed {
    background-color: #e8f5e9;
    border-left: 4px solid #00a650;
}

.step-icon {
    font-size: 1.2em;
    min-width: 24px;
    text-align: center;
}

.step.active .step-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.step.completed .step-icon {
    content: '✓';
    color: #00a650;
}

.step-text {
    flex: 1;
    color: #666;
    font-size: 0.9em;
}

.step.active .step-text {
    color: #3483fa;
    font-weight: 500;
}

.step.completed .step-text {
    color: #00a650;
}

/* Product Card Styling */
.product-card, .whatsapp-card {
    background-color: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    overflow-y: auto;
}

.product-card img, .whatsapp-card img {
    max-width: 90%;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 4px;
}

.product-card h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.product-card .price-original {
    text-decoration: line-through;
    color: #777;
    font-size: 0.8em;
    margin-bottom: 2px;
}

.product-card .price-current {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.product-card .discount-percent {
    color: #00a650;
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.product-card .installments {
    font-size: 0.75em;
    color: #555;
    margin-bottom: 10px;
}

.product-card .product-link {
    font-size: 0.8em;
    color: #3483fa;
    word-break: break-all;
}

/* WhatsApp Preview Specific Styling */
.whatsapp-card {
    background-color: #e0f7fa;
    border-color: #b2ebf2;
    padding: 20px;
    line-height: 1.4;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Estilo para a mensagem de oferta relâmpago no WhatsApp */
.whatsapp-card .oferta-relampago-text {
    font-weight: bold;
    color: #e53935;
    margin-bottom: 10px;
    display: none;
}

.whatsapp-card .oferta-relampago-text.active {
    display: block;
}

/* Estilo para grupos do WhatsApp */
#groupsContainer {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100%;
}

.whatsapp-group-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.whatsapp-group-item:hover {
    background-color: #f5f5f5;
}

.whatsapp-group-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.whatsapp-group-item .group-name {
    flex: 1;
    font-size: 0.9em;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.whatsapp-groups-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Utility classes for dynamic content */
.loading-indicator {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3483fa;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none;
    margin: 10px auto;
}

.loading-indicator.active {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #e53935;
    font-size: 0.9em;
    margin-top: -10px;
    margin-bottom: 10px;
    text-align: center;
    display: none;
}

.status-message {
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.status-message.success {
    color: #00a650;
}

.status-message.error {
    color: #e53935;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 100%;
        height: calc(100vh - 20px);
        margin: 10px 0;
        border-radius: 0;
    }

    .sidebar {
        width: 100%;
        padding: 10px 15px;
        height: auto;
        max-height: 50%;
        overflow-y: auto;
    }

    .content {
        flex-direction: column;
        padding: 20px 15px;
        gap: 20px;
        max-width: 100%;
        height: auto;
        flex: 1;
        overflow-y: auto;
    }

    .products-carousel {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .product-card, .whatsapp-card {
        height: auto;
    }
}

@media (max-width: 480px) {
    .sidebar h1 {
        font-size: 1.5em;
    }

    .action-button {
        font-size: 1em;
        padding: 10px 12px;
    }
}

/* New styles for discount coupon and final price fields */
.hidden-input-group {
    display: none;
}

/* Phone numbers list styling */
.phone-numbers-list {
    margin-bottom: 15px;
    max-height: 150px;
    overflow-y: auto;
}

.phone-number-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.remove-phone-btn {
    background-color: #e53935;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-phone-btn:hover {
    background-color: #c62828;
}

.action-button {
    width: auto;
    padding: 8px 12px;
    font-size: 0.9em;
}

/* Sistema de Notificações Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 4.7s;
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background-color: #4caf50;
    color: white;
    border-left: 4px solid #2e7d32;
}

.toast.error {
    background-color: #f44336;
    color: white;
    border-left: 4px solid #c62828;
}

.toast.info {
    background-color: #2196f3;
    color: white;
    border-left: 4px solid #1565c0;
}

.toast.warning {
    background-color: #ff9800;
    color: white;
    border-left: 4px solid #e65100;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsividade para notificações */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}