/* ============================================
   BZPChat - Sistema de Temas
   Múltiplos temas personalizáveis
   ============================================ */

/* ── TEMA 1: Teams Dark (Padrão) ──────────── */
[data-theme="teams-dark"],
:root:not([data-theme]) {
    /* Primary colors */
    --gc-primary: #6264A7;
    --gc-primary-light: #7B7FBF;
    --gc-primary-dark: #4B4D8F;
    --gc-primary-glow: rgba(98, 100, 167, 0.3);

    /* Accent colors */
    --gc-accent: #8B5CF6;
    --gc-accent-light: #A78BFA;
    --gc-success: #10B981;
    --gc-warning: #F59E0B;
    --gc-danger: #EF4444;
    --gc-info: #3B82F6;

    /* Background tiers */
    --gc-bg-deepest: #1a1a2e;
    --gc-bg-deep: #1e1e3a;
    --gc-bg-base: #242448;
    --gc-bg-surface: #2a2a50;
    --gc-bg-elevated: #32325e;
    --gc-bg-hover: #3a3a6a;
    --gc-bg-active: #44447a;

    /* Text */
    --gc-text-primary: #e8e8f0;
    --gc-text-secondary: #a0a0c0;
    --gc-text-muted: #6e6e90;
    --gc-text-bright: #ffffff;

    /* Borders */
    --gc-border: rgba(255, 255, 255, 0.08);
    --gc-border-hover: rgba(255, 255, 255, 0.15);
    --gc-border-active: rgba(98, 100, 167, 0.5);

    /* Glassmorphism */
    --gc-glass-bg: rgba(36, 36, 72, 0.85);
    --gc-glass-border: rgba(255, 255, 255, 0.1);
    --gc-glass-blur: 20px;

    /* Shadows */
    --gc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --gc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --gc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── TEMA 2: WhatsApp Light ──────────────── */
[data-theme="whatsapp-light"] {
    /* Primary colors */
    --gc-primary: #25D366;
    --gc-primary-light: #4ADE80;
    --gc-primary-dark: #1DA851;
    --gc-primary-glow: rgba(37, 211, 102, 0.3);

    /* Accent colors */
    --gc-accent: #128C7E;
    --gc-accent-light: #16A085;
    --gc-success: #25D366;
    --gc-warning: #F59E0B;
    --gc-danger: #DC2626;
    --gc-info: #0EA5E9;

    /* Background tiers */
    --gc-bg-deepest: #e9edef;
    --gc-bg-deep: #f0f2f5;
    --gc-bg-base: #ffffff;
    --gc-bg-surface: #ffffff;
    --gc-bg-elevated: #ffffff;
    --gc-bg-hover: #f5f6f6;
    --gc-bg-active: #e9edef;

    /* Text */
    --gc-text-primary: #111b21;
    --gc-text-secondary: #667781;
    --gc-text-muted: #8696a0;
    --gc-text-bright: #000000;

    /* Borders */
    --gc-border: rgba(17, 27, 33, 0.08);
    --gc-border-hover: rgba(17, 27, 33, 0.15);
    --gc-border-active: rgba(37, 211, 102, 0.5);

    /* Glassmorphism */
    --gc-glass-bg: rgba(255, 255, 255, 0.95);
    --gc-glass-border: rgba(17, 27, 33, 0.1);
    --gc-glass-blur: 20px;

    /* Shadows */
    --gc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --gc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --gc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* ── TEMA 3: WhatsApp Dark ──────────────── */
[data-theme="whatsapp-dark"] {
    /* Primary colors */
    --gc-primary: #00a884;
    --gc-primary-light: #26d367;
    --gc-primary-dark: #008069;
    --gc-primary-glow: rgba(0, 168, 132, 0.3);

    /* Accent colors */
    --gc-accent: #00a884;
    --gc-accent-light: #26d367;
    --gc-success: #00a884;
    --gc-warning: #F59E0B;
    --gc-danger: #DC2626;
    --gc-info: #0EA5E9;

    /* Background tiers */
    --gc-bg-deepest: #0b141a;
    --gc-bg-deep: #111b21;
    --gc-bg-base: #202c33;
    --gc-bg-surface: #2a3942;
    --gc-bg-elevated: #2e3b43;
    --gc-bg-hover: #323d45;
    --gc-bg-active: #364047;

    /* Text */
    --gc-text-primary: #e9edef;
    --gc-text-secondary: #8696a0;
    --gc-text-muted: #667781;
    --gc-text-bright: #ffffff;

    /* Borders */
    --gc-border: rgba(233, 237, 239, 0.08);
    --gc-border-hover: rgba(233, 237, 239, 0.15);
    --gc-border-active: rgba(0, 168, 132, 0.5);

    /* Glassmorphism */
    --gc-glass-bg: rgba(32, 44, 51, 0.85);
    --gc-glass-border: rgba(233, 237, 239, 0.1);
    --gc-glass-blur: 20px;

    /* Shadows */
    --gc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --gc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --gc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* ── TEMA 4: Ocean Blue ──────────────── */
[data-theme="ocean-blue"] {
    /* Primary colors */
    --gc-primary: #0ea5e9;
    --gc-primary-light: #38bdf8;
    --gc-primary-dark: #0284c7;
    --gc-primary-glow: rgba(14, 165, 233, 0.3);

    /* Accent colors */
    --gc-accent: #06b6d4;
    --gc-accent-light: #22d3ee;
    --gc-success: #10B981;
    --gc-warning: #F59E0B;
    --gc-danger: #EF4444;
    --gc-info: #3B82F6;

    /* Background tiers */
    --gc-bg-deepest: #0c1821;
    --gc-bg-deep: #0f2027;
    --gc-bg-base: #134e6a;
    --gc-bg-surface: #1a5f7a;
    --gc-bg-elevated: #1f6f8b;
    --gc-bg-hover: #24789a;
    --gc-bg-active: #2a86a8;

    /* Text */
    --gc-text-primary: #e0f2fe;
    --gc-text-secondary: #bae6fd;
    --gc-text-muted: #7dd3fc;
    --gc-text-bright: #ffffff;

    /* Borders */
    --gc-border: rgba(224, 242, 254, 0.08);
    --gc-border-hover: rgba(224, 242, 254, 0.15);
    --gc-border-active: rgba(14, 165, 233, 0.5);

    /* Glassmorphism */
    --gc-glass-bg: rgba(19, 78, 106, 0.85);
    --gc-glass-border: rgba(224, 242, 254, 0.1);
    --gc-glass-blur: 20px;

    /* Shadows */
    --gc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --gc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --gc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── TEMA 5: Rose Light ──────────────── */
[data-theme="rose-light"] {
    /* Primary colors */
    --gc-primary: #e11d48;
    --gc-primary-light: #f43f5e;
    --gc-primary-dark: #be123c;
    --gc-primary-glow: rgba(225, 29, 72, 0.2);

    /* Accent colors */
    --gc-accent: #ec4899;
    --gc-accent-light: #f472b6;
    --gc-success: #10B981;
    --gc-warning: #F59E0B;
    --gc-danger: #DC2626;
    --gc-info: #3B82F6;

    /* Background tiers */
    --gc-bg-deepest: #fef2f2;
    --gc-bg-deep: #fff1f2;
    --gc-bg-base: #ffffff;
    --gc-bg-surface: #ffffff;
    --gc-bg-elevated: #fffbfb;
    --gc-bg-hover: #fef2f3;
    --gc-bg-active: #fce7e9;

    /* Text */
    --gc-text-primary: #0f172a;
    --gc-text-secondary: #475569;
    --gc-text-muted: #64748b;
    --gc-text-bright: #000000;

    /* Borders */
    --gc-border: rgba(15, 23, 42, 0.08);
    --gc-border-hover: rgba(15, 23, 42, 0.15);
    --gc-border-active: rgba(225, 29, 72, 0.5);

    /* Glassmorphism */
    --gc-glass-bg: rgba(255, 255, 255, 0.95);
    --gc-glass-border: rgba(15, 23, 42, 0.1);
    --gc-glass-blur: 20px;

    /* Shadows */
    --gc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --gc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --gc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* ── TEMA 6: Sunset Purple ──────────────── */
[data-theme="sunset-purple"] {
    /* Primary colors */
    --gc-primary: #c026d3;
    --gc-primary-light: #d946ef;
    --gc-primary-dark: #a21caf;
    --gc-primary-glow: rgba(192, 38, 211, 0.3);

    /* Accent colors */
    --gc-accent: #e879f9;
    --gc-accent-light: #f0abfc;
    --gc-success: #10B981;
    --gc-warning: #F59E0B;
    --gc-danger: #EF4444;
    --gc-info: #3B82F6;

    /* Background tiers */
    --gc-bg-deepest: #1e0a1f;
    --gc-bg-deep: #2d1530;
    --gc-bg-base: #3f1d47;
    --gc-bg-surface: #4d2455;
    --gc-bg-elevated: #5b2b63;
    --gc-bg-hover: #693271;
    --gc-bg-active: #77397f;

    /* Text */
    --gc-text-primary: #fae8ff;
    --gc-text-secondary: #f5d0fe;
    --gc-text-muted: #e9a9f5;
    --gc-text-bright: #ffffff;

    /* Borders */
    --gc-border: rgba(250, 232, 255, 0.08);
    --gc-border-hover: rgba(250, 232, 255, 0.15);
    --gc-border-active: rgba(192, 38, 211, 0.5);

    /* Glassmorphism */
    --gc-glass-bg: rgba(63, 29, 71, 0.85);
    --gc-glass-border: rgba(250, 232, 255, 0.1);
    --gc-glass-blur: 20px;

    /* Shadows */
    --gc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --gc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --gc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── Estilos do Modal de Temas ──────────── */
.theme-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.theme-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.theme-modal-content {
    background: var(--gc-bg-elevated);
    border: 1px solid var(--gc-border);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--gc-shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: scale(0.95) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.theme-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gc-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-modal-close {
    background: transparent;
    border: none;
    color: var(--gc-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all var(--gc-transition);
    line-height: 1;
}

.theme-modal-close:hover {
    background: var(--gc-bg-hover);
    color: var(--gc-text-primary);
}

.theme-modal-body {
    padding: 1.5rem;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.theme-option {
    background: var(--gc-bg-surface);
    border: 2px solid var(--gc-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all var(--gc-transition);
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    border-color: var(--gc-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--gc-shadow-md);
}

.theme-option.active {
    border-color: var(--gc-primary);
    background: var(--gc-bg-hover);
}

.theme-option.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: var(--gc-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.theme-name {
    font-weight: 600;
    color: var(--gc-text-primary);
    margin-bottom: 0.5rem;
}

.theme-description {
    font-size: 0.875rem;
    color: var(--gc-text-secondary);
    margin-bottom: 1rem;
}

.theme-preview {
    display: flex;
    gap: 0.5rem;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.theme-preview-color {
    flex: 1;
}
