/* Enterprise UX Enhancements for Budget Calculator */
/* Modern, professional styling with improved visual hierarchy */

/* ============================================
   ENTERPRISE TOOLBAR
   ============================================ */

.enterprise-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    margin-bottom: 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
    color: white;
    backdrop-filter: blur(12px);
}

/* Light mode: Use light gradient instead of dark */
[data-theme="light"] .enterprise-toolbar {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 60%, #cbd5e1 100%);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

.enterprise-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.enterprise-toolbar__hint {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
}

[data-theme="light"] .enterprise-toolbar__hint {
    color: rgba(30, 41, 59, 0.75);
}

.enterprise-toolbar__hint kbd {
    background: rgba(15, 23, 42, 0.45);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Light mode: Dark text on light buttons */
[data-theme="light"] .toolbar-btn {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.18);
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toolbar-btn span {
    font-size: 16px;
}

.toolbar-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.toolbar-btn--accent-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: 2px solid rgba(167, 139, 250, 0.8);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.toolbar-btn--accent-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(52, 211, 153, 0.7);
    color: #fff;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.toolbar-btn--accent-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(124, 58, 237, 0.7);
    color: #fff;
    box-shadow: 0 8px 20px rgba(103, 126, 234, 0.35);
}

.toolbar-btn--accent-purple:hover,
.toolbar-btn--accent-green:hover,
.toolbar-btn--accent-blue:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
}

/* ============================================
   PRESENCE & COLLABORATION
   ============================================ */

.presence-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.presence-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.presence-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.presence-icon {
    font-size: 18px;
}

.presence-users {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-badge.current-user {
    border: 2px solid #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

/* ============================================
   SCENARIO COMPARISON
   ============================================ */

.comparison-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    min-width: 600px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid #e0e7ff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.comparison-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.comparison-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.comparison-scenarios {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scenario-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.scenario-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

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

.scenario-title {
    flex: 1;
}

.scenario-name-input {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
    width: 100%;
    max-width: 400px;
}

.scenario-name-input:hover,
.scenario-name-input:focus {
    background: white;
    outline: 2px solid #667eea;
}

.scenario-date {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.scenario-delete {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.scenario-delete:hover {
    opacity: 1;
    transform: scale(1.1);
}

.scenario-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.scenario-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

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

.stat-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.channel-comparison {
    display: grid;
    gap: 8px;
}

.channel-comparison-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
}

.channel-name {
    font-weight: 600;
    color: #475569;
}

.channel-amount {
    text-align: right;
    font-weight: 600;
    color: #1e293b;
}

.channel-change {
    text-align: right;
    font-weight: 700;
    font-size: 13px;
}

.comparison-summary {
    margin-top: 32px;
    padding: 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
}

.comparison-summary h3 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 18px;
}

.difference-table {
    overflow-x: auto;
}

.difference-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.difference-table th {
    text-align: left;
    padding: 12px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.difference-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-footer {
    padding: 20px 24px;
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
}

/* ============================================
   AUDIT TRAIL
   ============================================ */

.audit-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

.audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid #e0e7ff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.audit-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.audit-icon {
    font-size: 24px;
}

.audit-actions {
    display: flex;
    gap: 8px;
}

.audit-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audit-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
}

.audit-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.audit-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.audit-timestamp {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.audit-item-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.audit-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.audit-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.audit-restore,
.audit-details {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.audit-restore {
    background: #3b82f6;
    color: white;
}

.audit-restore:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.audit-details {
    background: #e2e8f0;
    color: #475569;
}

.audit-details:hover {
    background: #cbd5e1;
}

.audit-hash {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ============================================
   COMMAND PALETTE
   ============================================ */

.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.command-palette-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.command-palette-content {
    position: relative;
    width: 90%;
    max-width: 640px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

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

.command-palette-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
}

.search-icon {
    font-size: 20px;
    opacity: 0.5;
}

#command-search {
    flex: 1;
    border: none;
    font-size: 16px;
    padding: 8px 0;
    outline: none;
    color: #1e293b;
    font-weight: 500;
}

#command-search::placeholder {
    color: #94a3b8;
}

.search-shortcut {
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.command-list {
    max-height: 420px;
    overflow-y: auto;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.command-item:hover,
.command-item.selected {
    background: #f1f5f9;
    border-left-color: #3b82f6;
}

.command-icon {
    font-size: 20px;
    flex-shrink: 0;
}

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

.command-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.command-description {
    font-size: 12px;
    color: #64748b;
}

.command-shortcut {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

.command-item-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ============================================
   MODALS
   ============================================ */

.audit-details-modal,
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.2s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-body pre {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.shortcuts-grid {
    display: grid;
    gap: 12px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    gap: 16px;
}

.shortcut-name {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

kbd {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    background: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 0 #cbd5e1;
}

/* ============================================
   RISK EXPLANATION BANNER
   ============================================ */

.risk-explanation-banner {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
    display: none;
}

.banner-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
}

.banner-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
}

.banner-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.5;
}

/* Channel card minimal change styling */
.channel-card.minimal {
    background: #FFF9E6;
    border-left: 4px solid #FFC107;
}

.channel-card.minimal .channel-change {
    color: #F57C00;
    font-style: italic;
}

.channel-change.minimal {
    color: #F57C00 !important;
    font-style: italic;
}

/* Amount value colors */
.amount-value.positive {
    color: #4CAF50;
    font-weight: 600;
}

.amount-value.negative {
    color: #F44336;
    font-weight: 600;
}

.amount-value.neutral {
    color: #FF9800;
    font-weight: 600;
}

/* Risk posture indicator in summary */
#risk-posture-indicator {
    border-left: 3px solid currentColor;
    padding-left: 12px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 4000;
    font-size: 14px;
    font-weight: 600;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: scale(1.05);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-size: 14px;
}

.positive {
    color: #10b981;
}

.negative {
    color: #ef4444;
}

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

@media (max-width: 1024px) {
    .comparison-panel {
        width: 100%;
        min-width: 0;
    }

    .audit-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .command-palette-content {
        width: 95%;
    }

    .scenario-stats {
        flex-direction: column;
        gap: 12px;
    }

    .channel-comparison-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
