/* Design System Minimalista & Ultra-Dark */
:root {
    --bg-dark: #000000;
    --bg-surface: #0b0c10;
    --bg-surface-hover: #12131a;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-focus: rgba(255, 255, 255, 0.15);
    
    --text-primary: #ffffff;
    --text-secondary: #8e929f;
    --text-muted: #4e5058;
    
    --primary: #ffffff;
    --primary-hover: #e0e0e0;
    
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.06);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.06);
    --blue: #60a5fa;
    --blue-bg: rgba(96, 165, 250, 0.06);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.06);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

/* Reset Geral */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-y: auto;
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

body::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
}

/* Container Centralizado */
.app-wrapper {
    width: 100%;
    max-width: 660px; /* Largura central fixa premium */
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header Minimalista */
.app-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

.brand h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-settings-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    transition: var(--transition);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.btn-settings-icon:hover {
    color: var(--text-primary);
    background: var(--border-color);
    transform: rotate(30deg);
}

/* Barra Horizontal de Perfis */
.profiles-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: none;
    padding-top: 0;
    gap: 12px;
}

.profiles-bar-list {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
}

.profiles-bar-list::-webkit-scrollbar {
    display: none; /* Ocultar barra de rolagem */
}

/* Avatar do seletor horizontal */
.profile-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}

.profile-bar-item:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.02);
}

.profile-bar-item.active {
    background: rgba(255,255,255,0.06);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.profile-bar-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-color);
}

.btn-add-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-circle:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.02);
}

/* Main Flow Container */
.main-flow {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Shimmer Loading Circles */
.loading-shimmer-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.loading-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State Minimalista */
.empty-state {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-icon {
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
}

.empty-state h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
    max-width: 440px;
}

.empty-actions {
    display: flex;
    gap: 10px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.04);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    padding: 10px;
    border-radius: var(--radius-md);
    display: flex;
}

.btn-danger-outline:hover {
    background: var(--danger-bg);
    border-color: rgba(248, 113, 113, 0.2);
}

.btn-icon-only {
    padding: 10px;
}

/* Card Detalhes do Perfil */
.profile-meta-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.profile-info-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    object-fit: cover;
    background: var(--border-color);
}

.profile-meta-text {
    display: flex;
    flex-direction: column;
}

.username-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.username-row h2 {
    font-size: 18px;
    font-weight: 700;
}

.instagram-link {
    color: var(--text-secondary);
    display: flex;
    transition: var(--transition);
}
.instagram-link:hover {
    color: var(--text-primary);
}

.profile-meta-text p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 2px 0 6px 0;
}

.badge {
    font-size: 10.5px;
    color: var(--text-muted);
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Barra de Estatísticas */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 0;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-right: none;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    margin: 4px 0;
}

.stat-change {
    font-size: 11px;
    color: var(--text-muted);
}

/* Card Principal de Comparações */
.comparison-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.comparison-header {
    margin-bottom: 20px;
}

.comparison-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.comparison-subtitle {
    font-size: 11.5px;
    color: var(--text-secondary);
}

/* Grade de Resumo */
.changes-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.summary-item {
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    transition: var(--transition);
}

.summary-item.gained:hover { background: var(--success-bg); }
.summary-item.lost:hover { background: var(--danger-bg); }
.summary-item.following-gained:hover { background: var(--blue-bg); }
.summary-item.following-lost:hover { background: var(--warning-bg); }

.summary-number {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 2px;
}

.summary-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-item.gained { color: var(--success); }
.summary-item.lost { color: var(--danger); }
.summary-item.following-gained { color: var(--blue); }
.summary-item.following-lost { color: var(--warning); }

/* Abas */
.tabs-header {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tabs-header::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.tabs-content {
    padding-top: 16px;
}

.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* Listas de Usuários */
.users-list {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.users-list::-webkit-scrollbar {
    width: 3px;
}
.users-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.users-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.users-list-item:last-child {
    border-bottom: none;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    object-fit: cover;
    background: var(--border-color);
}

.user-name-col {
    display: flex;
    flex-direction: column;
}

.user-username {
    font-size: 13px;
    font-weight: 600;
}

.user-fullname {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.btn-visit {
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.btn-visit:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.02);
}

.empty-tab-message {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Divisão de Listas Completas */
.all-lists-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.list-column {
    display: flex;
    flex-direction: column;
    height: 320px;
}

.list-column h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.input-search {
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 12px;
    outline: none;
    margin-bottom: 8px;
}
.input-search:focus {
    border-color: var(--border-color-focus);
}

.users-list.compact {
    flex: 1;
}

/* Histórico / Timeline */
.history-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.history-card h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}

.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 16px;
    cursor: pointer;
}
.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid var(--text-secondary);
    transition: var(--transition);
}

.timeline-item.active .timeline-marker,
.timeline-item:hover .timeline-marker {
    border-color: var(--text-primary);
    background: var(--text-primary);
}

.timeline-content {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-item.active .timeline-content,
.timeline-item:hover .timeline-content {
    background: rgba(255,255,255,0.02);
}

.timeline-time {
    font-size: 12.5px;
    font-weight: 500;
}

.timeline-details {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.t-change-badge {
    display: flex;
    align-items: center;
    gap: 2px;
}
.t-gained { color: var(--success); }
.t-lost { color: var(--danger); }

/* Modais */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 15px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.help-text {
    display: block;
    font-size: 10px;
    margin-top: 2px;
}

.input-icon-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.input-icon-prefix {
    padding-left: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    outline: none;
}

.input-icon-wrapper input {
    border: none;
    background: transparent;
}

.form-group input:focus {
    border-color: var(--border-color-focus);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1100;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 300px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--blue); }

.hidden {
    display: none !important;
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* Ocultação solicitada pelo usuário (Branding Minimalista & Invisibilidade da Configuração) */
.brand-row,
.history-card,
#btn-empty-settings {
    display: none !important;
}

/* Espaçamento vertical real entre os cards do perfil selecionado */
.profile-details-view {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
