/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f0f0;
    transition:
        background-color 0.3s,
        color 0.3s;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header.dark-mode {
    background-color: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 1.8rem;
    color: #ff4500;
    margin: 0;
    flex-grow: 0;
    flex-shrink: 0;
}

.header.dark-mode h1 {
    color: #ff6b35;
}

.content {
    padding: 20px 0;
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* New rectangular post card design */
.post-card {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

.post-card.dark-mode {
    background-color: #2d2d2d;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.post-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.post-card.dark-mode:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.post-content {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #000;
    text-decoration: none;
    display: block;
    flex-grow: 1;
}

.post-title.dark-mode {
    color: #e0e0e0;
}

.post-title:hover {
    color: #ff4500;
}

.post-title.dark-mode:hover {
    color: #ff6b35;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle.dark-mode {
    background-color: #404040;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dark-mode-toggle:hover {
    background-color: #e0e0e0;
}

.dark-mode-toggle.dark-mode:hover {
    background-color: #505050;
}

.dark-mode-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.dark-mode-toggle.dark-mode .dark-mode-icon {
    transform: rotate(180deg);
}

.post-image-container {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.post-image-container.dark-mode {
    background-color: #3a3a3a;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.image-placeholder {
    color: #999;
    font-size: 1.2rem;
}

.post-content.dark-mode {
    background-color: #2d2d2d;
}

.post-buttons {
    display: flex;
    gap: 6px;
    padding: 0 12px 12px;
    flex-wrap: wrap;
    align-self: flex-start;
    margin-top: 4px;
}

.post-button {
    background-color: #ff4500;
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.post-button.dark-mode {
    background-color: #ff6b35;
}

.post-button:hover {
    background-color: #e03d00;
}

.post-button.dark-mode:hover {
    background-color: #ff7b45;
}

/* Limit body length on wider displays */
@media (min-width: 769px) {
    .post-content {
        max-height: 15vh; /* About 1/6 screen height for wide displays */
        overflow-y: auto;
        padding: 12px;
    }

    .post-card {
        min-height: 100px;
    }
}

/* Mobile responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .header {
        padding: 10px 0;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .post-content {
        padding: 10px;
    }

    .post-title {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .post-image-container {
        height: 100px;
        margin-bottom: 6px;
    }

    .post-buttons {
        padding: 0 10px 10px;
    }

    .post-button {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .post-image-container {
        height: 80px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

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

    .post-card {
        min-height: 90px;
    }
}

/* Loading and no more messages */
.loading,
.no-more {
    text-align: center;
    padding: 20px;
    font-size: 1.1rem;
    color: #666;
}

.loading.dark-mode,
.no-more.dark-mode {
    color: #aaa;
}

.hidden {
    display: none;
}
