/* Content Formatting Styles */
.content-display {
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.content-display p {
    margin-bottom: 1.2rem;
}

.content-display br {
    line-height: 1.8;
}

/* Code Formatting - Enhanced with Copy Button */
.content-display code {
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875em;
    font-weight: 500;
}

.content-display pre {
    background: #1a1b26;
    color: #c0caf5;
    border-radius: 8px;
    padding: 0;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.5;
}

.content-display pre code {
    background: transparent;
    color: inherit;
    padding: 1.5rem;
    border-radius: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    font-weight: 400;
    display: block;
    min-width: max-content;
}

/* Copy button styling - Clean icon-based design */
.content-display pre button,
.content-display pre .copy-button,
.content-display pre .emergency-copy-btn,
.content-display pre .persistent-copy-btn {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: rgba(55, 65, 81, 0.9) !important;
    color: #d1d5db !important;
    border: none !important;
    padding: 8px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    opacity: 0.8 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    z-index: 9999 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
    pointer-events: auto !important;
    backdrop-filter: blur(4px) !important;
}

/* Hover and interaction states - modern and clean */
.content-display pre:hover button,
.content-display pre:hover .copy-button,
.content-display pre:hover .emergency-copy-btn,
.content-display pre:hover .persistent-copy-btn {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-1px) !important;
    background: rgba(75, 85, 99, 0.9) !important;
    color: #f3f4f6 !important;
}

.content-display pre button:hover,
.content-display pre .copy-button:hover,
.content-display pre .emergency-copy-btn:hover,
.content-display pre .persistent-copy-btn:hover {
    background: rgba(99, 102, 241, 0.9) !important;
    color: white !important;
    transform: translateY(-1px) scale(1.05) !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.content-display pre button:active,
.content-display pre .copy-button:active,
.content-display pre .emergency-copy-btn:active,
.content-display pre .persistent-copy-btn:active {
    transform: translateY(0) scale(0.95) !important;
}

/* Icon styling */
.content-display pre button svg,
.content-display pre .copy-button svg,
.content-display pre .emergency-copy-btn svg,
.content-display pre .persistent-copy-btn svg {
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    stroke-width: 2 !important;
}

/* Success state - green with checkmark */
.content-display pre button.copied,
.content-display pre .copy-button.copied,
.content-display pre .emergency-copy-btn.copied,
.content-display pre .persistent-copy-btn.copied {
    background: rgba(34, 197, 94, 0.9) !important;
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-1px) scale(1.1) !important;
}

/* Error state - red with X */
.content-display pre button.error,
.content-display pre .copy-button.error,
.content-display pre .emergency-copy-btn.error,
.content-display pre .persistent-copy-btn.error {
    background: rgba(239, 68, 68, 0.9) !important;
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Headings */
.content-display h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
    line-height: 1.2;
}

.content-display h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1e293b;
    line-height: 1.3;
}

.content-display h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
    line-height: 1.4;
}

.content-display h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    line-height: 1.4;
}

/* Lists */
.content-display ul,
.content-display ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.content-display li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.content-display ul li {
    list-style-type: disc;
}

.content-display ol li {
    list-style-type: decimal;
}

/* Blockquotes */
.content-display blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    background-color: #f8fafc;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.content-display blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #3b82f6;
    position: absolute;
    top: -10px;
    left: 20px;
    font-family: Georgia, serif;
}

/* Links */
.content-display a {
    color: #3b82f6;
    text-decoration: underline;
    transition: color 0.2s;
}

.content-display a:hover {
    color: #1d4ed8;
}

/* Images */
.content-display img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Tables */
.content-display table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.content-display th,
.content-display td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.content-display th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Dark Mode */
.dark .content-display h1,
.dark .content-display h2,
.dark .content-display h3,
.dark .content-display h4 {
    color: #f1f5f9;
}

.dark .content-display code {
    background-color: #374151;
    color: #e5e7eb;
}

.dark .content-display pre {
    background-color: #111827;
    border-color: #4b5563;
}

.dark .content-display blockquote {
    background-color: #1f2937;
    border-left-color: #60a5fa;
    color: #e5e7eb;
}

.dark .content-display blockquote::before {
    color: #60a5fa;
}

.dark .content-display table {
    background-color: #1f2937;
}

.dark .content-display th {
    background-color: #374151;
    color: #f3f4f6;
}

.dark .content-display td {
    border-bottom-color: #4b5563;
    color: #e5e7eb;
}

.dark .content-display a {
    color: #60a5fa;
}

.dark .content-display a:hover {
    color: #93c5fd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-display h1 {
        font-size: 1.875rem;
    }
    
    .content-display h2 {
        font-size: 1.5rem;
    }
    
    .content-display h3 {
        font-size: 1.25rem;
    }
    
    .content-display pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .content-display blockquote {
        padding: 1rem;
        margin: 1rem 0;
    }
}

/* Excerpt and Summary Styles */
.excerpt-display {
    line-height: 1.6;
    color: #6b7280;
}

.dark .excerpt-display {
    color: #9ca3af;
}
