/**
 * Main CSS - Core Layout and Structure
 */

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Main App Container */
#app {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px;
}

/* Header */
#header {
    text-align: center;
    padding: 20px;
    margin-bottom: 10px;
}

.site-title {
    font-size: 2.5rem;
    margin: 10px 0;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.site-tagline {
    font-size: 1.2rem;
    margin: 10px 0;
}

.header-stars {
    font-size: 1.5rem;
    letter-spacing: 10px;
}

/* Marquee Container */
.marquee-container {
    overflow: hidden;
    padding: 10px 0;
    margin-bottom: 10px;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
    padding-left: 100%;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Navigation */
#navigation {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.nav-btn:hover {
    transform: scale(1.1);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Content Wrapper - Sidebar + Main */
.content-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Sidebar */
#sidebar {
    width: 220px;
    flex-shrink: 0;
}

.sidebar-box {
    padding: 15px;
    margin-bottom: 15px;
}

.sidebar-title {
    font-size: 1rem;
    margin: 0 0 10px 0;
    text-align: center;
}

.about-avatar {
    text-align: center;
    margin-bottom: 10px;
}

.avatar-placeholder {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 2rem;
}

.about-text {
    font-size: 0.9rem;
    margin: 0;
    text-align: center;
}

/* Hit Counter */
.hit-counter {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 5px;
}

.counter-digit {
    display: inline-block;
    width: 20px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.visitor-text {
    font-size: 0.8rem;
    text-align: center;
    margin: 5px 0 0;
}

/* Under Construction */
.under-construction {
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
}

.construction-icon {
    display: block;
    font-size: 1.5rem;
    margin: 5px 0;
}

/* Badges */
.badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    padding: 5px 10px;
    font-size: 0.75rem;
    text-align: center;
}

/* WebRing */
.webring {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.webring-arrow {
    font-weight: bold;
}

/* Main Content */
#content {
    flex: 1;
    min-width: 0;
    padding: 20px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.5rem;
}

/* Footer */
#footer {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
}

.footer-text, .footer-email, .footer-made {
    margin: 5px 0;
}

.footer-stars {
    font-size: 1.2rem;
    letter-spacing: 5px;
    margin-top: 10px;
}

/* Rainbow HR */
.rainbow-hr {
    height: 5px;
    border: none;
    margin: 20px 0;
}

/* Common Elements */
.page-title, .section-title {
    text-align: center;
    margin-bottom: 20px;
}

.title-star {
    display: inline-block;
}

/* Welcome Box */
.welcome-box {
    padding: 20px;
    margin-bottom: 20px;
}

.welcome-title {
    text-align: center;
    margin-bottom: 15px;
}

.welcome-content {
    text-align: center;
}

.welcome-content p {
    margin: 10px 0;
}

/* Post Cards */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    padding: 20px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.post-title {
    margin: 0;
    font-size: 1.3rem;
}

.post-title a {
    text-decoration: none;
}

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

.post-category {
    font-size: 0.9rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.post-excerpt {
    margin: 10px 0;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 0.85rem;
    text-decoration: none;
}

.tag:hover {
    text-decoration: underline;
}

.read-more {
    font-weight: bold;
}

/* Single Post View */
.post-full {
    padding: 20px;
}

.post-header-full {
    margin-bottom: 15px;
}

.post-title-full {
    margin: 0 0 15px;
    font-size: 1.8rem;
    text-align: center;
}

.post-meta-full {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.post-meta-extra {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
}

.post-content {
    line-height: 1.8;
    margin: 20px 0;
}

.post-footer-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.post-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.post-nav {
    margin-top: 20px;
    text-align: center;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 40px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-label {
    font-weight: bold;
}

.filter-btn, .tag-btn {
    padding: 5px 12px;
    font-size: 0.85rem;
    text-decoration: none;
}

.filter-text {
    text-align: center;
    margin-bottom: 15px;
}

/* Editor / Form Styles */
.editor-view, .guestbook-view {
    max-width: 700px;
    margin: 0 auto;
}

.post-form, .guestbook-form {
    padding: 20px;
}

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

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn-save, .btn-cancel {
    padding: 12px 30px;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
}

.btn-star {
    display: inline-block;
}

.draft-notice {
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.auto-save-notice {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 15px;
    transition: color 0.3s;
}

/* Guestbook */
.guestbook-intro {
    text-align: center;
    margin-bottom: 20px;
}

.entries-title {
    text-align: center;
    margin: 20px 0;
}

.guestbook-entries {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guestbook-entry {
    padding: 15px;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.entry-name {
    font-weight: bold;
}

.entry-date {
    font-size: 0.85rem;
}

.entry-message {
    margin: 0 0 8px;
    line-height: 1.5;
}

.entry-website {
    margin: 0;
    font-size: 0.9rem;
}

/* Error View */
.error-view {
    text-align: center;
    padding: 50px 20px;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

.error-icon {
    font-size: 4rem;
    margin: 20px 0;
}

.error-content p {
    margin: 10px 0;
}

/* View All Link */
.view-all {
    text-align: center;
    margin-top: 20px;
}

.link-btn {
    font-weight: bold;
}

/* Sparkle Container */
#sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sidebar-box {
        flex: 1;
        min-width: 150px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .site-title {
        font-size: 1.8rem;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}
