/* ===========================================
   Client Portal - AI Virtual Assistant
   =========================================== */

#ssp-portal {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

/* Header */
.ssp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.ssp-header h1 {
    margin: 0;
    font-size: 22px;
}

.ssp-header p {
    margin: 0;
    opacity: 0.8;
    font-size: 13px;
}

.ssp-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ssp-user-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.ssp-alert-badge {
    background: #dc3545;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ssp-logout {
    color: #fff;
    opacity: 0.8;
    text-decoration: none;
    font-size: 13px;
}

.ssp-logout:hover {
    opacity: 1;
}

/* Main Layout */
.ssp-main {
    display: flex;
    background: #f5f7fa;
    min-height: 600px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* Tasks Panel */
.ssp-tasks-panel {
    width: 280px;
    background: #fff;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.ssp-tasks-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ssp-tasks-header h2 {
    margin: 0;
    font-size: 16px;
}

.ssp-task-count {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 12px;
}

.ssp-task-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ssp-task-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.ssp-task-item:hover {
    background: #f0f4f8;
}

.ssp-task-item.overdue {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.ssp-task-item.today {
    background: #e3f2fd;
    border-left-color: #1e88e5;
}

.ssp-task-item.priority-high {
    border-left-color: #dc3545;
}

.ssp-task-check {
    flex-shrink: 0;
}

.ssp-complete-btn {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #ccc;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssp-complete-btn:hover {
    border-color: #28a745;
    color: #28a745;
    background: #e8f5e9;
}

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

.ssp-task-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.ssp-task-icon {
    margin-right: 5px;
}

.ssp-task-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.ssp-task-meta {
    font-size: 11px;
}

.ssp-task-date {
    color: #666;
}

.ssp-task-date.overdue {
    color: #dc3545;
    font-weight: 600;
}

.ssp-no-tasks {
    text-align: center;
    padding: 40px 20px;
    color: #28a745;
}

.ssp-no-tasks p {
    font-size: 18px;
    margin: 0 0 5px;
}

.ssp-no-tasks small {
    color: #666;
}

/* Chat Container */
.ssp-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #eee;
}

/* Messages */
.ssp-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 450px;
}

.ssp-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.ssp-message.ssp-user {
    flex-direction: row-reverse;
}

.ssp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ssp-ai .ssp-avatar {
    background: #e3f2fd;
}

.ssp-user .ssp-avatar {
    background: #e8f5e9;
}

.ssp-admin .ssp-avatar {
    background: #fff3e0;
}

.ssp-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
}

.ssp-ai .ssp-bubble {
    background: #f0f4f8;
    border-bottom-left-radius: 4px;
}

.ssp-user .ssp-bubble {
    background: #1e88e5;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ssp-admin .ssp-bubble {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-bottom-left-radius: 4px;
}

.ssp-sender {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #e65100;
}

.ssp-bubble p {
    margin: 0 0 8px;
}

.ssp-bubble p:last-child {
    margin-bottom: 0;
}

.ssp-bubble ul, .ssp-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ssp-bubble li {
    margin-bottom: 4px;
}

/* Quick Actions */
.ssp-quick-actions {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.ssp-quick-btn {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ssp-quick-btn:hover {
    background: #1e88e5;
    color: #fff;
    border-color: #1e88e5;
}

/* Input Area */
.ssp-input-area {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

#ssp-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
}

#ssp-input:focus {
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30,136,229,0.1);
}

#ssp-send {
    padding: 12px 24px;
    background: #1e88e5;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#ssp-send:hover {
    background: #1565c0;
}

#ssp-send:disabled {
    background: #bbb;
    cursor: not-allowed;
}

/* Side Panel */
.ssp-side-panel {
    width: 350px;
    background: #fff;
    border-left: 1px solid #eee;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.ssp-panel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.ssp-panel-close:hover {
    background: #e0e0e0;
}

.ssp-panel-content h3 {
    margin: 0 0 20px;
    font-size: 18px;
}

/* Upload Type Selection */
.ssp-upload-type {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.ssp-radio-card {
    flex: 1;
    display: block;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.ssp-radio-card input {
    display: none;
}

.ssp-radio-card span {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.ssp-radio-card small {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.ssp-radio-card:has(input:checked) {
    border-color: #1e88e5;
    background: #e3f2fd;
}

/* Form Fields */
.ssp-field {
    margin-bottom: 15px;
}

.ssp-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.ssp-field input,
.ssp-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.ssp-field input:focus,
.ssp-field select:focus {
    outline: none;
    border-color: #1e88e5;
}

.ssp-doc-type {
    display: flex;
    gap: 20px;
}

.ssp-doc-type label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

/* Dropzone */
.ssp-dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.ssp-dropzone:hover,
.ssp-dropzone.dragover {
    border-color: #1e88e5;
    background: #e3f2fd;
}

.ssp-dropzone p {
    margin: 0;
    color: #666;
}

#ssp-file-preview {
    margin-bottom: 15px;
}

.ssp-file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
}

.ssp-file-item .name {
    flex: 1;
}

.ssp-file-item .remove {
    color: #e53935;
    cursor: pointer;
    padding: 0 5px;
}

/* Buttons */
.ssp-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ssp-btn-primary {
    background: #1e88e5;
    color: #fff;
}

.ssp-btn-primary:hover {
    background: #1565c0;
}

.ssp-btn-primary:disabled {
    background: #bbb;
    cursor: not-allowed;
}

.ssp-btn-success {
    background: #43a047;
    color: #fff;
}

.ssp-btn-success:hover {
    background: #388e3c;
}

/* Loading */
.ssp-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #1e88e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .ssp-main {
        flex-direction: column;
    }
    
    .ssp-side-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
    }
    
    .ssp-bubble {
        max-width: 85%;
    }
    
    .ssp-quick-actions {
        flex-wrap: wrap;
    }
}

/* Cloud Storage Upload */
.ssp-cloud-upload {
    margin: 15px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.ssp-cloud-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    padding: 12px 15px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.ssp-cloud-embed {
    padding: 15px;
    background: #fff;
    min-height: 200px;
}

.ssp-cloud-embed iframe {
    width: 100%;
    min-height: 300px;
    border: none;
}

/* WP Cloud Plugins Styling Adjustments */
.ssp-cloud-embed .wpcp-upload-container,
.ssp-cloud-embed .OutoftheBox,
.ssp-cloud-embed .UseyourDrive,
.ssp-cloud-embed .LetsShare {
    border: none !important;
    box-shadow: none !important;
}

.ssp-cloud-embed .upload-btn {
    background: #1e88e5 !important;
    border-color: #1e88e5 !important;
}

/* Agent Tool Execution Summary */
.ssp-tools-summary {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.ssp-tools-summary small {
    color: #888;
    font-size: 11px;
    line-height: 1.6;
}

/* Enhanced AI Bubble for Agent Actions */
.ssp-bubble .ssp-action-result {
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    margin: 8px 0;
    font-size: 13px;
}

.ssp-bubble .ssp-action-result.error {
    background: #fbe9e7;
    border-left-color: #e53935;
}

/* Thinking/Working indicator */
.ssp-bubble .ssp-working {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 13px;
}

.ssp-bubble .ssp-working .ssp-loading {
    width: 14px;
    height: 14px;
}
