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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 { font-size: 28px; color: #333; }

.user-link { color: #0066cc; text-decoration: none; }
.user-link:hover { text-decoration: underline; }

.add-book-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.add-book-toggle {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
}

.add-book-toggle:hover {
    text-decoration: underline;
}

#add-book-form-container {
    margin-top: 15px;
}

.add-book-form input, .add-book-form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.add-book-form textarea { min-height: 60px; resize: vertical; }

.add-book-form button {
    background: #0066cc;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-book-form button:hover { background: #0052a3; }

.add-book-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.book-list { display: flex; flex-direction: column; gap: 15px; }

.book-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-item.picked {
    border: 2px solid #28a745;
    background: #f0fff4;
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.book-info {
    overflow: auto;
}

.book-thumbnail {
    float: left;
    margin: 0 15px 10px 0;
    max-width: 100px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-info h3 {
    font-size: 20px;
    margin-bottom: 5px;
    color: #333;
}

.book-info .author {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.book-info .description {
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 10px;
}

.book-links {
    margin-top: 8px;
}

.book-links a {
    color: #0066cc;
    font-size: 13px;
    margin-right: 12px;
    text-decoration: none;
}

.book-links a:hover { text-decoration: underline; }

.vote-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-count {
    font-size: 24px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    color: #333;
}

.vote-btn {
    background: #f0f0f0;
    border: 2px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.vote-btn:hover:not(:disabled) { background: #e0e0e0; }

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-btn.active-up {
    background: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

.vote-btn.active-down {
    background: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.comments-toggle {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    padding: 5px 0;
    font-size: 14px;
}

.comments-toggle:hover { text-decoration: underline; }

.comments-list {
    margin-top: 15px;
}

.comment {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.comment-header {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.add-comment {
    margin-top: 15px;
}

.add-comment textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
}

.add-comment button {
    background: #0066cc;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
}

.add-comment button:hover { background: #0052a3; }

.book-meta {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hidden { display: none; }

.login-prompt {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.login-prompt a {
    color: #0066cc;
    text-decoration: none;
}

.login-prompt a:hover { text-decoration: underline; }

/* Admin controls - inline version */
.admin-controls-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-btn-inline {
    background: none;
    color: #999;
    border: 1px solid #ccc;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.admin-btn-inline:hover {
    color: #666;
    border-color: #999;
    background: #f5f5f5;
}

.admin-btn-inline.admin-btn-delete {
    color: #c87d6f;
    border-color: #d4a59a;
}

.admin-btn-inline.admin-btn-delete:hover {
    color: #b35e4d;
    border-color: #c87d6f;
    background: #fef5f4;
}

.comment-delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 10px;
}

.comment-delete-btn:hover {
    background: #c82333;
}

/* Book badges */
.book-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge.picked {
    background: #28a745;
    color: white;
}
