/* Worldbook Detail Page Styles */

.worldbook-header-section {
    background: white;
    padding: 2rem 0;
    margin: 2rem 0;
    border-bottom: 3px solid #667eea;
}

.worldbook-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.worldbook-header-left {
    flex: 1;
}

.worldbook-detail-title {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
    font-weight: 700;
}

.worldbook-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 1rem;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.worldbook-header-right {
    display: flex;
    align-items: center;
}

.worldbook-votes-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.vote-button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.vote-button:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.vote-button:active {
    transform: scale(0.95);
}

.vote-button.upvote.active {
    background: #48bb78;
    box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
}

.vote-button.upvote.active:hover {
    background: #38a169;
}

.vote-button.downvote.active {
    background: #f56565;
    box-shadow: 0 0 10px rgba(245, 101, 101, 0.5);
}

.vote-button.downvote.active:hover {
    background: #e53e3e;
}

.vote-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.worldbook-actions-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-button:hover {
    background: #667eea;
    color: white;
}

.action-button.primary {
    background: #667eea;
    color: white;
}

.action-button.primary:hover {
    background: #5568d3;
}

/* Content Section */
.worldbook-content-section {
    background: white;
    padding: 3rem 0;
    margin: 2rem 0;
}

.worldbook-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.worldbook-content h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.worldbook-content h2 {
    font-size: 2rem;
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.worldbook-content h3 {
    font-size: 1.5rem;
    color: #764ba2;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.worldbook-content h4 {
    font-size: 1.25rem;
    color: #666;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.worldbook-content p {
    margin-bottom: 1rem;
}

.worldbook-content ul, .worldbook-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.worldbook-content li {
    margin-bottom: 0.5rem;
}

.worldbook-content a {
    color: #667eea;
    text-decoration: underline;
}

.worldbook-content a:hover {
    color: #5568d3;
}

.worldbook-content strong {
    font-weight: 700;
    color: #333;
}

.worldbook-content code {
    background: #2d3748;
    color: #a0aec0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

/* Code Block Wrapper with Copy Button */
.code-block-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.worldbook-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.worldbook-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.code-copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 1;
}

.code-copy-button:hover {
    background: #5568d3;
}

/* CLI Section */
.cli-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin: 2rem 0;
}

.cli-box {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cli-box h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.cli-command-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
}

.cli-command-box code {
    background: none;
    color: white;
    padding: 0;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
}

.cli-command-box .copy-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.cli-command-box .copy-button:hover {
    transform: scale(1.05);
}

/* Related Section */
.related-section {
    background: white;
    padding: 3rem 0;
    margin: 2rem 0;
}

.related-section h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

/* Comments Section */
.comments-section {
    background: white;
    padding: 3rem 0;
    margin: 2rem 0;
    border-top: 3px solid #667eea;
}

.comments-section h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 2rem;
}

.add-comment-box {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    margin-bottom: 3rem;
}

.add-comment-box h4 {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.btn-primary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.comments-list {
    max-width: 900px;
    margin: 0 auto;
}

.comment {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-bottom: 1.5rem;
}

.comment.reply {
    background: #edf2f7;
    border-left-color: #764ba2;
    margin-left: 2rem;
    margin-top: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-author {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
}

.comment-date {
    font-size: 0.9rem;
    color: #999;
}

.comment-content {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.reply-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.reply-button:hover {
    background: #667eea;
    color: white;
}

.reply-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    margin-top: 1rem;
}

.reply-form input,
.reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-family: inherit;
}

.reply-form input:focus,
.reply-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.reply-form textarea {
    resize: vertical;
}

.reply-form button {
    margin-right: 0.5rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5568d3;
}

.btn-cancel {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    color: #666;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #f7fafc;
}

.comment-replies {
    margin-top: 1rem;
}

.no-comments {
    text-align: center;
    color: #999;
    font-size: 1.1rem;
    padding: 3rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .worldbook-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .worldbook-detail-title {
        font-size: 2rem;
    }

    .worldbook-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .worldbook-votes-large {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }

    .worldbook-actions-bar {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }

    .worldbook-content {
        font-size: 1rem;
    }

    .code-copy-button {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .cli-command-box {
        flex-direction: column;
    }

    .comment.reply {
        margin-left: 1rem;
    }

    .add-comment-box {
        padding: 1.5rem;
    }
}
