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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #dae0e6;
    line-height: 1.6;
}

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

.header {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.header h1 {
    color: #ff4500;
    font-size: 2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f6f7f8;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card i {
    font-size: 1.5rem;
    color: #ff4500;
}

.stat-card .stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a1a1b;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #7c7c7c;
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.toggle-buttons {
    display: flex;
    gap: 15px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.toggle-btn {
    padding: 12px 28px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #7c7c7c;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn.active {
    background: #ff4500;
    color: white;
}

.toggle-btn:nth-of-type(2).active {
    background: linear-gradient(135deg, #0079d3, #00a5ff);
    color: white;
}

.toggle-btn:not(.active):hover {
    background: #f6f7f8;
    color: #1a1a1b;
}

.image-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 8px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.image-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1b;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ff4500;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.slider-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1b;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 15px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    gap: 8px;
    flex: 1;
    max-width: 400px;
    min-width: 180px;
}

.search-bar i {
    color: #7c7c7c;
    font-size: 0.8rem;
}

.search-bar input {
    border: none;
    outline: none;
    font-size: 0.85rem;
    padding: 5px 0;
    width: 100%;
    background: transparent;
}

.search-bar input::placeholder {
    color: #b0b0b0;
}

.clear-search {
    cursor: pointer;
    color: #7c7c7c;
    font-size: 0.7rem;
    display: none;
    flex-shrink: 0;
}

.clear-search:hover {
    color: #ff4500;
}

.sort-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 6px 15px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sort-toggle:hover {
    background: #f6f7f8;
}

.sort-toggle-label {
    font-size: 0.8rem;
    color: #7c7c7c;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.sort-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sort-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 20px;
}

.sort-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .sort-slider {
    background-color: #ff4500;
}

input:checked + .sort-slider:before {
    transform: translateX(20px);
}

.slider-section {
    margin-bottom: 35px;
}

.slider-container {
    position: relative;
}

.slider-wrapper {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.slider-wrapper::-webkit-scrollbar {
    height: 8px;
}

.slider-wrapper::-webkit-scrollbar-track {
    background: #edeff1;
    border-radius: 10px;
}

.slider-wrapper::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 10px;
}

.items-slider {
    display: flex;
    gap: 20px;
    padding: 5px 0 15px;
}

.item-card {
    flex: 0 0 220px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.item-card.hidden {
    display: none;
}

.item-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #ff4500, #ff6b35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.subreddit-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-icon {
    background: linear-gradient(135deg, #0079d3, #00a5ff);
}

.user-icon i {
    font-size: 2rem;
    color: white;
}

.item-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a1a1b;
    margin-bottom: 8px;
}

.item-stats {
    font-size: 0.8rem;
    color: #7c7c7c;
}

.item-stats span {
    display: block;
    margin-top: 4px;
}

.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    color: #7c7c7c;
    font-size: 0.9rem;
}

.no-results i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.feed-section {
    background: transparent;
}

.feed-header {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.feed-header h2 {
    font-size: 1.2rem;
    color: #1a1a1b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.post-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.post-title a {
    color: #1a1a1b;
    text-decoration: none;
}

.post-title a:hover {
    color: #0079d3;
    text-decoration: underline;
}

.post-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #7c7c7c;
    margin-bottom: 12px;
    align-items: center;
}

.post-context {
    color: #0079d3;
    font-weight: 500;
    text-decoration: none;
}

.post-context:hover {
    text-decoration: underline;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #7c7c7c;
    text-decoration: none;
}

.post-author:hover {
    color: #0079d3;
    text-decoration: underline;
}

.post-author.deleted {
    color: #ff4500;
}

.post-tag {
    background: #e9f0f5;
    color: #0079d3;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.post-image-preview {
    margin-top: 12px;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.3s;
}

.post-image-preview img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
}

.post-image-preview.blurred img {
    filter: blur(20px);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 8px;
}

.post-image-preview.blurred:hover .image-overlay {
    opacity: 1;
}

.image-overlay span {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.post-text-preview {
    margin-top: 12px;
    padding: 15px;
    background: #f6f7f8;
    border-radius: 8px;
    color: #5a5a5a;
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.2s;
}

.post-text-preview:hover {
    background: #e9e9e9;
}

.post-text-preview i {
    color: #7c7c7c;
    margin-right: 6px;
}

.image-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e9f0f5;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    color: #0079d3;
    margin-left: 8px;
}

.empty-message {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 12px;
    color: #7c7c7c;
}

.empty-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .item-card {
        flex: 0 0 180px;
        padding: 15px;
    }
    
    .item-icon {
        width: 45px;
        height: 45px;
    }
    
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toggle-buttons {
        width: 100%;
    }
    
    .toggle-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    
    .image-toggle {
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .slider-title {
        margin-bottom: 10px;
    }
    
    .header-controls {
        width: 100%;
        justify-content: stretch;
    }
    
    .search-bar {
        max-width: none;
        flex: 1;
    }
    
    .sort-toggle {
        flex-shrink: 1;
    }
}