/* Moved from inline styles in index.html */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #dae0e6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.post-card {
    display: flex;
    padding: 10px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: #898989;
}

.post-content-wrapper {
    flex: 1;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input, select, button {
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    background: #ff4500; /* Reddit orange */
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover {
    background: #cc3700;
}

.vote-btn {
    color: #878A8C;
    font-size: 24px;
    padding: 4px;
    transition: color 0.2s;
}

.vote-btn:hover, .vote-btn.active {
    color: #ff4500;
}

.vote-btn.active.downvote {
    color: #7193ff;
}

.vote-count {
    font-size: 12px;
    font-weight: bold;
    color: #1A1A1B;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

.post-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a1a1b;
}

.post-content {
    color: #1a1a1b;
    line-height: 1.5;
}

.post-meta {
    color: #787c7e;
    font-size: 0.8em;
    margin-top: 10px;
}

.header {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-bottom: 1px solid #edeff1;
}

.logo {
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

.subreddit-selector {
    margin-bottom: 10px;
    width: 100%;
    border: 1px solid #edeff1;
    background: #f6f7f8;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    max-height: 800px;
    overflow-y: auto;
}

.comment {
    padding: 8px;
    margin: 4px 0;
    border-radius: 4px;
    border-left: 4px solid #ff4500;
}

.comment-meta {
    color: #787c7e;
    font-size: 12px;
    font-weight: 500;
}

.votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 15px;
    padding: 5px;
}

.vote-btn.small {
    font-size: 16px;
}

.vote-count.small {
    font-size: 10px;
}

.comment-form {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.comment-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

.submit-comment-btn {
    background: #ff4500;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.submit-comment-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.toggle-comments-btn {
    background: #f8f9fa;
    color: #0079d3;
    border: 1px solid #0079d3;
    margin: 10px 0;
}

.user-comment {
    display: flex;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
}

.comment-votes {
    padding: 0 5px;
}

.comment-time {
    color: #888;
    font-size: 0.8em;
    margin-left: 5px;
}

.ai-comment {
    background: #f8f9fa;
    border-left: 3px solid #cccccc;
}

.comment-content {
    flex: 1;
}

.generated-image {
    max-width: 100%;
    margin-top: 15px;
    border-radius: 4px;
}

.generate-image-btn {
    background: #ff4500;
    margin-top: 10px;
}

.generate-image-btn:hover {
    background: #ff5722;
}

.image-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 4px;
}

.preview-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.clear-image {
    background: #ff4500;
    padding: 5px 10px;
    font-size: 0.8em;
}

.special-guests {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.guest-profile {
    display: flex;
    align-items: start;
    gap: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin: 10px 0;
}

.guest-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.guest-info {
    flex: 1;
}

.guest-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.guest-description {
    color: #666;
    line-height: 1.4;
}

.view-mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.view-mode-switch button {
    flex: 1;
    background: #f8f9fa;
    color: #1a1a1b;
}

.view-mode-switch button.active {
    background: #0079d3;
    color: white;
}

.username-section {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.custom-username-input {
    width: 100%;
    margin-top: 10px;
}

.achievements-panel {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.achievement {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    opacity: 0.6;
    filter: grayscale(1);
    transition: all 0.3s ease;
}

.achievement.earned {
    opacity: 1;
    filter: none;
    background: #e8f5e9;
}

.achievement-icon {
    font-size: 24px;
    margin-right: 10px;
    min-width: 40px;
    text-align: center;
}

.achievement-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.achievement-description {
    font-size: 0.9em;
    color: #666;
}

.achievement-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.5s ease-out;
}

.achievement-popup-content {
    display: flex;
    align-items: center;
}

.achievement-popup .achievement-icon {
    font-size: 32px;
}

.achievement-popup .achievement-title {
    color: #e8f5e9;
    font-size: 0.9em;
}

.achievement-popup .achievement-name {
    font-weight: bold;
    margin: 4px 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile responsiveness improvements */
@media (max-width: 600px) {
    .view-mode-switch {
        flex-direction: column;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .guest-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}