/* Senna Launchpad - Bloomberg Terminal Style */

:root {
    --sfpe-bloomberg-bg: #0D353E;
    --sfpe-bloomberg-surface: #102B30;
    --sfpe-bloomberg-panel: #102B30;
    --sfpe-bloomberg-border: #1b5059;
    --sfpe-bloomberg-primary: #0D353E;
    --sfpe-bloomberg-accent: #6CFFC4;
    --sfpe-bloomberg-success: #3FB950;
    --sfpe-bloomberg-warning: #F0883E;
    --sfpe-bloomberg-text: #FFFFFF;
    --sfpe-bloomberg-text-muted: #6CFFC4AA;
    --sfpe-bloomberg-text-bright: #FFFFFF;
    --sfpe-panel-header-height: 40px;
}

/* Light mode disabled by default - dark mode is always on */
.sfpe-bloomberg-widget {
    --sfpe-bloomberg-bg: #0D353E;
    --sfpe-bloomberg-surface: #102B30;
    --sfpe-bloomberg-panel: #102B30;
    --sfpe-bloomberg-border: #1b5059;
    --sfpe-bloomberg-text: #FFFFFF;
    --sfpe-bloomberg-text-muted: #6CFFC4AA;
    --sfpe-bloomberg-text-bright: #FFFFFF;
}

/* Main Container */
.sfpe-bloomberg-widget {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    background: #0D353E;
    color: #FFFFFF;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    min-height: 900px;
    padding: 0;
}

/* Ensure all backgrounds are dark */
.sfpe-bloomberg-widget * {
    background-color: transparent;
}

.sfpe-bloomberg-widget input[type="text"],
.sfpe-bloomberg-widget input[type="email"],
.sfpe-bloomberg-widget input[type="password"],
.sfpe-bloomberg-widget textarea,
.sfpe-bloomberg-widget select {
    background-color: #164147 !important;
    color: #FFFFFF !important;
    border: none !important;
}

/* Remove all green outlines globally */
.sfpe-bloomberg-widget *:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Chart Container Styles */
.sfpe-chart-container {
    margin-top: 20px;
    background: #164147;
    border: 1px solid #1b5059;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sfpe-chart-container.minimized .sfpe-chart-body {
    display: none;
}

.sfpe-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #102B30;
    border-bottom: 1px solid #1b5059;
}

.sfpe-chart-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #6CFFC4;
}

.sfpe-chart-toggle {
    background: transparent;
    border: 1px solid #6CFFC4;
    color: #6CFFC4;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sfpe-chart-toggle:hover {
    background: rgba(108, 255, 196, 0.1);
    transform: scale(1.05);
}

.sfpe-chart-body {
    padding: 20px;
    height: 300px;
    position: relative;
}

.sfpe-chart-body canvas {
    max-width: 100%;
    height: 100% !important;
}

/* Text visibility fixes */
.sfpe-bloomberg-widget input,
.sfpe-bloomberg-widget textarea,
.sfpe-bloomberg-widget select,
.sfpe-bloomberg-widget button {
    color: #FFFFFF;
}

.sfpe-bloomberg-widget .sfpe-chat-input {
    color: #FFFFFF;
    background: #164147;
    border-color: #1b5059;
}

.sfpe-bloomberg-widget .sfpe-message-content {
    color: #FFFFFF;
}

.sfpe-bloomberg-widget .sfpe-panel-content {
    color: #FFFFFF;
}

/* Branding Header */
.sfpe-branding-header {
    background: transparent;
    padding: 40px 20px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sfpe-senna-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.sfpe-senna-text {
    font-size: 40px;
    font-weight: bold;
    letter-spacing: 2px;
    background: linear-gradient(to right, #FFFFFF, #BBBBBB);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.sfpe-launchpad-text {
    display: none;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.sfpe-powered-by {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

.sfpe-powered-by strong {
    color: #FFFFFF;
    font-weight: 600;
}

/* Intelligence Bar */
.sfpe-intelligence-bar {
    background: #093036;
    border: 1px solid #1b5059;
    border-radius: 5px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: auto;
    margin: 0 20px 25px;
}

.sfpe-intelligence-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.sfpe-intelligence-label {
    color: #6CFFC4;
    font-weight: 600;
    margin-right: 20px;
    font-size: 14px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.sfpe-intelligence-ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.sfpe-ticker-items {
    display: block;
    position: relative;
    height: 20px;
    white-space: nowrap;
}

.sfpe-ticker-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: #6CFFC4;
    font-size: 13px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.sfpe-ticker-item.active {
    opacity: 1;
}

/* Remove old ticker animation */
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* User Welcome */
.sfpe-user-welcome {
    padding: 0 20px 30px;
    background: transparent;
    text-align: center;
}

.sfpe-welcome-text {
    font-size: 18px;
    font-weight: normal;
    color: #FFFFFF;
    margin: 0 0 5px 0;
}

.sfpe-user-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.sfpe-meta-item {
    color: #FFFFFF;
    font-size: 14px;
    position: relative;
    padding-left: 0;
}

.sfpe-meta-item:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--sfpe-bloomberg-accent);
}

.sfpe-subtitle {
    color: var(--sfpe-bloomberg-text-muted);
    font-size: 14px;
    margin: 0;
}

/* Dashboard Container */
.sfpe-dashboard-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    background: transparent;
    margin: 0 12% 20px 12%;
    height: 300px;
}

/* Dashboard Panels */
.sfpe-dashboard-panel {
    background: #102B30;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #1b5059;
    min-height: 300px;
}

.sfpe-panel-header {
    background: transparent;
    color: #6CFFC4;
    padding: 20px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    flex-shrink: 0;
    border-bottom: 1px solid #1b5059;
}

.sfpe-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
    letter-spacing: 0.5px;
    color: #6CFFC4;
}

.sfpe-panel-toggle {
    background: none;
    border: none;
    color: #6CFFC4;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sfpe-panel-toggle:hover {
    opacity: 1;
}

.sfpe-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #102B30;
}

/* Recent Prompts Panel */
.sfpe-search-box {
    margin-bottom: 15px;
}

.sfpe-search-box input {
    width: 100%;
    background: #164147 !important;
    border: none !important;
    color: #FFFFFF !important;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    border-radius: 4px;
    transition: all 0.2s;
}

.sfpe-search-box input:focus {
    outline: none;
    border-color: var(--sfpe-bloomberg-accent);
}

.sfpe-prompts-list {
    margin-bottom: 20px;
}

.sfpe-prompt-item {
    padding: 8px 0;
    background: transparent;
    border: none;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    color: #FFFFFF;
}

.sfpe-prompt-item:hover {
    color: #6CFFC4;
    padding-left: 5px;
}

.sfpe-trending-section h4 {
    font-size: 13px;
    font-weight: normal;
    color: #6CFFC4;
    margin: 15px 0 10px 0;
    text-transform: none;
    letter-spacing: 0.5px;
}

.sfpe-empty-state {
    color: #6CFFC4AA;
    font-style: normal;
    text-align: left;
    padding: 10px 0;
    font-size: 12px;
}

/* News Panel */
.sfpe-tracked-companies {
    margin-bottom: 20px;
}

.sfpe-tracked-companies h4,
.sfpe-news-feed h4 {
    font-size: 13px;
    font-weight: normal;
    color: #6CFFC4;
    margin: 0 0 10px 0;
    text-transform: none;
    letter-spacing: 0.5px;
}

.sfpe-news-item {
    padding: 12px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #1b505920;
    margin-bottom: 10px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
}

.sfpe-news-item:hover {
    border-color: var(--sfpe-bloomberg-accent);
    color: var(--sfpe-bloomberg-accent);
}

.sfpe-news-item::before {
    display: none;
}

/* Company Profiles */
.sfpe-company-profile {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #1b505920;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sfpe-company-profile:hover {
    border-color: var(--sfpe-bloomberg-accent);
}

.sfpe-company-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #1b5059;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sfpe-company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sfpe-company-profile span {
    color: #FFFFFF;
    font-size: 14px;
    flex: 1;
}

/* Case Study Items */
.sfpe-case-study-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #1b505920;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sfpe-case-study-item:hover {
    border-color: var(--sfpe-bloomberg-accent);
}

.sfpe-case-study-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #1b5059;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sfpe-case-study-icon::before {
    content: '';
    width: 16px;
    height: 20px;
    background: var(--sfpe-bloomberg-accent);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
}

.sfpe-case-study-item span {
    color: #FFFFFF;
    font-size: 14px;
    flex: 1;
}


.sfpe-news-title {
    font-weight: normal;
    color: #FFFFFF;
    margin-bottom: 4px;
    font-size: 13px;
}

.sfpe-news-meta {
    font-size: 11px;
    color: var(--sfpe-bloomberg-text-muted);
}

/* Templates Panel */
.sfpe-template-item {
    background: transparent;
    border: none;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    display: block;
}

.sfpe-template-item:hover {
    background: #1b505920;
}

.sfpe-template-icon {
    display: none;
}

.sfpe-template-item h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: normal;
    color: #FFFFFF;
}

.sfpe-template-item p {
    margin: 0;
    font-size: 11px;
    color: #6CFFC4AA;
}

/* Chat Container */
.sfpe-chat-main-container {
    background: transparent;
    margin: 30px 12% 0 12%;
    position: relative;
}

.sfpe-chat-container {
    display: flex;
    flex-direction: column;
    height: auto;
    background: transparent;
}

.sfpe-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 100px;
    max-height: 300px;
    background: #102B30;
    border-radius: 8px;
    border: 1px solid #1b5059;
    margin-bottom: 15px;
}

.sfpe-initial-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6CFFC4AA;
    font-style: normal;
}

/* Chat Messages */
.sfpe-message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.sfpe-message-user {
    text-align: right;
}

.sfpe-message-content {
    display: inline-block;
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.sfpe-message-user .sfpe-message-content {
    background: #0D353E;
    color: #FFFFFF;
    border: 1px solid #1b5059;
}

.sfpe-message-assistant .sfpe-message-content {
    background: #164147;
    border: 1px solid #1b5059;
    color: #FFFFFF;
}

/* Powered by label */
.sfpe-powered-label {
    text-align: center;
    font-size: 12px;
    color: #6CFFC4AA;
    margin-bottom: 10px;
    font-weight: normal;
}

.sfpe-powered-label strong {
    color: #6CFFC4;
    font-weight: bold;
}

/* Input Area */
.sfpe-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 0;
    background: transparent;
    align-items: flex-end;
    position: relative;
}

.sfpe-input-controls {
    display: flex;
    gap: 5px;
}

.sfpe-input-tool {
    width: 50px;
    height: 50px;
    background: #164147;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 6px;
}

.sfpe-input-tool:hover {
    background: #0D353E;
    color: #FFFFFF;
}

.sfpe-chat-input {
    flex: 1;
    background: #164147;
    border: none;
    border-radius: 6px;
    color: #FFFFFF;
    padding: 15px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    max-height: 120px;
    transition: all 0.2s;
}

.sfpe-chat-input::placeholder {
    color: #6CFFC4AA;
    opacity: 0;
    animation: fadeInPlaceholder 2s ease forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInPlaceholder {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.7;
    }
}

.sfpe-chat-input:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px #6CFFC420;
}

.sfpe-send-button {
    background: #0D353E;
    color: #FFFFFF;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    font-family: inherit;
    letter-spacing: 0.5px;
    outline: none !important;
    box-shadow: none !important;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.sfpe-send-button:hover:not(:disabled) {
    background: #0A2A32;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sfpe-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar Styling */
.sfpe-panel-content::-webkit-scrollbar,
.sfpe-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.sfpe-panel-content::-webkit-scrollbar-track,
.sfpe-chat-messages::-webkit-scrollbar-track {
    background: var(--sfpe-bloomberg-surface);
}

.sfpe-panel-content::-webkit-scrollbar-thumb,
.sfpe-chat-messages::-webkit-scrollbar-thumb {
    background: var(--sfpe-bloomberg-border);
    border-radius: 4px;
}

.sfpe-panel-content::-webkit-scrollbar-thumb:hover,
.sfpe-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--sfpe-bloomberg-text-muted);
}

/* Loading State */
.sfpe-loading {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.sfpe-loading-dot {
    width: 8px;
    height: 8px;
    background: var(--sfpe-bloomberg-accent);
    border-radius: 50%;
    animation: loading 1.4s ease-in-out infinite;
}

.sfpe-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.sfpe-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
}

/* History Panel */
.sfpe-history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: #102B30;
    border-left: 1px solid #1b5059;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sfpe-history-panel.active {
    right: 0;
}

.sfpe-history-panel .sfpe-panel-header {
    padding: 20px;
    border-bottom: 1px solid #1b5059;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #102B30;
}

.sfpe-history-panel .sfpe-panel-header h3 {
    margin: 0;
    color: #6CFFC4;
    font-size: 18px;
}

.sfpe-panel-close {
    background: none;
    border: none;
    color: #6CFFC4;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sfpe-panel-close:hover {
    color: #FFFFFF;
}

.sfpe-history-item {
    padding: 15px 20px;
    border-bottom: 1px solid #1b505920;
    cursor: pointer;
    transition: all 0.2s;
}

.sfpe-history-item:hover {
    background-color: #1b505920;
}

.sfpe-history-item-title {
    color: #FFFFFF;
    font-size: 14px;
    margin-bottom: 5px;
}

.sfpe-history-item-preview {
    color: #6CFFC4AA;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sfpe-history-item-date {
    color: #999;
    font-size: 11px;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sfpe-dashboard-container {
        grid-template-columns: 250px 1fr 250px;
        margin: 0 5% 20px 5%;
    }
    
    .sfpe-chat-main-container {
        margin: 30px 5% 0 5%;
    }
}

@media (max-width: 992px) {
    .sfpe-dashboard-container {
        grid-template-columns: 1fr;
        height: auto;
        margin: 0 20px 20px 20px;
    }
    
    .sfpe-chat-main-container {
        margin: 30px 20px 0 20px;
    }
    
    .sfpe-dashboard-panel {
        height: 300px;
    }
    
    .sfpe-panel-left,
    .sfpe-panel-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .sfpe-senna-text {
        font-size: 24px;
    }
    
    .sfpe-launchpad-text {
        font-size: 18px;
    }
    
    .sfpe-chat-container {
        height: 500px;
    }
    
    .sfpe-history-panel {
        width: 100%;
        right: -100%;
    }
    
    .sfpe-history-panel.active {
        right: 0;
    }
}