/**
 * NEXUS AI COMMUNICATION HUB | EXECUTIVE SOVEREIGN CSS
 * Dedicated Interface for Intelligence Dispatch & Professional Response.
 * Independent from global utilities.
 */

:root {
    --nx-comm-bg: #09090B;
    --nx-comm-surface: #121217;
    --nx-comm-border: rgba(255, 255, 255, 0.08);
    --nx-comm-accent: #F59E0B;
    --nx-comm-text-main: #E2E8F0;
    --nx-comm-text-dim: #94A3B8;
    --nx-comm-radius: 8px;
}

/* 1. OVERLAY & CONTAINER */
.nx-comm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nx-comm-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.nx-comm-container {
    background: var(--nx-comm-bg);
    border: 1px solid var(--nx-comm-border);
    border-radius: var(--nx-comm-radius);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 95%;
    max-height: 90vh;
    animation: nxCommSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.nx-comm-sm { width: 450px; }
.nx-comm-md { width: 650px; }
.nx-comm-lg { width: 950px; }

/* 2. HEADER */
.nx-comm-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--nx-comm-border);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.nx-comm-icon-wrap {
    width: 32px;
    height: 32px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--nx-comm-accent);
}

.nx-comm-icon-wrap svg { width: 18px; height: 18px; }

.nx-comm-title {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #F8FAFC;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nx-comm-close {
    background: none;
    border: none;
    color: var(--nx-comm-text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.nx-comm-close:hover { color: #fff; transform: scale(1.1); }

/* 3. LAYOUT (Two Column) */
.nx-comm-two-column {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    min-height: 500px;
}

.nx-comm-sidebar {
    background: rgba(255, 255, 255, 0.015);
    border-right: 1px solid var(--nx-comm-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nx-comm-main-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* 4. COMPONENTS */
.nx-comm-insight-card {
    background: var(--nx-comm-surface);
    border: 1px solid var(--nx-comm-border);
    border-radius: 6px;
    padding: 15px;
}

.nx-comm-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--nx-comm-accent);
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-transform: uppercase;
    opacity: 0.8;
}

.nx-comm-message-box {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--nx-comm-text-main);
    max-height: 150px;
    overflow-y: auto;
}

/* Tone Selector */
.nx-comm-tone-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nx-comm-tone-btn {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nx-comm-border);
    border-radius: 6px;
    color: var(--nx-comm-text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nx-comm-tone-btn i, .nx-comm-tone-btn svg { width: 16px; height: 16px; opacity: 0.6; }

.nx-comm-tone-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nx-comm-tone-btn.is-active {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--nx-comm-accent);
}

.nx-comm-tone-btn.is-active i, .nx-comm-tone-btn.is-active svg { opacity: 1; }

/* Textarea & Editor Area */
.nx-comm-textarea {
    width: 100%;
    background: #0F172A;
    border: 1px solid var(--nx-comm-border);
    border-radius: 6px;
    color: #CBD5E1;
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    resize: none;
    flex: 1;
    outline: none;
    transition: border-color 0.3s;
}

.nx-comm-textarea:focus { border-color: rgba(245, 158, 11, 0.5); }

/* Footer Actions */
.nx-comm-footer-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.nx-comm-btn-execute {
    background: #F8FAFC;
    color: #0F172A;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nx-comm-btn-execute:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1); }
.nx-comm-btn-execute:active { transform: translateY(0); }

.nx-spin { animation: nxSpin 1.5s linear infinite; }
@keyframes nxSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Dispatch Specifics */
.nx-comm-dispatch-info { padding-bottom: 20px; border-bottom: 1px solid var(--nx-comm-border); margin-bottom: 25px; }
.nx-comm-text-prominent { font-size: 1.4rem; font-weight: 800; color: #fff; }

/* Confirm Modal Specifics */
.nx-comm-body-centered { padding: 40px 30px; text-align: center; }
.nx-comm-message { color: var(--nx-comm-text-main); font-size: 1rem; line-height: 1.6; }
.nx-comm-actions-unified { padding: 0 30px 30px; display: flex; gap: 12px; justify-content: center; }

.nx-btn-confirm { background: #EF4444; color: #fff; border: none; padding: 10px 25px; border-radius: 6px; font-weight: 800; cursor: pointer; }
.nx-btn-ghost { background: rgba(255, 255, 255, 0.05); color: #94A3B8; border: 1px solid var(--nx-comm-border); padding: 10px 25px; border-radius: 6px; cursor: pointer; }

/* Utils */
.nx-mb-md { margin-bottom: 1.5rem; }

@media (max-width: 850px) {
    .nx-comm-two-column { grid-template-columns: 1fr; }
    .nx-comm-sidebar { border-right: none; border-bottom: 1px solid var(--nx-comm-border); }
}