/**
 * Same Side Coach - ssc-coaching-chat
 * Styles for the Same Side Coach WordPress plugin
 */
/**
 * Same Side Coach Coaching - Chat Interface Styles
 */

/* Instructions Section */
.ssc-coaching-instructions {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.ssc-instructions-toggle {
    width: 100%;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ssc-instructions-toggle:hover {
    background-color: #f0f0f0;
}

.ssc-instructions-toggle .toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.ssc-instructions-content {
    padding: 15px;
    background-color: #fff;
}

.ssc-instructions-content ul {
    margin: 0;
    padding-left: 20px;
}

.ssc-instructions-content li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Main Container */
.ssc-coaching-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    min-height: 600px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

/* Controls Bar */
.ssc-coaching-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.ssc-mode-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssc-mode-selector-wrapper label {
    font-weight: 500;
    margin: 0;
}

.ssc-mode-selector {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

.ssc-new-conversation-button {
    padding: 8px 16px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.ssc-new-conversation-button:hover {
    background-color: #005a87;
}

/* Chat Messages */
.ssc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;
}

/* Individual Messages */
.ssc-chat-message {
    margin-bottom: 20px;
    clear: both;
}

.ssc-message-user {
    display: flex;
    justify-content: flex-end;
}

.ssc-message-user .ssc-message-content {
    background-color: #f9f9f9;
    padding: 12px 15px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
}

.ssc-message-assistant {
    display: flex;
    justify-content: flex-start;
}

.ssc-message-assistant .ssc-message-content {
    background-color: #f0f9ff;
    padding: 12px 15px;
    border-radius: 12px;
    border-left: 4px solid #0073aa;
    max-width: 85%;
    word-wrap: break-word;
    position: relative;
}

.ssc-message-error .ssc-message-content {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 12px;
    border-left: 4px solid #dc3545;
}

.ssc-message-system .ssc-message-content {
    background-color: #fff3cd;
    color: #856404;
    padding: 12px 15px;
    border-radius: 12px;
    text-align: center;
    font-style: italic;
}

.ssc-message-loading .ssc-message-content {
    background-color: #f0f9ff;
    padding: 12px 15px;
    border-radius: 12px;
}

/* Mode Switch Divider */
.ssc-mode-switch-divider {
    text-align: center;
    margin: 30px 0;
}

.ssc-divider-content {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f0f0f0;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
}

/* Welcome Message */
.ssc-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ssc-welcome-message p {
    font-size: 18px;
    margin: 0;
}

/* Message Content Formatting */
.ssc-message-content h2,
.ssc-message-content h3,
.ssc-message-content h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #333;
}

.ssc-message-content h2 {
    font-size: 18px;
}

.ssc-message-content h3 {
    font-size: 16px;
}

.ssc-message-content h4 {
    font-size: 15px;
}

.ssc-message-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.ssc-message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ssc-message-content li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.ssc-message-content strong {
    font-weight: 600;
}

/* Source Citations */
.source-citation {
    color: #0073aa;
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}

.source-citation:hover {
    color: #005a87;
    text-decoration: none;
}

/* Loading Animation */
.ssc-typing-container {
    margin-bottom: 10px;
}

.ssc-typing {
    display: inline-block;
    padding: 8px 15px;
    background-color: #e0e0e0;
    border-radius: 15px;
}

.ssc-typing::after {
    content: '●●●';
    animation: typing-dots 1.4s infinite;
    letter-spacing: 2px;
}

@keyframes typing-dots {
    0%, 20% { content: '●○○'; }
    40% { content: '●●○'; }
    60%, 100% { content: '●●●'; }
}

.ssc-loading-text {
    font-size: 16px;
    color: #0073aa;
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

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

/* Sources Section */
.ssc-sources-section {
    flex-shrink: 0;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

.ssc-sources-toggle {
    width: 100%;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ssc-sources-toggle:hover {
    background-color: #f0f0f0;
}

.ssc-sources-toggle .toggle-icon {
    font-size: 12px;
}

.ssc-sources-content {
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
}

.ssc-sources-list {
    padding: 15px;
}

.ssc-source-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
}

.ssc-source-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.ssc-source-meta {
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.ssc-source-text {
    margin-bottom: 10px;
    line-height: 1.5;
}

.ssc-source-action {
    margin-top: 10px;
}

.ssc-source-action .button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
}

.ssc-source-action .button:hover {
    background-color: #e0e0e0;
}

.ssc-source-highlight {
    animation: source-highlight 2s;
}

@keyframes source-highlight {
    0%, 100% { background-color: #f9f9f9; }
    25%, 75% { background-color: #fff9c4; }
    50% { background-color: #fff176; }
}

/* Input Container */
.ssc-input-container {
    flex-shrink: 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
}

.ssc-message-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.4;
    box-sizing: border-box;
}

.ssc-message-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ssc-input-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ssc-submit-button,
.ssc-stop-button {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ssc-submit-button {
    background-color: #e60000;
    color: white;
}

.ssc-submit-button:hover:not(:disabled) {
    background-color: #cc0000;
}

.ssc-submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.ssc-stop-button {
    background-color: #e60000;
    color: white;
}

.ssc-stop-button:hover {
    background-color: #cc0000;
}

/* Access Denied */
.ssc-access-denied {
    text-align: center;
    padding: 60px 20px;
}

.ssc-access-denied h2 {
    margin-bottom: 15px;
    color: #333;
}

.ssc-access-denied p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

.ssc-access-denied .button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #e60000;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
}

.ssc-access-denied .button:hover {
    background-color: #cc0000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ssc-coaching-container {
        height: calc(100vh - 200px);
    }
    
    .ssc-coaching-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .ssc-mode-selector-wrapper {
        width: 100%;
    }
    
    .ssc-mode-selector {
        flex: 1;
    }
    
    .ssc-message-user .ssc-message-content,
    .ssc-message-assistant .ssc-message-content {
        max-width: 85%;
    }
}
/* Enhanced Numbered List Styling */
.ssc-steps-container {
    margin: 20px 0;
    padding: 5px 0;
}

.ssc-step-item {
    position: relative;
    margin-bottom: 15px;
    padding: 15px 15px 15px 50px;
    background-color: #f5f5f5;
    border-radius: 6px;
    border-left: 3px solid #e60000;
}

.ssc-step-item:before {
    position: absolute;
    left: 15px;
    top: 15px;
    content: attr(data-step);
    background-color: #e60000;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    font-size: 14px;
}

.ssc-step-label {
    font-weight: bold;
    color: #333;
    margin-right: 5px;
}

.ssc-step-content {
    display: inline;
}

/* Section heading styling */
.ssc-section-heading {
    font-weight: bold;
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

/* ===== Negotiate Mode Specific Styles ===== */

/* Script sections - word-for-word scripts with special formatting */
.ssc-script-section {
    background-color: #f8f9fa;
    border-left: 4px solid #e60000;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    position: relative;
}

.ssc-script-label {
    font-weight: bold;
    color: #e60000;
    font-size: 15px;
    display: block;
    margin-bottom: 10px;
}

.ssc-script-text {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin: 10px 0;
    padding: 10px;
    background-color: white;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.ssc-script-rationale {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
}

/* Copy button for scripts */
.ssc-copy-script-button {
    background-color: #e60000;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ssc-copy-script-button:hover {
    background-color: #c00000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.ssc-copy-script-button:active {
    transform: translateY(0);
}

.ssc-copy-script-button.copied {
    background-color: #28a745;
}

.ssc-copy-script-button.copied::before {
    content: "✓ ";
}

/* Objection sections */
.ssc-objection-section {
    background-color: #fff8f0;
    border-left: 4px solid #ff8c00;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.ssc-objection-label {
    font-weight: bold;
    color: #ff8c00;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.ssc-objection-content {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Confidence builders */
.ssc-confidence-builder {
    background-color: #f0f8f0;
    border-left: 4px solid #28a745;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* What NOT to say section */
.ssc-not-to-say {
    background-color: #fff0f0;
    border-left: 4px solid #dc3545;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.ssc-not-to-say-item {
    font-size: 14px;
    color: #721c24;
    margin: 5px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ssc-not-to-say-item::before {
    content: "❌";
    flex-shrink: 0;
}

/* Scenario type indicator */
.ssc-scenario-indicator {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e60000;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.ssc-scenario-indicator.pre-negotiation {
    background-color: #007bff;
}

.ssc-scenario-indicator.in-the-moment {
    background-color: #ff8c00;
}

.ssc-scenario-indicator.post-negotiation {
    background-color: #6c757d;
}

/* Copy Response Button */
.ssc-copy-response-button {
    position: absolute;
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ssc-copy-response-button.ssc-copy-top {
    top: 8px;
    right: 8px;
}

.ssc-copy-response-button.ssc-copy-bottom {
    bottom: 8px;
    right: 8px;
}

.ssc-copy-response-button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.ssc-copy-response-button:active {
    transform: translateY(0);
}

.ssc-copy-response-button.copied {
    background-color: #28a745;
}

.ssc-copy-response-button.copied::before {
    content: "✓ ";
}
