/*
Theme Name: Reddit Stories
Theme URI: https://redditstories.net
Description: Full-featured theme with dark mode, reactions, infinite scroll, and AMP support
Author: Reddit Stories
Version: 3.0
License: GNU General Public License v2 or later
Text Domain: reddit-stories
*/

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #667eea;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #718096;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 25px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --secondary-color: #a78bfa;
    --accent-color: #818cf8;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --card-bg: #2d3748;
    --border-color: #4a5568;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 25px rgba(0,0,0,0.5);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--bg-primary);
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-title span {
    opacity: 0.9;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    position: relative;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.dark-mode-toggle .sun-icon,
.dark-mode-toggle .moon-icon {
    position: absolute;
    font-size: 1.2rem;
    transition: opacity var(--transition), transform var(--transition);
}

.dark-mode-toggle .moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .dark-mode-toggle .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .dark-mode-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Navigation */
.main-navigation ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: opacity var(--transition);
}

.main-navigation a:hover {
    opacity: 0.8;
}

.main-navigation li {
    position: relative;
}

.main-navigation ul ul {
    position: absolute;
    top: 100%;
    right: 0 !important;
    left: auto !important;
    background: #764ba2;
    min-width: 200px;
    padding: 0.5rem 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 9999;
    flex-direction: column !important;
    display: none;
}

.main-navigation li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: flex !important;
    flex-direction: column !important;
}

/* Third level menus (if any) */
.main-navigation ul ul ul {
    top: 0;
    right: 100%;
    left: auto;
}

.main-navigation ul ul li {
    display: block !important;
    width: 100% !important;
    flex: none !important;
}

.main-navigation ul ul a {
    padding: 0.7rem 1.25rem;
    display: block;
    white-space: nowrap;
}

.main-navigation ul ul a:hover {
    background: rgba(255,255,255,0.1);
}

.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem 0 1rem !important;
}

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

.hero-title {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.hero-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.carousel-track {
    position: relative;
    min-height: 130px !important;
    max-height: 150px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.hero-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

.hero-card-image {
    height: 150px;
    overflow: hidden;
    display: none; /* Hidden by default since no images */
}

.hero-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

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

.hero-card-content {
    padding: 0.875rem 1rem !important;
}

.hero-card-categories {
    margin-bottom: 0.25rem;
}

.hero-card-title {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin: 0.25rem 0 0.5rem 0 !important;
    line-height: 1.3;
}

.hero-card-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.hero-card-meta span {
    color: #4a5568; /* Darker color for better contrast */
}

[data-theme="dark"] .hero-card-meta span {
    color: #cbd5e0; /* Lighter for dark mode */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    z-index: 10;
}

.carousel-btn:hover {
    background: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev { left: -45px; }
.carousel-next { right: -45px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-bottom: 0.25rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    /* Increase touch target size while keeping visual size */
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.carousel-dot::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all var(--transition);
}

.carousel-dot.active::before {
    background: white;
    transform: scale(1.3);
}

/* Remove the old background since we use ::before now */
.carousel-dot {
    background: transparent;
}

.carousel-dot.active {
    background: transparent;
    transform: none;
}

/* ===== MAIN CONTAINER ===== */
.site-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.site-main {
    min-width: 0;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    flex: 1;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.layout-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--card-bg);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.layout-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-btn:hover,
.layout-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ===== CONTINUE READING ===== */
.continue-reading {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.continue-reading h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.continue-reading-posts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.continue-reading-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}

.continue-reading-item:hover {
    background: var(--primary-color);
    color: white;
}

.continue-title {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
}

.continue-reading-item:hover .continue-title {
    color: white;
}

.continue-progress {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.continue-reading-item:hover .continue-progress {
    color: rgba(255,255,255,0.8);
}

/* ===== POSTS ===== */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.posts-container.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.homepage-post {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
}

.homepage-post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-thumbnail {
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition);
}

.homepage-post:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content-wrap {
    padding: 1.5rem;
}

.posts-container:not(.grid-layout) .post-thumbnail {
    display: none;
}

.entry-header {
    margin-bottom: 1rem;
}

.entry-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.entry-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

.entry-title a:hover {
    color: var(--accent-color);
}

.entry-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.category-badges {
    margin-bottom: 0.75rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: all var(--transition);
}

/* Category Colors */
.cat-aita-stories { background: #fff5f5; color: #c53030; }
.cat-relationship-drama { background: #fef5e7; color: #d68910; }
.cat-revenge-stories { background: #f0f4ff; color: #5568d3; }
.cat-wedding-drama { background: #fef5f8; color: #b83280; }
.cat-family-drama { background: #f0fff4; color: #2f855a; }
.cat-work-drama { background: #fffaf0; color: #c05621; }
.cat-entitled-people { background: #faf5ff; color: #805ad5; }
.cat-choosing-beggars { background: #f0fff4; color: #38a169; }

[data-theme="dark"] .category-badge {
    opacity: 0.9;
}

.entry-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.entry-content p {
    margin-bottom: 1rem;
}

.more-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: all var(--transition);
}

.more-link:hover {
    background: var(--secondary-color);
    color: white;
}

/* ===== SINGLE POST ===== */
.infinite-scroll-post {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.infinite-scroll-post .entry-title {
    font-size: 1.8rem;
}

.infinite-scroll-post .entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.infinite-scroll-post .entry-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: var(--text-primary);
}

/* Share Actions */
.share-actions {
    margin-top: 1rem;
}

.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.copy-link-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== REACTIONS ===== */
.reactions-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    text-align: center;
}

.reactions-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.reactions-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 60px;
}

.reaction-btn:hover:not([disabled]) {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.reaction-btn.reacted {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.reaction-btn[disabled] {
    cursor: default;
    opacity: 0.7;
}

.reaction-emoji {
    font-size: 1.5rem;
}

.reaction-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.reaction-btn.reacted .reaction-count {
    color: white;
}

/* ===== COMMENTS ===== */
.comments-toggle-wrapper {
    margin-top: 2rem;
}

.comments-toggle {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
}

.comments-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.comments-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    transition: transform var(--transition);
}

.comments-area {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    overflow: hidden;
}

.comments-area.collapsed {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
}

.comments-area.expanded {
    max-height: none;
    padding: 1.5rem;
    margin-top: 1rem;
    opacity: 1;
    visibility: visible;
}

.comments-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.comment-reply-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-submit input[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.form-submit input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== POST SEPARATOR ===== */
.post-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2.5rem 0;
    padding: 1.5rem 0;
}

.separator-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary-color), transparent);
}

.separator-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

/* ===== LOADING & END MESSAGES ===== */
.infinite-scroll-loading,
.homepage-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.infinite-scroll-end,
.homepage-end {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.widget {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.widget ul {
    list-style: none;
    margin: 0;
}

.widget li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition);
}

.widget a:hover {
    color: var(--primary-color);
}

/* ===== AD ZONES ===== */
.ad-zone {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-zone:empty::before {
    content: 'Ad Space';
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== BACK TO TOP & PROGRESS ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, #667eea, #764ba2);
    z-index: 100001;
    transition: width 0.1s ease;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 10000;
    box-shadow: var(--shadow-lg);
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== 404 PAGE ===== */
.error-404-container {
    text-align: center;
    padding: 2rem 0;
}

.error-404-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.error-404-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-404-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-404-message {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-404-search {
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.error-404-search form {
    display: flex;
    gap: 0.5rem;
}

.error-404-search .search-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.error-404-search .search-btn {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.error-404-home-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
}

.error-404-home-btn:hover {
    background: var(--primary-color);
    color: white;
}

.error-404-suggestions {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.error-404-suggestions h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.suggestion-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.suggestion-post {
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition);
    text-align: left;
}

.suggestion-post:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.suggestion-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
    line-height: 1.4;
}

.suggestion-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== ARCHIVE PAGE ===== */
.archive-header {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.archive-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.archive-type {
    font-weight: 400;
    color: var(--text-muted);
}

.archive-description {
    color: var(--text-secondary);
    margin: 1rem 0;
}

.archive-count {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.archive-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.site-footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }
    
    .site-content {
        grid-template-columns: 1fr;
        padding: 0 15px;
        margin: 1rem auto;
    }
    
    .site-header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .dark-mode-toggle {
        width: 36px;
        height: 36px;
    }
    
    .menu-toggle {
        display: block;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        position: relative;
        z-index: 100001;
    }
    
    .main-navigation ul {
        display: none;
        position: fixed;
        top: 55px;
        left: 0;
        right: 0;
        width: 100%;
        background: #764ba2;
        flex-direction: column;
        max-height: calc(100vh - 55px);
        overflow-y: auto;
        z-index: 100000;
        gap: 0;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    .main-navigation > ul > li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .main-navigation > ul > li > a {
        padding: 1rem 1.5rem;
        display: block;
    }
    
    .main-navigation ul ul {
        display: none !important;
        position: static !important;
        background: rgba(0,0,0,0.2) !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        flex-direction: column !important;
        min-width: 0 !important;
        right: auto !important;
        left: auto !important;
        padding: 0 !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .main-navigation li.menu-item-has-children.open > ul {
        display: block !important;
        max-height: 500px;
    }
    
    .main-navigation .menu-item-has-children > a::after {
        content: " ▼";
        font-size: 0.7rem;
        transition: transform 0.3s ease;
        display: inline-block;
    }
    
    .main-navigation .menu-item-has-children.open > a::after {
        transform: rotate(180deg);
    }
    
    .main-navigation ul ul li {
        width: 100% !important;
        display: block !important;
    }
    
    .main-navigation ul ul a {
        padding: 0.875rem 2rem;
    }
    
    /* Hero */
    .hero-section {
        padding: 0.75rem 0 1rem;
    }
    
    .hero-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .carousel-track {
        min-height: 120px;
    }
    
    .hero-card-content {
        padding: 0.875rem 1rem;
    }
    
    .hero-card-title {
        font-size: 1rem;
    }
    
    .hero-card-meta {
        font-size: 0.8rem;
        gap: 0.75rem;
    }
    
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .carousel-prev { left: -35px; }
    .carousel-next { right: -35px; }
    
    .hero-container {
        padding: 0 50px;
    }
    
    /* Filter Bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .category-filters {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        width: 100%;
        max-width: 100vw;
        flex-wrap: nowrap;
    }
    
    .category-filters::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .layout-toggle {
        align-self: flex-end;
    }
    
    /* Posts */
    .posts-container.grid-layout {
        grid-template-columns: 1fr;
    }
    
    .homepage-post,
    .infinite-scroll-post {
        border-radius: var(--radius-sm);
    }
    
    .post-content-wrap {
        padding: 1.25rem;
    }
    
    .infinite-scroll-post {
        padding: 1.25rem;
    }
    
    .entry-title {
        font-size: 1.2rem;
    }
    
    .infinite-scroll-post .entry-title {
        font-size: 1.4rem;
    }
    
    .entry-meta {
        font-size: 0.85rem;
        gap: 0.75rem;
    }
    
    /* Reactions */
    .reactions-section {
        padding: 1rem;
    }
    
    .reactions-buttons {
        gap: 0.5rem;
    }
    
    .reaction-btn {
        padding: 0.5rem 0.75rem;
        min-width: 50px;
    }
    
    .reaction-emoji {
        font-size: 1.25rem;
    }
    
    /* Comments */
    .comments-toggle {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .comments-area.expanded {
        padding: 1rem;
    }
    
    .comment-respond {
        padding: 1rem;
    }
    
    /* Sidebar */
    .sidebar {
        position: static;
        margin-top: 1rem;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
        font-size: 1.25rem;
    }
    
    /* 404 */
    .error-404-content {
        padding: 2rem 1.5rem;
    }
    
    .error-404-title {
        font-size: 1.5rem;
    }
    
    .error-404-search form {
        flex-direction: column;
    }
    
    /* Archive */
    .archive-header {
        padding: 1.5rem;
    }
    
    .archive-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1rem;
    }
    
    .hero-card-title {
        font-size: 1rem;
    }
    
    .carousel-dots {
        margin-top: 0.75rem;
    }
    
    .carousel-dot {
        min-width: 44px;
        min-height: 44px;
    }
    
    .carousel-dot::before {
        width: 10px;
        height: 10px;
    }
    
    .entry-title {
        font-size: 1.1rem;
    }
    
    .reaction-btn {
        padding: 0.4rem 0.5rem;
        min-width: 45px;
    }
    
    .reaction-emoji {
        font-size: 1.1rem;
    }
    
    .reaction-count {
        font-size: 0.75rem;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    .site-header,
    .sidebar,
    .back-to-top,
    .reading-progress,
    .reactions-section,
    .comments-toggle-wrapper,
    .post-separator,
    .share-actions {
        display: none !important;
    }
    
    .site-content {
        display: block;
    }
    
    .infinite-scroll-post {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== THEME OPTIONS AD ZONES ===== */
.rs-ad-zone {
    margin: 1.5rem 0;
    text-align: center;
}

.rs-ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.rs-ad-before-content {
    margin-bottom: 2rem;
}

.rs-ad-after-content {
    margin-top: 2rem;
}

.rs-ad-mid-content {
    margin: 2rem 0;
    padding: 1rem 0;
}

.rs-ad-sidebar {
    margin-bottom: 1.5rem;
}

.rs-ad-in-feed {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* ===== STATIC PAGES ===== */
.static-page {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.page-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.page-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.page-content p {
    margin-bottom: 1.25rem;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

.page-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.page-content a:hover {
    color: var(--secondary-color);
}

.page-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.page-content th,
.page-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.page-content th {
    background: var(--bg-primary);
    font-weight: 600;
}

.page-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile adjustments for pages */
@media (max-width: 768px) {
    .static-page {
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-content {
        font-size: 1rem;
    }
    
    .page-content h2 {
        font-size: 1.3rem;
    }
    
    .page-content h3 {
        font-size: 1.1rem;
    }
}
