* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    margin-bottom: 40px;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
    margin-bottom: 30px;
}

.meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 40px;
}

.author {
    font-weight: 500;
}

.date {
    opacity: 0.8;
}

.content {
    font-size: 1.1rem;
    line-height: 1.7;
}

.content p {
    margin-bottom: 24px;
}

.content h1, .content h2, .content h3 {
    margin: 40px 0 20px 0;
    line-height: 1.3;
    color: #1a1a1a;
}

.content h1 {
    font-size: 2rem;
    font-weight: 700;
}

.content h2 {
    font-size: 1.6rem;
    font-weight: 600;
}

.content h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.content blockquote {
    border-left: 4px solid #e0e0e0;
    margin: 30px 0;
    padding: 20px 0 20px 24px;
    font-style: italic;
    background-color: #f9f9f9;
    color: #555;
}

.content ul, .content ol {
    margin: 24px 0;
    padding-left: 30px;
}

.content li {
    margin-bottom: 8px;
}

.content code:not([class*="language-"]) {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    color: #d73a49;
}

/* Table styling */
.table-container {
    margin: 40px 0;
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.results-table th {
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    position: relative;
}

.results-table th:first-child {
    text-align: left;
    padding-left: 20px;
    border-top-left-radius: 12px;
}

.results-table th:last-child {
    border-top-right-radius: 12px;
}

.results-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.results-table tbody tr:hover {
    background-color: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.results-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.results-table td {
    padding: 16px 12px;
    text-align: center;
    border: none;
    font-weight: 400;
    color: #2c3e50;
}

.results-table td:first-child {
    text-align: left;
    padding-left: 20px;
    font-weight: 600;
    color: #1a1a1a;
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
}

/* Special styling for dash values */
.results-table td:not(:first-child):not(:last-child) {
    color: #7f8c8d;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.9rem;
}

/* Sum column styling */
.results-table td:last-child,
.results-table th:last-child {
    background: rgba(52, 152, 219, 0.1);
    font-weight: 700;
    color: #2980b9;
    border-left: 2px solid #3498db;
}

.results-table th:last-child {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

/* Alternating row colors */
.results-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.results-table tbody tr:nth-child(even):hover {
    background-color: #f0f4ff;
}

/* Problem columns hover effect */
.results-table th:not(:first-child):not(:last-child):hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .table-container {
        margin: 30px -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 12px 8px;
    }
    
    .results-table th:first-child,
    .results-table td:first-child {
        padding-left: 12px;
        font-size: 0.8rem;
    }
    
    .results-table th {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .results-table th,
    .results-table td {
        padding: 10px 6px;
    }
    
    .results-table th:first-child,
    .results-table td:first-child {
        padding-left: 10px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Math formulas styling with copy functionality */
.MathJax {
    font-size: 1.1em !important;
}

.math-block {
    position: relative;
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
}

.math-block .math-content {
    text-align: center;
}

/* Math copy button styling */
.math-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #24292e;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10;
}

.math-block:hover .math-copy-btn {
    opacity: 1;
}

.math-copy-btn:hover {
    background: #444d56;
}

/* Hide the LaTeX source by default */
.math-latex-source {
    display: none;
}

/* Enhanced code block styling for Prism.js */
.content pre[class*="language-"] {
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e4e8;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
}

.content pre[class*="language-"] code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Code block header with language label */
.code-block {
    position: relative;
    margin: 30px 0;
}

.code-header {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: #586069;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.code-block pre[class*="language-"] {
    margin: 0;
    border-radius: 0 0 8px 8px;
    border-top: 0;
}

/* Custom Prism theme adjustments */
pre[class*="language-"] {
    background: #f8f9fa;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6a737d;
}

.token.punctuation {
    color: #586069;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #005cc5;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #032f62;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #d73a49;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #d73a49;
}

.token.function,
.token.class-name {
    color: #6f42c1;
}

.token.regex,
.token.important,
.token.variable {
    color: #e36209;
}

/* Line numbers styling */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #d1d5da;
    background: #f0f0f0;
}

.line-numbers-rows > span:before {
    color: #6a737d;
}

/* Image styling */
.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 40px auto;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.image-caption {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    margin-bottom: 30px;
}

.image-container {
    margin: 40px 0;
}

/* Links */
.content a {
    color: #1a73e8;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.content a:hover {
    border-bottom-color: #1a73e8;
}

/* Copy code button styling */
.code-toolbar {
    position: relative;
}

.code-toolbar .toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.code-toolbar:hover .toolbar {
    opacity: 1;
}

.code-toolbar .toolbar .toolbar-item button {
    background: #24292e;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.code-toolbar .toolbar .toolbar-item button:hover {
    background: #444d56;
}

/* Toast notification for copy feedback */
.copy-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .title {
        font-size: 2rem;
    }

    .content {
        font-size: 1rem;
    }

    .content h1 {
        font-size: 1.7rem;
    }

    .content h2 {
        font-size: 1.4rem;
    }

    .content h3 {
        font-size: 1.2rem;
    }

    .meta {
        flex-direction: column;
        gap: 5px;
    }

    .content pre[class*="language-"] {
        font-size: 0.8rem;
    }

    .math-copy-btn {
        opacity: 1; /* Always visible on mobile */
    }
}

/* Social Sharing Section */
.social-sharing {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.social-sharing h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 25px;
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.share-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Individual platform colors */
.share-btn.facebook {
    background-color: #1877f2;
    color: white;
}

.share-btn.facebook:hover {
    background-color: #166fe5;
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4);
}

.share-btn.linkedin {
    background-color: #0a66c2;
    color: white;
}

.share-btn.linkedin:hover {
    background-color: #095bb5;
    box-shadow: 0 6px 20px rgba(10, 102, 194, 0.4);
}

.share-btn.twitter {
    background-color: #000000;
    color: white;
}

.share-btn.twitter:hover {
    background-color: #333333;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Icon styling within buttons */
.share-btn svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.share-btn:hover svg {
    transform: scale(1.1);
}

/* Responsive design for social buttons */
@media (max-width: 768px) {
    .social-sharing {
        margin-top: 40px;
        padding: 30px 0;
    }
    
    .social-sharing h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .share-btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .share-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    .share-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Loading animation for share buttons */
.share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.share-btn:hover::before {
    left: 100%;
}