/* ===========================
   DESIGN SYSTEM & VARIABLES
   =========================== */

:root {
    /* Colors */
    --primary: #8256FF;
    --primary-hover: #6D3EFF;
    --text-primary: #FFFFFF;
    --text-secondary: #C7C7D1;
    --accent: #FF7CA3;
    --card-bg: #16161A;
    --divider: #23232A;
    --success: #5BE38F;
    --warning: #F4C95D;
    --error: #FF6363;
    --bg-dark: #0D0D0F;
    --bg-secondary: #121215;
    --border-color: #3A3A42;
    
    /* Typography */
    --font-display: 'Inter Tight', sans-serif;
    --font-text: 'Inter', sans-serif;
    
    /* Spacing */
    --gutter: 24px;
    --sidebar-width: 280px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-primary: 0px 8px 20px rgba(130, 86, 255, 0.25);
    --shadow-card: 0px 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0px 12px 32px rgba(0, 0, 0, 0.4);
}

/* ===========================
   RESET & BASE STYLES
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    min-height: 100vh;
}

/* ===========================
   SIDEBAR
   =========================== */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(130, 86, 255, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: var(--text-primary);
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-plan {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-plan.plan-plus {
    color: var(--primary);
    font-weight: 600;
}

.user-plan.plan-session {
    color: var(--success);
    font-weight: 500;
}

.btn-logout {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: rgba(255, 99, 99, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* ===========================
   MAIN CONTENT
   =========================== */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px 48px;
    overflow-y: auto;
    max-width: 1600px;
}

/* ===========================
   DASHBOARD HEADER
   =========================== */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-display);
    margin-bottom: 4px;
}

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

/* ===========================
   BUTTONS
   =========================== */

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0px 12px 28px rgba(130, 86, 255, 0.35);
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===========================
   STATS SECTION
   =========================== */

.stats-section {
    margin-bottom: 48px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-primary {
    background-color: rgba(130, 86, 255, 0.15);
    color: var(--primary);
}

.stat-icon-success {
    background-color: rgba(91, 227, 143, 0.15);
    color: var(--success);
}

.stat-icon-accent {
    background-color: rgba(255, 124, 163, 0.15);
    color: var(--accent);
}

.stat-icon-warning {
    background-color: rgba(244, 201, 93, 0.15);
    color: var(--warning);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-primary);
}

/* ===========================
   SECTIONS
   =========================== */

.conversations-section,
.quick-actions-section,
.activity-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.link-view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.link-view-all:hover {
    color: var(--primary-hover);
}

/* ===========================
   CONVERSATIONS GRID
   =========================== */

.conversations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.conversation-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.conversation-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.conversation-card.card-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(130, 86, 255, 0.05) 0%, rgba(255, 124, 163, 0.05) 100%);
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    color: white;
    line-height: 1;
    text-align: center;
}

.conversation-info {
    flex: 1;
}

.conversation-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.conversation-status {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
}

.conversation-status.status-active {
    background-color: rgba(91, 227, 143, 0.15);
    color: var(--success);
}

.btn-menu {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-menu:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.conversation-preview {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conversation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.conversation-time {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===========================
   QUICK ACTIONS
   =========================== */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.action-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.action-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background-color: rgba(130, 86, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.action-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ===========================
   ACTIVITY TIMELINE
   =========================== */

.activity-timeline {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    position: relative;
}

.activity-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 40px;
    bottom: -16px;
    width: 2px;
    background-color: var(--border-color);
}

.activity-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.activity-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.activity-empty p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.activity-empty span {
    font-size: 14px;
    opacity: 0.7;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .main-content {
        padding: 32px 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .conversations-filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .conversations-filters {
        flex-wrap: wrap;
    }
    
    .conversations-filters-container .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .conversations-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
}

.stat-card,
.conversation-card,
.action-card {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.conversation-card:nth-child(1) { animation-delay: 0.1s; }
.conversation-card:nth-child(2) { animation-delay: 0.2s; }
.conversation-card:nth-child(3) { animation-delay: 0.3s; }

/* ===========================
   WELCOME NOTIFICATION
   =========================== */

.welcome-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    color: var(--text-primary);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.welcome-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.welcome-icon {
    font-size: 32px;
    line-height: 1;
}

.welcome-content h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-content p {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .welcome-notification {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* ===========================
   CONTENT SECTIONS
   =========================== */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ===========================
   SEARCH BOX
   =========================== */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    gap: 10px;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.search-box svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-text);
    font-size: 14px;
    outline: none;
    width: 240px;
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(130, 86, 255, 0.1);
}

/* ===========================
   CONVERSATIONS FILTERS
   =========================== */

.conversations-filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--divider);
}

.conversations-filters-container .search-box {
    margin-right: 0;
}

.conversations-filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(130, 86, 255, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(130, 86, 255, 0.2);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
}

.filter-btn.active .filter-count {
    background: var(--primary);
    color: white;
}

/* ===========================
   ALL CONVERSATIONS CONTAINER
   =========================== */

.all-conversations-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.all-conversations-container .conversation-card {
    margin-bottom: 0;
}

/* Empty state */
.conversations-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.conversations-empty svg {
    margin: 0 auto 20px;
    opacity: 0.3;
}

.conversations-empty h3 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.conversations-empty p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===========================
   MINHAS CONEXÕES SECTION
   =========================== */

.connections-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.connection-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.connection-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.connection-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.connection-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.connection-info {
    flex: 1;
    min-width: 0;
}

.connection-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.connection-relationship {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.connection-relationship svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.connection-stats {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    margin-bottom: 16px;
}

.connection-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.connection-stat-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.connection-conversations {
    margin-bottom: 16px;
}

.connection-conversations-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.connection-conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.connection-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-conversation-item:hover {
    background: rgba(130, 86, 255, 0.1);
}

.connection-conversation-date {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.connection-conversation-messages {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.connection-conversation-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.connection-conversation-status.inactive {
    background: var(--text-secondary);
}

.connection-actions {
    display: flex;
    gap: 12px;
}

.connection-actions .btn {
    flex: 1;
    justify-content: center;
}

.btn-new-conversation {
    background: var(--primary);
    border: none;
    color: white;
}

.btn-new-conversation:hover {
    background: var(--primary-hover);
}

.btn-view-history {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-view-history:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Connection empty state */
.connections-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.connections-empty svg {
    margin: 0 auto 24px;
    opacity: 0.3;
}

.connections-empty h3 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.connections-empty p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Connection notes */
.connection-notes {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
}

/* Connection no conversations state */
.connection-no-conversations {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.connection-no-conversations p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Connection menu button */
.btn-connection-menu {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-connection-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ===========================
   MODAL STYLES
   =========================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--divider);
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(130, 86, 255, 0.05);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C7C7D1' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

/* Context menu for connections */
.connection-context-menu {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.connection-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-context-menu-item:hover {
    background: rgba(130, 86, 255, 0.1);
    color: var(--text-primary);
}

.connection-context-menu-item.danger {
    color: var(--error);
}

.connection-context-menu-item.danger:hover {
    background: rgba(255, 99, 99, 0.1);
}

/* ===========================
   CONVERSATIONS CONTEXT MENU
   =========================== */

.context-menu {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background: rgba(130, 86, 255, 0.1);
    color: var(--text-primary);
}

.context-menu-item-archive {
    color: var(--accent);
}

.context-menu-item-archive:hover {
    background: rgba(130, 86, 255, 0.15);
    color: var(--accent);
}

.context-menu-item-danger {
    color: var(--error);
}

.context-menu-item-danger:hover {
    background: rgba(255, 99, 99, 0.1);
}

/* ===========================
   ARCHIVED TOGGLE BUTTON
   =========================== */

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-archived-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-archived-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(130, 86, 255, 0.05);
}

.btn-archived-toggle.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-archived-toggle svg {
    width: 16px;
    height: 16px;
}

/* ===========================
   TOAST NOTIFICATION
   =========================== */

.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification svg {
    color: var(--success);
    flex-shrink: 0;
}

/* ===========================
   ARCHIVED ITEMS SECTION (Settings)
   =========================== */

.archived-items-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.archived-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.archived-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.archived-count {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-secondary);
}

.archived-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.archived-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding: 12px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 0;
}

.archived-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.archived-item:hover {
    border-color: var(--accent);
    background: rgba(130, 86, 255, 0.05);
}

.archived-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.archived-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.archived-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archived-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-unarchive {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-unarchive:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-unarchive svg {
    display: block;
}

/* Connection context menu archive item */
.connection-context-menu-item.archive {
    color: var(--accent);
}

.connection-context-menu-item.archive:hover {
    background: rgba(130, 86, 255, 0.15);
}

/* ===========================
   PROFILE SECTION STYLES
   =========================== */

.profile-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 700px;
}

.profile-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
}

.profile-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Profile Avatar Section */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-avatar-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(130, 86, 255, 0.15);
    color: var(--primary);
}

.profile-badge.premium {
    background: linear-gradient(135deg, rgba(130, 86, 255, 0.2) 0%, rgba(255, 124, 163, 0.2) 100%);
    color: var(--secondary);
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-form-group input {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.profile-form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(130, 86, 255, 0.1);
}

.profile-form-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-form-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.profile-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.profile-message.success {
    display: block;
    background: rgba(0, 200, 83, 0.1);
    color: #00c853;
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.profile-message.error {
    display: block;
    background: rgba(255, 99, 99, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 99, 99, 0.2);
}

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.profile-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* Danger Zone */
.profile-danger-zone {
    border-color: rgba(255, 99, 99, 0.3);
}

.profile-danger-zone .profile-card-title {
    color: var(--error);
}

.profile-danger-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.profile-danger-actions {
    display: flex;
    gap: 12px;
}

.btn-danger-outline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-outline:hover {
    background: rgba(255, 99, 99, 0.1);
}

/* Google Notice */
.profile-google-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(66, 133, 244, 0.1);
    border: 1px solid rgba(66, 133, 244, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-google-notice svg {
    flex-shrink: 0;
    color: #4285F4;
}

/* Responsive Profile */
@media (max-width: 768px) {
    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================
   SETTINGS SECTION STYLES
   =========================== */

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
}

.settings-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.settings-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(130, 86, 255, 0.15) 0%, rgba(255, 124, 163, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.settings-card-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-card-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.settings-card-content {
    padding: 20px 24px;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.settings-option:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-option:first-child {
    padding-top: 0;
}

.settings-option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-option-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-option-description {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-option-control {
    flex-shrink: 0;
}

/* Settings Select */
.settings-select {
    padding: 8px 32px 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.settings-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Settings Toggle */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.settings-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.settings-toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Subscription Settings */
.settings-subscription-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.settings-plan-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(130, 86, 255, 0.15);
    color: var(--primary);
}

.settings-plan-badge.premium {
    background: linear-gradient(135deg, rgba(130, 86, 255, 0.2) 0%, rgba(255, 124, 163, 0.2) 100%);
    color: var(--secondary);
}

.settings-plan-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.settings-subscription-actions {
    display: flex;
    gap: 12px;
}

/* About Settings */
.settings-about {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-about-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.settings-about-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.settings-about-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-about-links {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.settings-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.settings-link:hover {
    color: var(--secondary);
}

/* Settings Danger Zone */
.settings-danger-card {
    border-color: rgba(255, 99, 99, 0.3);
}

.settings-danger-card .settings-card-header {
    border-bottom-color: rgba(255, 99, 99, 0.2);
}

.settings-danger-icon {
    background: rgba(255, 99, 99, 0.15) !important;
    color: var(--error) !important;
}

.settings-danger-title {
    color: var(--error) !important;
}

.settings-danger-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 99, 99, 0.08);
    border: 1px solid rgba(255, 99, 99, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
}

.settings-danger-warning svg {
    flex-shrink: 0;
    color: var(--error);
    margin-top: 2px;
}

.settings-danger-warning p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-danger-actions {
    display: flex;
    gap: 12px;
}

.btn-danger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--error);
    border: none;
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #e55555;
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Responsive Settings */
@media (max-width: 768px) {
    .settings-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .settings-subscription-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .settings-subscription-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .settings-subscription-actions .btn {
        width: 100%;
    }
    
    .settings-about-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .settings-danger-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .settings-danger-actions .btn-danger {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   LOADING STATES
   =========================== */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.loading-state p {
    font-size: 14px;
    opacity: 0.7;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--divider);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* ===========================
   LOGOUT CONFIRMATION MODAL
   =========================== */

.logout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.logout-modal.active {
    opacity: 1;
    visibility: visible;
}

.logout-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.logout-modal-content {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.logout-modal.active .logout-modal-content {
    transform: scale(1) translateY(0);
}

.logout-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(255, 99, 99, 0.15) 0%, rgba(255, 124, 163, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
}

.logout-modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.logout-modal-actions {
    display: flex;
    gap: 12px;
}

.logout-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.logout-modal-btn-cancel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.logout-modal-btn-cancel:hover {
    background: var(--divider);
    border-color: var(--text-secondary);
}

.logout-modal-btn-confirm {
    background: var(--error);
    color: white;
}

.logout-modal-btn-confirm:hover {
    background: #ff4d4d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 99, 99, 0.3);
}

/* ===========================
   DELETE CONVERSATION MODAL (same style as logout)
   =========================== */

.delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.delete-modal.active {
    opacity: 1;
    visibility: visible;
}

.delete-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.delete-modal-content {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.delete-modal.active .delete-modal-content {
    transform: scale(1) translateY(0);
}

.delete-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(255, 99, 99, 0.15) 0%, rgba(255, 124, 163, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
}

.delete-modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.delete-modal-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.delete-modal-details-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.delete-modal-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.delete-modal-detail-item:last-child {
    margin-bottom: 0;
}

.delete-modal-detail-item svg {
    width: 16px;
    height: 16px;
    color: var(--error);
    flex-shrink: 0;
}

.delete-modal-actions {
    display: flex;
    gap: 12px;
}

.delete-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.delete-modal-btn-cancel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.delete-modal-btn-cancel:hover {
    background: var(--divider);
    border-color: var(--text-secondary);
}

.delete-modal-btn-confirm {
    background: var(--error);
    color: white;
}

.delete-modal-btn-confirm:hover {
    background: #ff4d4d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 99, 99, 0.3);
}

/* Warning banner for account deletion */
.delete-modal-warning {
    background: rgba(255, 99, 99, 0.1);
    border: 1px solid rgba(255, 99, 99, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.delete-modal-warning svg {
    flex-shrink: 0;
    color: var(--error);
}

.delete-modal-warning-text {
    font-size: 13px;
    color: #ffb4b4;
    line-height: 1.5;
}

/* Input modal field */
.input-modal-field {
    margin: 20px 0;
}

.input-modal-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-text);
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

.input-modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(130, 86, 255, 0.2);
}

.input-modal-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input-modal-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 99, 99, 0.1);
    border-radius: 6px;
    color: var(--error);
    font-size: 13px;
}

/* ===========================
   PAYWALL MODAL
   =========================== */

.paywall-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.paywall-overlay.active {
    opacity: 1;
    visibility: visible;
}

.paywall-modal {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    max-width: 700px;
    width: 100%;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.paywall-overlay.active .paywall-modal {
    transform: scale(1);
}

.paywall-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.paywall-close:hover {
    background: rgba(255, 99, 99, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.paywall-icon {
    text-align: center;
    margin-bottom: 24px;
}

.paywall-icon svg {
    filter: drop-shadow(0 4px 20px rgba(130, 86, 255, 0.4));
}

.paywall-title {
    font-family: var(--font-display);
    font-size: 28px;
    text-align: center;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.paywall-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.paywall-description strong {
    color: var(--primary);
}

.paywall-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.paywall-plan {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.paywall-plan:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.paywall-plan-featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(130, 86, 255, 0.1) 0%, rgba(255, 124, 163, 0.05) 100%);
}

.paywall-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paywall-plan-header {
    text-align: center;
    margin-bottom: 20px;
}

.paywall-plan-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.paywall-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.paywall-price .price-currency {
    font-size: 18px;
    color: var(--text-secondary);
    margin-right: 2px;
}

.paywall-price .price-amount {
    font-size: 40px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.paywall-price .price-period {
    font-size: 16px;
    color: var(--text-secondary);
}

.paywall-features {
    list-style: none;
    margin-bottom: 24px;
}

.paywall-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.paywall-btn {
    width: 100%;
    height: 48px;
    font-size: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.paywall-btn.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-primary);
}

.paywall-btn.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.paywall-btn.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.paywall-btn.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(130, 86, 255, 0.1);
}

.paywall-guarantee {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Paywall responsive */
@media (max-width: 600px) {
    .paywall-modal {
        padding: 24px;
    }
    
    .paywall-plans {
        grid-template-columns: 1fr;
    }
    
    .paywall-title {
        font-size: 24px;
    }
    
    .paywall-price .price-amount {
        font-size: 32px;
    }
}