/* Retas - CSS */

:root {
    --bg-color: #f6f6ef;
    --header-bg: #2e7d32;
    --text-color: #000;
    --link-color: #000;
    --meta-color: #828282;
    --border-color: #2e7d32;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
}

.container {
    max-width: 85%;
    margin: 0 auto;
    background: white;
    padding: 0;
}

/* Header/Nav */
.header {
    background-color: var(--header-bg);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    flex: 1;
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-brand {
    font-weight: bold;
    font-size: 11pt;
    color: #fff;
    text-decoration: none;
    margin-right: 8px;
    padding: 3px 0;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
}

.nav-links a:hover {
    text-decoration: none;
}

.nav-user {
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-user a {
    color: #fff;
    text-decoration: none;
}

/* Nav button style */
.nav-btn {
    background: transparent;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 9pt;
    margin: 0 2px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.1);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main content */
main {
    padding: 10px;
}

/* Post list pages (shared styles for home, tag posts, search, user posts, etc.) */
.post-list-page {
    max-width: 85%;
}

.post-list-page ol {
    padding-left: 20px;
    margin: 0;
}

.post-list-page .more {
    margin: 20px 0;
    padding-left: 40px;
}

.post-list-page .more a {
    color: var(--link-color);
}

.post-item {
    padding: 2px 0;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.vote {
    width: 20px;
    text-align: center;
}

.upvote {
    color: var(--meta-color);
    cursor: pointer;
    text-decoration: none;
}

.upvote:hover {
    color: var(--header-bg);
}

.upvote.voted {
    color: var(--header-bg);
}

.upvote-disabled {
    color: #ddd;
}

.post-content {
    display: flex;
    flex-direction: column;
}

.title {
    margin-bottom: 2px;
}

.title a.post-link {
    color: var(--link-color);
    text-decoration: none;
}

.title a.post-link:visited {
    color: var(--meta-color);
}

.domain {
    font-size: 8pt;
    color: var(--meta-color);
}

.domain a {
    color: var(--meta-color);
}

.meta {
    font-size: 7pt;
    color: var(--meta-color);
}

.meta a {
    color: var(--meta-color);
    text-decoration: none;
}

.meta a:hover {
    text-decoration: underline;
}

/* Post detail */
.post-detail {
    padding: 10px;
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.post-header h1 {
    font-size: 10pt;
    margin: 0;
    font-weight: normal;
}

.post-meta {
    font-size: 7pt;
    color: var(--meta-color);
    margin: 4px 0;
}

.post-meta a {
    color: var(--meta-color);
}

.post-text {
    margin: 15px 0;
    line-height: 1.4;
}

/* Tags */
.tag-container {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 4px;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: var(--meta-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 7pt;
    text-decoration: none;
    border: 1px solid #ddd;
    font-weight: normal;
}

.tag:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

/* Pseudo-tags for post types */
.tag.tag-pseudo {}

.tag.tag-ask {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.tag.tag-ask:hover {
    background: #bbdefb;
    border-color: #64b5f6;
}

.tag.tag-show {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #81c784;
}

.tag.tag-show:hover {
    background: #c8e6c9;
    border-color: #66bb6a;
}

.tag.tag-job {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffb74d;
}

.tag.tag-job:hover {
    background: #ffe0b2;
    border-color: #ffa726;
}

/* Tags page */
.tags-page {
    max-width: 800px;
}

.tags-page .intro {
    color: var(--meta-color);
    margin-bottom: 20px;
}

.tag-search {
    margin-bottom: 20px;
}

.tag-search input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 10pt;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tag-search input:focus {
    outline: none;
    border-color: var(--header-bg);
}

.tag-groups {
    margin-top: 20px;
}

.tag-group {
    margin-bottom: 30px;
}

.tag-group h2 {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-color);
}

.tag-group .tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-item {
    display: block;
    line-height: 1.6;
}

.tag-description {
    color: var(--meta-color);
    font-size: 8pt;
}

.tag-inactive {
    opacity: 0.5;
    background: #f8f8f8;
    color: #aaa;
    border-color: #e8e8e8;
}

.tag-inactive:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.tag-description-inactive {
    color: #999;
}

/* Tag posts page - specific styles */
.tag-posts-page h1 {
    font-size: 12pt;
    font-weight: normal;
    margin-bottom: 15px;
}

.tag-posts-page h1 .tag {
    font-size: 12pt;
    font-weight: bold;
    padding: 3px 8px;
}

.tag-posts-page h1 .tag-description {
    color: var(--meta-color);
    font-size: 9pt;
    font-weight: normal;
    margin-left: 6px;
}

/* User posts page - specific styles */
.user-posts-page h1 {
    font-size: 12pt;
    margin-bottom: 15px;
}


/* Comments */
.comments {
    margin-top: 20px;
}

.comment {
    margin: 10px 0;
    padding: 5px 0;
}

.comment-header {
    font-size: 8pt;
    color: var(--meta-color);
}

.comment-header a {
    color: var(--meta-color);
    text-decoration: none;
}

.comment-header a.author {
    color: var(--link-color);
}

.comment-text {
    margin: 5px 0;
    line-height: 1.4;
}

.comment-form,
.reply-form {
    margin: 10px 0;
}

.comment-form textarea,
.reply-form textarea {
    width: 100%;
    max-width: 500px;
    font-family: monospace;
}

/* Auth forms */
.auth-form,
.submit-form {
    max-width: 400px;
    margin: 20px auto;
}

.auth-form h2,
.submit-form h2 {
    font-size: 12pt;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 4px;
    font-size: 10pt;
}

.form-group select {
    background: white;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* Searchable tag dropdown */
.tag-dropdown {
    position: relative;
    width: 100%;
}

.tag-dropdown-input {
    width: 100%;
    padding: 4px;
    font-size: 10pt;
    border: 1px solid #ccc;
    cursor: text;
}

.tag-dropdown-input:focus {
    outline: none;
    border-color: var(--header-bg);
}

.tag-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    z-index: 100;
}

.tag-dropdown-item {
    padding: 6px 8px;
    cursor: pointer;
    font-size: 9pt;
}

.tag-dropdown-item:hover,
.tag-dropdown-item.highlighted {
    background: #f0f0f0;
}

.tag-dropdown-item[data-value=""] {
    color: var(--meta-color);
    font-style: italic;
}

.form-group small {
    display: block;
    color: var(--meta-color);
    font-size: 8pt;
    margin-top: 3px;
}

button {
    background: var(--header-bg);
    color: white;
    border: none;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 10pt;
}

button:hover {
    opacity: 0.9;
}

/* User profile */
.user-profile {
    max-width: 600px;
}

.profile-info {
    margin: 15px 0;
}

.profile-info td {
    padding: 2px 10px 2px 0;
    vertical-align: top;
}

.profile-links {
    margin-top: 15px;
}

.profile-links a {
    color: var(--meta-color);
}

/* Search */
.search-form {
    margin-bottom: 15px;
}

.search-form input {
    padding: 4px;
    font-size: 10pt;
    width: 300px;
}

/* Messages */
.error {
    color: #c00;
    padding: 10px;
    margin-bottom: 10px;
    background: #fee;
}

.success {
    color: #080;
    padding: 10px;
    margin-bottom: 10px;
    background: #efe;
}

/* Footer */
footer {
    padding: 10px;
    text-align: center;
}

footer hr {
    border: none;
    border-top: 2px solid var(--header-bg);
    margin: 20px 0;
}

footer a {
    color: var(--link-color);
    text-decoration: none;
}

/* Saved items */
.saved-comment {
    padding: 10px;
    margin: 10px 0;
    border-left: 2px solid var(--meta-color);
}

.comment-meta {
    font-size: 8pt;
    color: var(--meta-color);
    margin-top: 5px;
}

.comment-meta a {
    color: var(--meta-color);
}

/* Moderation - Removed content */
.removed-badge {
    color: #c00;
    font-weight: bold;
    font-size: 8pt;
}

.restored-badge {
    color: #080;
    font-weight: bold;
    font-size: 8pt;
}

.removed-notice {
    background: #fee;
    border: 1px solid #fcc;
    padding: 10px;
    margin-bottom: 10px;
    color: #c00;
}

.removed-content {
    color: #999;
    font-style: italic;
}

.mod-action {
    color: #c00 !important;
}

.mod-action:hover {
    text-decoration: underline;
}

.delete-action {
    color: var(--meta-color) !important;
}

.delete-action:hover {
    color: #c00 !important;
    text-decoration: underline;
}

/* Removed post styling */
.post-removed {
    opacity: 0.7;
    background: #fafafa;
}

/* Removed comment styling */
.comment-removed {
    opacity: 0.7;
    background: #fafafa;
    border-left: 2px solid #fcc;
    padding-left: 8px;
}

.comment-removed .comment-text {
    color: #999;
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger:hover span {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Nav menu container */
.nav-menu {
    display: flex;
    flex: 1;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }

    .header {
        flex-wrap: wrap;
        position: relative;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background-color: var(--header-bg);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 8px 12px;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-links .nav-btn {
        display: block;
        width: 100%;
        padding: 10px;
        margin: 0;
        border-radius: 0;
        text-align: left;
    }

    .nav-links .nav-btn:hover {
        background: rgba(0, 0, 0, 0.2);
    }

    .nav-user {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        gap: 0;
    }

    .nav-user .nav-btn {
        display: block;
        width: 100%;
        padding: 10px;
        margin: 0;
        border-radius: 0;
        text-align: left;
    }

    .nav-user .nav-btn:hover {
        background: rgba(0, 0, 0, 0.2);
    }

    /* Hamburger animation when active */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}