* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.site-header a {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.5px;
}

.logo img {
    max-height: 40px;
    vertical-align: middle;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    padding: 8px 12px;
    border: 1px solid #000000;
    border-radius: 0;
    outline: none;
}

.notifications-wrapper {
    position: relative;
    cursor: pointer;
    color: #000;
}

.unread-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: #000000;
    color: #ffffff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.btn {
    padding: 10px 24px;
    border: 1px solid #000000;
    background-color: transparent;
    color: #000000;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
    border-radius: 0;
}

.btn:hover {
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
}

.btn-primary {
    background-color: #000000;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #333333;
    border-color: #333333;
}

.btn-secondary {
    background-color: #ffffff;
    color: #000000;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    color: #000000;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.875rem;
}

.w-100 { width: 100%; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.d-none { display: none !important; }

.hero {
    background-color: #f9f9f9;
    padding: 100px 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.hero h1 {
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: #555555;
    max-width: 600px;
    margin: 0 auto 40px auto;
}

.post-item, .topic-item, .product-card {
    border: 1px solid #e0e0e0;
    padding: 24px;
    margin-bottom: 20px;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease;
}

.post-item:hover, .topic-item:hover, .product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.post-layout {
    display: flex;
    gap: 24px;
}

.post-sidebar {
    width: 180px;
    flex-shrink: 0;
    text-align: center;
    border-right: 1px solid #f0f0f0;
    padding-right: 24px;
}

.post-sidebar .avatar-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    overflow: hidden;
}

.post-sidebar .avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-sidebar .author-name {
    display: block;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    margin-bottom: 4px;
    word-break: break-word;
}

.post-sidebar .author-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 12px;
}

.post-sidebar .author-signature {
    font-size: 0.8rem;
    color: #777;
    font-style: italic;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    margin-top: 8px;
}

.post-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: #666666;
}

.post-header .author {
    font-weight: 600;
    color: #000000;
}

.topic-item a {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000000;
    text-decoration: none;
    margin-bottom: 8px;
}

.topic-item a:hover {
    text-decoration: underline;
}

.topic-item .meta {
    font-size: 0.875rem;
    color: #666666;
}

details {
    border: 1px solid #e0e0e0;
    padding: 16px;
    margin: 16px 0;
    background: #f9f9f9;
}

summary {
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.wysiwyg-container {
    border: 1px solid #000000;
    margin-bottom: 16px;
}

.wysiwyg-toolbar {
    background: #f9f9f9;
    padding: 8px;
    border-bottom: 1px solid #000000;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wysiwyg-toolbar button {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.875rem;
}

.wysiwyg-toolbar button:hover {
    background: #f0f0f0;
}

.wysiwyg-editor {
    min-height: 200px;
    padding: 16px;
    outline: none;
}

.draft-status {
    font-size: 0.875rem;
    color: #666666;
    margin-bottom: 16px;
}

.new-posts-toast {
    background-color: #000000;
    color: #ffffff;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    margin-bottom: 24px;
}

.site-footer {
    border-top: 1px solid #e0e0e0;
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    font-size: 0.875rem;
    color: #666666;
}

.site-footer a {
    color: #000000;
    margin: 0 16px;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.auth-box {
    background: #ffffff;
    padding: 40px;
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: 480px;
}

.auth-box h2 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #000000;
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-width: 2px;
    padding: 11px;
}

.form-error {
    background-color: #000000;
    color: #ffffff;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.875rem;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
}

.auth-links a {
    color: #000000;
    font-weight: 600;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 32px;
    border: 1px solid #000000;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.close-modal {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.public-toast {
    visibility: hidden;
    min-width: 300px;
    background-color: #000000;
    color: #ffffff;
    text-align: center;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    right: 24px;
    bottom: 24px;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(20px);
}

.public-toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.attachment-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #e0e0e0;
}

.attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-attachment {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #000000;
    color: #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    margin-top: 40px;
}

.filter-group {
    margin-bottom: 32px;
}

.filter-group h4 {
    margin-top: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
}

.product-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 16px 0;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid #000000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 16px;
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    background: #f9f9f9;
}

.notifications-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f5f5f5;
}

.notification-item.unread {
    background: #f0f8ff;
    border-left: 3px solid #000000;
}

.notification-item .text {
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.notification-item .date {
    font-size: 0.75rem;
    color: #666666;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    margin-bottom: 16px;
}

.cart-summary {
    background: #f9f9f9;
    padding: 24px;
    border: 1px solid #e0e0e0;
    height: fit-content;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.25rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
    margin-top: 16px;
}

.profile-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #666666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #000000;
}

.tab-btn.active {
    color: #000000;
    border-bottom-color: #000000;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

.avatar-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.avatar-sm {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #000;
}

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.text-muted { color: #666666; }
.text-dark { color: #000000; }
.text-decoration-none { text-decoration: none; }
.border { border: 1px solid #e0e0e0; }
.border-bottom { border-bottom: 1px solid #e0e0e0; }
.p-3 { padding: 16px; }
.pb-2 { padding-bottom: 8px; }
.mb-0 { margin-bottom: 0; }
.m-0 { margin: 0; }
.ms-2 { margin-left: 8px; }

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    .shop-layout, .cart-layout, .product-main-info {
        grid-template-columns: 1fr !important;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .post-layout {
        flex-direction: column;
    }
    .post-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding-right: 0;
        padding-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
    }
    .post-sidebar .avatar-container {
        margin: 0;
    }
    .post-sidebar .author-signature {
        display: none;
    }
}