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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 70px;
    height: 36px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.98);
}

body.dark-mode .theme-toggle {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .theme-toggle:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.dark-mode .theme-toggle-slider {
    transform: translateX(34px);
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-icon {
    font-size: 16px;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon.sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg) scale(0.5);
}

.theme-icon.moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

body.dark-mode .theme-icon.sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

body.dark-mode .theme-icon.moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg) scale(0.5);
}

.theme-icon i {
    color: #dc2626;
    transition: color 0.3s ease;
}

.theme-icon.sun i {
    color: #fbbf24;
}

body.dark-mode .theme-icon.sun i {
    color: #fbbf24;
}

body.dark-mode .theme-icon.moon i {
    color: #dc2626;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
    min-height: 100vh;
}

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

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }
    .sidebar {
        width: 100%;
    }
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 60px;
        height: 32px;
    }
    
    .theme-toggle-slider {
        width: 26px;
        height: 26px;
    }
    
    body.dark-mode .theme-toggle-slider {
        transform: translateX(28px);
    }
    
    .theme-icon {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 10px;
        gap: 15px;
    }
    .post-item {
        padding: 25px;
        margin-bottom: 20px;
    }
    .post-title {
        font-size: 1.5rem;
    }
    .posts-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .header {
        padding: 25px 20px;
    }
    .header h1 {
        font-size: 2rem;
    }
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 56px;
        height: 30px;
    }
    
    .theme-toggle-slider {
        width: 24px;
        height: 24px;
    }
    
    body.dark-mode .theme-toggle-slider {
        transform: translateX(26px);
    }
    
    .theme-icon {
        font-size: 13px;
    }
}

.header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    color: white;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.stat-label {
    opacity: 0.9;
    font-size: 0.85rem;
}

.sidebar-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.sidebar-card:hover {
    transform: translateY(-2px);
}

body.dark-mode .sidebar-card {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.sidebar-card h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

body.dark-mode .sidebar-card h2 {
    color: #f4f4f5;
}

body.dark-mode .feed-info h3 {
    color: #dc2626;
}

body.dark-mode .feed-info p {
    color: #a1a1aa;
}

body.dark-mode .post-author {
    color: #dc2626;
}

body.dark-mode .post-date {
    color: #71717a;
}

.feed-stats h2 {
    margin-bottom: 15px;
    color: #333;
}

.feed-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-info h3 {
    color: #dc2626;
    margin-bottom: 3px;
    font-size: 1rem;
}

.feed-link {
    color: inherit;
    text-decoration: none;
}

.feed-link:hover {
    text-decoration: underline;
}

.feed-info p {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.post-count {
    background: #dc2626;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    display: inline-block;
}

.posts-container {
    background: transparent;
    border-radius: 4px;
    box-shadow: none;
    overflow: visible;
}

.posts-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15);
}

.refresh-btn {
    background: white;
    color: #dc2626;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background: #f5f5f5;
}

.post-item {
    padding: 40px;
    margin-bottom: 30px;
    border: none;
    transition: all 0.3s ease;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

body.dark-mode .post-item {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.post-item:last-child {
    border-bottom: none;
}

.post-title {
    color: #333;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
    line-height: 1.3;
}

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

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

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

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

.post-date {
    color: #999;
}

.post-description {
    color: #333;
    line-height: 1.7;
    font-size: 1rem;
    margin-top: 20px;
}

body.dark-mode .post-description {
    color: #e4e4e7;
}

body.dark-mode .post-description a {
    color: #dc2626;
}

body.dark-mode .post-description blockquote {
    border-left-color: #dc2626;
    color: #a1a1aa;
}

body.dark-mode .post-description code {
    background: #3f3f46;
    color: #f4f4f5;
}

body.dark-mode .post-description pre {
    background: #1f1f21;
    border-color: #3f3f46;
}

.post-description p {
    margin-bottom: 20px;
    text-align: justify;
}

.post-description p:last-child {
    margin-bottom: 0;
}

.post-description h1, .post-description h2, .post-description h3 {
    margin: 25px 0 15px 0;
    color: #333;
    font-weight: 600;
}

.post-description h1 { font-size: 1.5rem; }
.post-description h2 { font-size: 1.3rem; }
.post-description h3 { font-size: 1.1rem; }

.post-description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-description a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
}

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

.post-description blockquote {
    border-left: 4px solid #dc2626;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.post-description ul, .post-description ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-description li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.post-description code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-description pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

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

/* Expand/Collapse Button Styles */
.expand-btn {
    background: transparent;
    color: #666;
    border: 1px solid #e5e5e5;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.85rem;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: none;
    display: inline-block;
    text-align: center;
    width: 100%;
    max-width: none;
}

body.dark-mode .expand-btn {
    color: #a1a1aa;
    border-color: #3f3f46;
    background: transparent;
}

.expand-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

body.dark-mode .expand-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border-color: #dc2626;
}

.expand-btn:active {
    transform: translateY(0);
}

/* Responsive styles for expand button */
@media (max-width: 768px) {
    .expand-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .expand-btn {
        padding: 10px 12px;
        font-size: 0.75rem;
        margin-top: 10px;
    }
}

.loading {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
}

body.dark-mode .loading {
    color: #a1a1aa;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

body.dark-mode .loading-spinner {
    border-color: #3f3f46;
    border-top-color: #dc2626;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #dc2626;
    color: white;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.last-updated {
    color: #666;
    font-size: 0.8rem;
    margin-top: 15px;
    text-align: center;
}

/* Load More Button Styles */
.load-more-container {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #e5e5e5;
}

body.dark-mode .load-more-container {
    border-top-color: #3f3f46;
}

.load-more-btn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.load-more-btn:active {
    transform: translateY(0);
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 0.9rem;
}

body.dark-mode .loading-more {
    color: #a1a1aa;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

body.dark-mode .loading-spinner-small {
    border-color: #3f3f46;
    border-top-color: #dc2626;
}

/* Year Statistics */
.year-stats {
    margin-top: 20px;
}

.year-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

body.dark-mode .year-stat-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.year-stat-item:last-child {
    border-bottom: none;
}

.year-stat-year {
    font-weight: 600;
    color: #dc2626;
    font-size: 0.95rem;
}

.year-stat-count {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* Links */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.links-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fafafa;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.links-item:hover {
    border-color: #dc2626;
    background: #fff;
    transform: translateY(-1px);
}

body.dark-mode .links-item {
    background: #1f1f1f;
    border-color: #3f3f46;
    color: #e4e4e7;
}

body.dark-mode .links-item:hover {
    border-color: #dc2626;
    background: #262626;
}

.links-icon {
    width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
}

.links-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Responsive adjustments for load more */
@media (max-width: 640px) {
    .load-more-container {
        padding: 30px 15px;
    }
    
    .load-more-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}
