:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-card: rgba(255, 255, 255, 0.1);
    --primary: #ee4d2d; /* Shopee Orange Accent */
    --primary-hover: #ff5733;
    --primary-glow: rgba(238, 77, 45, 0.35);
    --secondary: #6366f1; /* Indigo */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 10%, rgba(238, 77, 45, 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(99, 102, 241, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= CONTAINER & GLASS CARDS ================= */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
}

/* ================= LOGIN PAGE ================= */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 2.5rem 2rem;
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.brand-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 12px var(--primary-glow));
}

.brand-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ================= FORM ELEMENTS ================= */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(15, 23, 42, 0.9);
}

.btn-primary {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #d9381e 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ================= DASHBOARD HEADER ================= */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-card);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(8px);
}

.status-badge.open {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.connecting {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.close, .status-badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* ================= GRID & CARDS ================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
}

/* ================= QR CODE CONTAINER ================= */
.qrcode-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    text-align: center;
}

.qrcode-img {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.qr-instructions {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 320px;
    line-height: 1.4;
}

/* ================= GROUPS LIST CHECKLIST ================= */
.groups-container {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.groups-container::-webkit-scrollbar {
    width: 6px;
}

.groups-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.group-item:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

.group-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.group-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.group-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ================= TOAST FEEDBACK ================= */
.alert-banner {
    padding: 0.85rem 1.2rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: none;
}

.alert-banner.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-banner.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* ================= SPINNER DE CARREGAMENTO ================= */
.spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================= MODAL & PASSWORD CONTROLS ================= */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .input-control {
    padding-right: 2.8rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: var(--transition);
    user-select: none;
}

.btn-toggle-password:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box {
    background: rgba(30, 41, 59, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    position: relative;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { transform: translateY(16px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ================= PLATFORM TABS & NAVIGATION ================= */
.platform-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.platform-nav::-webkit-scrollbar {
    display: none;
}

.platform-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
}

.platform-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.platform-tab-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.platform-tab-btn[data-target="shopee"].active {
    background: rgba(238, 77, 45, 0.15);
    border-color: rgba(238, 77, 45, 0.45);
    color: #ff6b4a;
}

.platform-tab-btn[data-target="mercadolivre"].active {
    background: rgba(255, 230, 0, 0.12);
    border-color: rgba(255, 230, 0, 0.45);
    color: #ffe600;
}

.platform-tab-btn[data-target="amazon"].active {
    background: rgba(255, 153, 0, 0.15);
    border-color: rgba(255, 153, 0, 0.45);
    color: #ff9900;
}

.platform-tab-btn[data-target="whatsapp"].active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.45);
    color: #10b981;
}

.tab-badge {
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.tab-badge.badge-shopee {
    background: rgba(238, 77, 45, 0.25);
    color: #ff7a5c;
    border: 1px solid rgba(238, 77, 45, 0.4);
}

.tab-badge.badge-ml {
    background: rgba(255, 230, 0, 0.2);
    color: #ffe600;
    border: 1px solid rgba(255, 230, 0, 0.4);
}

.tab-badge.badge-amazon {
    background: rgba(255, 153, 0, 0.25);
    color: #ff9900;
    border: 1px solid rgba(255, 153, 0, 0.4);
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.tab-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.tab-dot.offline {
    background: var(--danger);
}

/* ================= ISOLATED PLATFORM CONTAINERS ================= */
.platform-container {
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 12px 35px -10px rgba(0, 0, 0, 0.55);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 2.25rem;
    position: relative;
    overflow: hidden;
}

.platform-container.hidden {
    display: none !important;
}

.platform-container.platform-disabled,
.platform-tab-btn.platform-disabled {
    display: none !important;
}

/* Theme Shopee */
.platform-container.theme-shopee {
    border-color: rgba(238, 77, 45, 0.3);
    background: linear-gradient(145deg, rgba(238, 77, 45, 0.05) 0%, rgba(30, 41, 59, 0.8) 100%);
    box-shadow: 0 14px 40px -10px rgba(238, 77, 45, 0.15);
}

.platform-container.theme-shopee:hover {
    border-color: rgba(238, 77, 45, 0.5);
}

/* Theme Mercado Livre */
.platform-container.theme-mercadolivre {
    border-color: rgba(255, 230, 0, 0.28);
    background: linear-gradient(145deg, rgba(255, 230, 0, 0.04) 0%, rgba(30, 41, 59, 0.8) 100%);
    box-shadow: 0 14px 40px -10px rgba(255, 230, 0, 0.12);
}

.platform-container.theme-mercadolivre:hover {
    border-color: rgba(255, 230, 0, 0.48);
}

/* Theme Amazon */
.platform-container.theme-amazon {
    border-color: rgba(255, 153, 0, 0.3);
    background: linear-gradient(145deg, rgba(255, 153, 0, 0.05) 0%, rgba(30, 41, 59, 0.8) 100%);
    box-shadow: 0 14px 40px -10px rgba(255, 153, 0, 0.14);
}

.platform-container.theme-amazon:hover {
    border-color: rgba(255, 153, 0, 0.5);
}

/* Theme WhatsApp */
.platform-container.theme-whatsapp {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.04) 0%, rgba(30, 41, 59, 0.8) 100%);
    box-shadow: 0 14px 40px -10px rgba(16, 185, 129, 0.12);
}

.platform-container.theme-whatsapp:hover {
    border-color: rgba(16, 185, 129, 0.5);
}

/* ================= PLATFORM HEADER ================= */
.platform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.platform-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.platform-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.platform-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.platform-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* ================= INTERNAL SUBGRIDS & SUBCARDS ================= */
.platform-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.platform-subcard {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.35rem;
    transition: var(--transition);
}

.platform-subcard:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.14);
}

.platform-subcard-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.platform-subcard-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

/* ================= PLATFORM FOOTER ACTIONS ================= */
.platform-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-footer-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================= BRANDED BUTTONS ================= */
.btn-save-shopee {
    background: linear-gradient(135deg, #ee4d2d 0%, #c93618 100%);
    box-shadow: 0 4px 15px rgba(238, 77, 45, 0.35);
    color: #fff;
}
.btn-save-shopee:hover {
    background: linear-gradient(135deg, #ff5733 0%, #ee4d2d 100%);
    box-shadow: 0 6px 20px rgba(238, 77, 45, 0.45);
}

.btn-save-ml {
    background: linear-gradient(135deg, #ffe600 0%, #e5cf00 100%);
    color: #111827;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 230, 0, 0.3);
}
.btn-save-ml:hover {
    background: linear-gradient(135deg, #fff033 0%, #ffe600 100%);
    box-shadow: 0 6px 20px rgba(255, 230, 0, 0.45);
}

.btn-save-amazon {
    background: linear-gradient(135deg, #ff9900 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.35);
    color: #fff;
}
.btn-save-amazon:hover {
    background: linear-gradient(135deg, #ffa826 0%, #ff9900 100%);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.45);
}

.btn-save-whatsapp {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
    color: #fff;
}
.btn-save-whatsapp:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ================= GLOBAL FLOATING / BOTTOM BAR ================= */
.global-save-card {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .platform-container {
        padding: 1.25rem;
        border-radius: 16px;
    }
    .platform-grid-2col {
        grid-template-columns: 1fr;
    }
    .platform-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .platform-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .global-save-card {
        flex-direction: column;
        text-align: center;
    }
    .global-save-card .btn-primary {
        width: 100%;
    }
}


