/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #020617;
    color: #e2e8f0;
    height: 100vh;
    overflow: hidden;
}

/* Main Layout */
.app-container {
    display: flex;
    height: 100vh;
    background: radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.08), transparent 30%);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(30, 41, 59, 0.7);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo i {
    font-size: 1.5rem;
    color: #38bdf8;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.logo-highlight {
    color: #38bdf8;
}

.version-badge {
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.system-status,
.modules-section,
.history-section {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.system-status h3,
.modules-section h3,
.history-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.status-item span:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-active {
    color: #10b981;
    font-weight: 600;
}

.status-online {
    color: #38bdf8;
    font-weight: 600;
}

.modules-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.module-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}

.module-item.active {
    background: rgba(56, 189, 248, 0.15);
    border-left: 3px solid #38bdf8;
}

.module-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-info {
    flex: 1;
}

.module-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.module-desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

.module-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
}

.history-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-left-color: #38bdf8;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    height: 4rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.7);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 40;
}

.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #cbd5e1;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.tab:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(56, 189, 248, 0.3);
}

.tab.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.5);
    color: #38bdf8;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.active-modules {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.count {
    color: #38bdf8;
    font-weight: 700;
}

.mode-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.mode-label {
    font-size: 0.875rem;
    color: #38bdf8;
}

.mode-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.mode-toggle:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden;
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Chat Tab */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #38bdf8, #0ea5e9);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #0ea5e9, #0284c7);
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    animation: slideIn 0.3s ease-out;
}

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

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.ai .avatar {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.message.user .avatar {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.content {
    flex: 1;
    min-width: 0;
}

.bubble {
    background: rgba(30, 41, 59, 0.6);
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
    line-height: 1.5;
}

.message.ai .bubble {
    border-top-left-radius: 0.25rem;
}

.message.user .bubble {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-top-right-radius: 0.25rem;
}

.meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    padding: 0 0.25rem;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.quick-actions button {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #cbd5e1;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.quick-actions button:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

.input-area {
    padding: 1.5rem;
    border-top: 1px solid rgba(30, 41, 59, 0.7);
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(12px);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 1rem;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.attach-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.attach-btn:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.input-container input {
    flex: 1;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 0.875rem;
    padding: 0.75rem;
    outline: none;
}

.input-container input::placeholder {
    color: #64748b;
}

.send-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.input-hints {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.input-hints kbd {
    background: rgba(30, 41, 59, 0.8);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

/* MITRE Tab */
.mitre-container {
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
}

.mitre-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #38bdf8;
}

.mitre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.mitre-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mitre-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.mitre-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tactic-color), transparent);
}

.mitre-id {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tactic-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mitre-id span {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(var(--tactic-rgb), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.mitre-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.mitre-count {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Reports Tab */
.reports-container {
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
}

.reports-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #38bdf8;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.report-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.report-card.critical {
    border-color: rgba(239, 68, 68, 0.3);
}

.report-card.critical .report-header {
    color: #f87171;
}

.report-card.high {
    border-color: rgba(249, 115, 22, 0.3);
}

.report-card.high .report-header {
    color: #fb923c;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.report-severity {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-card.critical .report-severity {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.report-card.high .report-severity {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.report-timestamp {
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.report-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #e2e8f0;
}

.report-description {
    font-size: 0.875rem;
    color: #cbd5e1;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.report-techniques {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.technique-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(71, 85, 105, 0.5);
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.report-card.critical .stat-value {
    color: #f87171;
}

.report-card.high .stat-value {
    color: #fb923c;
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.report-button {
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.report-card.critical .report-button {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.report-card.high .report-button {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.report-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Right Panel */
.right-panel {
    width: 320px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-left: 1px solid rgba(30, 41, 59, 0.7);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.right-panel h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.active-analysis {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.active-analysis h4 {
    font-size: 0.875rem;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 1.5rem 0;
}

.empty-state i {
    font-size: 2.5rem;
    color: #38bdf8;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.mitre-quickview,
.threat-alerts,
.quick-tools {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.mitre-quickview h4,
.threat-alerts h4,
.quick-tools h4 {
    font-size: 0.875rem;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quickview-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quickview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid transparent;
}

.quickview-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.tactic-id {
    font-size: 0.75rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    padding: 0.875rem;
    border-radius: 0.5rem;
    border-left: 3px solid;
    background: rgba(30, 41, 59, 0.8);
}

.alert-item.critical {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.alert-item.high {
    border-left-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.alert-type {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-item.critical .alert-type {
    color: #f87171;
}

.alert-item.high .alert-type {
    color: #fb923c;
}

.alert-time {
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.alert-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: #e2e8f0;
}

.alert-description {
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.alert-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.alert-tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
}

.alert-item.critical .alert-tag {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert-item.high .alert-tag {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.tools-grid button {
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.tools-grid button:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

.tools-grid button i {
    font-size: 1.25rem;
    color: #38bdf8;
}

.tools-grid button span {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .right-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-header {
        padding: 0 1rem;
    }
    
    .tabs {
        gap: 0.25rem;
    }
    
    .tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .active-modules,
    .mode-switcher {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}