/**
 * Slack Integration Styles
 * Add this to your main CSS file or include as separate stylesheet
 */

/* ============================================
   SHARE TO SLACK BUTTON
   ============================================ */
.share-slack-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-slack-btn:hover {
    background: #f8fafc;
    border-color: #4A154B;
    color: #4A154B;
}

.share-slack-btn.connected {
    border-color: #2EB67D;
}

.share-slack-btn.connected::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #2EB67D;
    border-radius: 50%;
    margin-left: 4px;
}

.share-slack-btn .slack-icon {
    width: 18px;
    height: 18px;
}

.share-slack-btn.sending {
    pointer-events: none;
    opacity: 0.7;
}

.share-slack-btn .slack-spinner {
    display: none;
    animation: slack-spin 1s linear infinite;
}

.share-slack-btn.sending .slack-spinner {
    display: block;
}

.share-slack-btn.sending .slack-icon {
    display: none;
}

@keyframes slack-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   SLACK MODAL
   ============================================ */
.slack-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: slack-fade-in 0.2s ease;
}

@keyframes slack-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slack-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slack-slide-up 0.3s ease;
}

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

.slack-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.slack-modal-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slack-modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.slack-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.slack-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

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

.slack-team-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.slack-team-badge {
    font-size: 14px;
    font-weight: 500;
    color: #4A154B;
}

.slack-disconnect-btn {
    padding: 4px 12px;
    font-size: 12px;
    color: #64748b;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.slack-disconnect-btn:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.slack-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Channel List */
.slack-channel-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.slack-channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.slack-channel-item:last-child {
    border-bottom: none;
}

.slack-channel-item:hover {
    background: #f8fafc;
}

.slack-channel-item.selected {
    background: #E8DEF8;
}

.slack-channel-icon {
    font-size: 14px;
    color: #64748b;
    width: 20px;
    text-align: center;
}

.slack-channel-name {
    font-size: 14px;
    color: #1e293b;
}

.slack-no-channels {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.slack-loading {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* Message Preview */
.slack-preview {
    margin-top: 16px;
}

.slack-message-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #4A154B;
}

.slack-preview-block {
    font-size: 14px;
}

.slack-preview-score {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.slack-preview-score strong {
    color: #4A154B;
}

.slack-preview-grade {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #E8DEF8;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #4A154B;
}

.slack-preview-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.slack-preview-insights {
    color: #475569;
    line-height: 1.6;
}

.slack-preview-link {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.slack-preview-link a {
    color: #4A154B;
    text-decoration: none;
}

/* Modal Footer */
.slack-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

.slack-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.slack-btn.primary {
    background: #4A154B;
    color: #fff;
}

.slack-btn.primary:hover:not(:disabled) {
    background: #611f69;
}

.slack-btn.primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.slack-btn.secondary {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.slack-btn.secondary:hover {
    background: #f1f5f9;
}

.slack-btn .slack-spinner {
    animation: slack-spin 1s linear infinite;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.slack-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.slack-loading-content {
    text-align: center;
}

.slack-loading-content p {
    margin-top: 16px;
    font-size: 16px;
    color: #475569;
}

.slack-spinner.large {
    width: 48px;
    height: 48px;
}

.slack-spinner.large circle {
    stroke: #4A154B;
    stroke-dasharray: 60;
    stroke-dashoffset: 20;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.slack-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #1e293b;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.slack-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.slack-toast.success {
    background: #059669;
}

.slack-toast.error {
    background: #dc2626;
}

.slack-toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 12px;
}

.slack-toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   DARK THEME SUPPORT
   ============================================ */
.dark-theme .slack-modal {
    background: #1e293b;
}

.dark-theme .slack-modal-header {
    border-color: #334155;
}

.dark-theme .slack-modal-title {
    color: #f1f5f9;
}

.dark-theme .slack-modal-close {
    background: #334155;
    color: #94a3b8;
}

.dark-theme .slack-modal-close:hover {
    background: #475569;
    color: #f1f5f9;
}

.dark-theme .slack-team-info {
    background: #0f172a;
}

.dark-theme .slack-label {
    color: #94a3b8;
}

.dark-theme .slack-channel-list {
    border-color: #334155;
    background: #0f172a;
}

.dark-theme .slack-channel-item {
    border-color: #1e293b;
}

.dark-theme .slack-channel-item:hover {
    background: #1e293b;
}

.dark-theme .slack-channel-item.selected {
    background: #4A154B;
}

.dark-theme .slack-channel-name {
    color: #f1f5f9;
}

.dark-theme .slack-message-preview {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .slack-preview-score,
.dark-theme .slack-preview-title {
    color: #f1f5f9;
}

.dark-theme .slack-preview-insights {
    color: #94a3b8;
}

.dark-theme .slack-modal-footer {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .slack-btn.secondary {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.dark-theme .share-slack-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark-theme .share-slack-btn:hover {
    background: #334155;
}

/* ============================================
   SUCCESS MODAL
   ============================================ */
.slack-success-modal {
    text-align: center;
    padding: 32px 24px;
    max-width: 360px;
}

.slack-success-icon {
    margin-bottom: 16px;
}

.slack-success-icon svg {
    animation: slack-success-pop 0.4s ease-out;
}

@keyframes slack-success-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.slack-success-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.slack-success-message {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.slack-success-message strong {
    color: #1e293b;
}

.slack-pdf-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: #f0fdf4;
    color: #15803d;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Dark theme success modal */
.dark-theme .slack-success-title {
    color: #f1f5f9;
}

.dark-theme .slack-success-message {
    color: #94a3b8;
}

.dark-theme .slack-success-message strong {
    color: #f1f5f9;
}

.dark-theme .slack-pdf-badge {
    background: #064e3b;
    color: #6ee7b7;
}
