* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #6b6b6b 0%, #4a4a4a 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.navigation {
    background: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.nav-link {
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
    background-color: #f0f0f0;
}

.nav-link.active {
    background: linear-gradient(135deg, #6b6b6b 0%, #4a4a4a 100%);
    color: white;
}

.create-post-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

.create-post-section h2 {
    color: #333;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6b6b6b;
}

.btn-submit {
    background: linear-gradient(135deg, #6b6b6b 0%, #4a4a4a 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

.message.success {
    background: #e8e8e8;
    color: #2a2a2a;
    border: 1px solid #c0c0c0;
    display: block;
}

.message.error {
    background: #d0d0d0;
    color: #3a3a3a;
    border: 1px solid #a0a0a0;
    display: block;
}

.posts-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.posts-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.post {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #6b6b6b;
}

.post h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.post-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.post-link:hover {
    color: #4a4a4a;
}

.post-preview {
    margin-bottom: 15px;
}

.read-more {
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.read-more:hover {
    color: #2a2a2a;
}

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.post-meta .author {
    font-weight: 600;
}

.post-content {
    color: #444;
    line-height: 1.6;
    white-space: normal;
}

.no-posts {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1em;
}

.no-posts a {
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 600;
}

.no-posts a:hover {
    text-decoration: underline;
}

.post-detail-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.post-detail {
    margin-bottom: 30px;
}

.post-detail h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2em;
}

.btn-back {
    display: inline-block;
    background: linear-gradient(135deg, #6b6b6b 0%, #4a4a4a 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.error-section {
    background: white;
    padding: 60px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.error-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
}

.error-section p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.login-section {
    background: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

.login-section h2 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .create-post-section,
    .posts-section {
        padding: 20px;
    }
}

.visitor-counter {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.9em;
}

.visitor-counter p {
    margin: 0;
    opacity: 0.9;
}

.visitor-count {
    font-weight: bold;
    font-size: 1.1em;
    color: #ffffff;
}

.format-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.format-help a {
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 600;
}

.format-help a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.modal-content h4 {
    color: #4a4a4a;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.modal-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: #555;
    line-height: 1.8;
}

.modal-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Formatting for rendered content */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #333;
}

.post-content ul,
.post-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.post-content a {
    color: #4a4a4a;
    text-decoration: underline;
}

.post-content a:hover {
    color: #2a2a2a;
}

.post-content blockquote {
    border-left: 4px solid #6b6b6b;
    margin: 10px 0;
    padding: 10px 20px;
    background: #f8f9fa;
    color: #555;
}

.post-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Responsive embed containers */
.post-content iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

/* Calendar Heatmap Styles */
.main-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.posts-column {
    flex: 1;
    min-width: 0;
}

.heatmap-column {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.heatmap-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.heatmap-container h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.heatmap-cell {
    aspect-ratio: 1;
    background: #f0f0f0;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    color: #666;
    cursor: default;
    transition: transform 0.2s;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
}

.heatmap-cell .day-number {
    font-weight: 600;
    font-size: 0.9em;
}

.heatmap-cell .post-count {
    font-size: 0.8em;
    color: #888;
    margin-top: 2px;
}

/* Heatmap intensity levels */
.heatmap-cell.level-0 {
    background: #f0f0f0;
}

.heatmap-cell.level-1 {
    background: #d8d8d8;
}

.heatmap-cell.level-2 {
    background: #b0b0b0;
}

.heatmap-cell.level-3 {
    background: #888888;
    color: white;
}

.heatmap-cell.level-3 .post-count {
    color: #f0f0f0;
}

.heatmap-cell.level-4 {
    background: #606060;
    color: white;
}

.heatmap-cell.level-4 .post-count {
    color: #f0f0f0;
}

.heatmap-cell.level-5 {
    background: #383838;
    color: white;
}

.heatmap-cell.level-5 .post-count {
    color: #f0f0f0;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    font-size: 0.85em;
    color: #666;
}

.legend-label {
    margin-right: 5px;
}

.legend-box {
    width: 15px;
    height: 15px;
    border-radius: 2px;
}

.legend-box.level-0 {
    background: #f0f0f0;
}

.legend-box.level-1 {
    background: #d8d8d8;
}

.legend-box.level-2 {
    background: #b0b0b0;
}

.legend-box.level-3 {
    background: #888888;
}

.legend-box.level-4 {
    background: #606060;
}

.legend-box.level-5 {
    background: #383838;
}

/* Favorite Posts Styles */
.favorite-posts-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

.favorite-posts-container h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

#favorite-posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favorite-post-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.favorite-post-item:hover {
    background: #e9ecef;
}

.favorite-post-rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #6b6b6b 0%, #4a4a4a 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 600;
}

.favorite-post-content {
    flex: 1;
    min-width: 0;
}

.favorite-post-title {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    display: block;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.favorite-post-title:hover {
    color: #4a4a4a;
}

.favorite-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
    color: #666;
}

.favorite-post-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.no-favorites {
    text-align: center;
    color: #999;
    padding: 20px 10px;
    font-size: 0.9em;
}

@media (max-width: 1024px) {
    .main-content-wrapper {
        flex-direction: column;
    }
    
    .heatmap-column {
        width: 100%;
    }
    
    .heatmap-container {
        position: static;
    }
    
    .favorite-posts-container {
        position: static;
    }
}

@media (max-width: 768px) {
    .heatmap-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }
    
    .heatmap-cell {
        font-size: 0.65em;
    }
}
