/* static/index.css */
.index-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 8px;
    color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.discover-link {
    margin-bottom: 20px;
    text-align: center;
}

.discover-link a {
    color: #50c878;
    text-decoration: none;
    font-size: 1.2em;
}

.discover-link a:hover {
    text-decoration: underline;
}

.news-section {
    margin-bottom: 30px;
}

.news-section h2 {
    color: #50c878;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.news-form {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #cccccc;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    color: #f0f0f0;
    border-radius: 4px;
    font-family: Arial, sans-serif;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.btn {
    background: #50c878;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn:hover {
    background: #3da660;
}

.cancel-btn {
    background: #ff5555;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

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

.news-item {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.news-item h3 {
    margin: 0 0 5px;
    font-size: 1.3em;
    color: #50c878;
}

.news-meta {
    color: #cccccc;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.news-content {
    color: #f0f0f0;
}

.news-actions {
    margin-top: 10px;
}

.edit-btn, .cancel-btn {
    background: #50c878;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
}

.edit-btn:hover, .cancel-btn:hover {
    background: #3da660;
}

.cancel-btn {
    background: #ff5555;
}

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

.delete-btn {
    background: #ff5555;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.delete-btn:hover {
    background: #cc4444;
}

.no-news {
    text-align: center;
    color: #cccccc;
    font-size: 1.2em;
}

.communities-section {
    margin-top: 30px;
}

.community-section {
    margin-bottom: 30px;
}

.community-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.community-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.community-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.community-header h2 a {
    color: #50c878;
    text-decoration: none;
}

.community-header h2 a:hover {
    text-decoration: underline;
}

.post-item {
    display: flex;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 4px;
    margin-bottom: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 15px;
}

.vote-arrow {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.vote-arrow img {
    width: 20px;
    height: 20px;
}

.vote-arrow.voted img {
    display: none;
}

.vote-arrow.voted img {
    display: block;
}

.vote-section span {
    margin: 5px 0;
    font-weight: bold;
}

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

.post-content h3 {
    margin: 0 0 5px;
    font-size: 1.2em;
}

.post-content h3 a {
    color: #50c878;
    text-decoration: none;
}

.post-content h3 a:hover {
    text-decoration: underline;
}

.post-content p {
    margin: 5px 0;
    color: #cccccc;
}

.post-content p a {
    color: #50c878;
    text-decoration: none;
}

.post-content p a:hover {
    text-decoration: underline;
}

.post-content .badge {
    height: 1em;
    margin-left: 5px;
    vertical-align: middle;
}

.flair {
    display: inline-block;
    padding: 2px 5px;
    margin-left: 5px;
    font-size: 0.7em;
    border-radius: 3px;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.no-posts {
    text-align: center;
    color: #cccccc;
    font-size: 1.1em;
}

.no-communities {
    text-align: center;
    color: #cccccc;
    font-size: 1.2em;
    margin: 20px 0;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    background: #50c878;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
}

.pagination-btn:hover {
    background: #3da660;
}

.pagination-btn.disabled {
    background: #3a3a3a;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-numbers a {
    padding: 5px 10px;
    color: #50c878;
    text-decoration: none;
    border-radius: 4px;
}

.page-numbers a.active {
    background: #50c878;
    color: #fff;
}

.page-numbers a:hover:not(.active) {
    background: #2a2a2a;
}

.page-numbers span {
    padding: 5px 10px;
    color: #cccccc;
}

.edit-toggle {
    display: none;
}

.edit-toggle-wrapper {
    display: inline-block;
}

.edit-toggle:checked ~ .edit-form-wrapper #edit-form-{{ news.id }} {
    display: block;
}

.edit-form-wrapper {
    display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    .index-container {
        padding: 10px;
    }

    .discover-link a {
        font-size: 1em;
    }

    .news-section h2 {
        font-size: 1.5em;
    }

    .news-form {
        padding: 10px;
    }

    .form-group input,
    .form-group textarea {
        padding: 6px;
        font-size: 0.9em;
    }

    .btn, .cancel-btn, .edit-btn, .delete-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .news-item {
        padding: 10px;
    }

    .news-item h3 {
        font-size: 1.1em;
    }

    .news-meta {
        font-size: 0.8em;
    }

    .community-header h2 {
        font-size: 1.3em;
    }

    .community-icon {
        width: 32px;
        height: 32px;
    }

    .post-item {
        flex-direction: column;
        padding: 10px;
    }

    .vote-section {
        flex-direction: row;
        margin-bottom: 10px;
        margin-right: 0;
    }

    .vote-section span {
        margin: 0 10px;
    }

    .vote-arrow img {
        width: 16px;
        height: 16px;
    }

    .post-content h3 {
        font-size: 1.1em;
    }

    .post-content p {
        font-size: 0.9em;
    }

    .pagination-controls {
        gap: 5px;
    }

    .pagination-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .page-numbers a, .page-numbers span {
        padding: 3px 8px;
        font-size: 0.9em;
    }
}
