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

/* Performance optimizations - only for animated elements */

/* Optimize animations */
.news-card:hover,
.category-card:hover,
.task-card:hover,
.subcategory-card:hover {
    will-change: transform;
}

/* Reduce repaints - only for specific elements */
.header {
    contain: layout style;
}

:root {
    --primary-color: #7cb342;
    --primary-hover: #689f38;
    --secondary-color: #4caf50;
    --accent-color: #ff9800;
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    /* Prevent layout shifts */
    overflow-x: hidden;
}

/* MathJax styles */
mjx-container {
    display: inline-block;
    margin: 0 0.1em;
    vertical-align: middle;
}

mjx-container[display="true"] {
    display: block;
    text-align: center;
    margin: 1em 0;
}

/* MathJax Loading Indicator - Minimal */
#mathjax-loading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    max-width: 180px;
    word-wrap: break-word;
    border-radius: 6px;
    opacity: 0.9;
}

#mathjax-loading i {
    margin-right: 6px;
    font-size: 12px;
}

/* Progress bar styling */
#mathjax-progress {
    background: linear-gradient(90deg, #7cb342, #4caf50);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 1px;
}

/* Status text styling */
#mathjax-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4px;
}

/* Dark mode for loading indicator */
[data-theme="dark"] #mathjax-loading {
    background: rgba(30, 30, 30, 0.9);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #mathjax-progress {
    background: linear-gradient(90deg, #8bc34a, #4caf50);
}

[data-theme="dark"] #mathjax-status {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive positioning */
@media (max-width: 768px) {
    #mathjax-loading {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* LaTeX content styling */
.task-formula {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-align: center;
    margin: 15px 0;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    line-height: 1.5;
    /* Optimize for MathJax rendering */
    contain: layout style;
    will-change: auto;
}

/* Ensure LaTeX content is processed */
.tex2jax_process {
    font-family: "Times New Roman", serif;
    /* Optimize for MathJax rendering */
    contain: layout style;
    will-change: auto;
}

/* Optimize MathJax rendering performance */
mjx-container {
    contain: layout style;
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Prevent layout shifts during MathJax processing */
.tex2jax_process:not([data-mathjax-processed]) {
    min-height: 1.2em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.tex2jax_process[data-mathjax-processed] {
    opacity: 1;
}

/* Header Styles */
.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-img {
    height: 60px;
    width: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url('../img/logo.png');
}

/* Dark mode logo */
[data-theme="dark"] .logo-img {
    background-image: url('../img/logo-darktheme.png');
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(124, 179, 66, 0.1);
}

.nav-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    margin-top: 5px;
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.dropdown-content a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    width: 250px;
    font-size: 14px;
    background: var(--background-color);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.theme-toggle {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Main Layout */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 70px);
    align-items: start;
}

/* Sidebar Styles */
.sidebar {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 90px;
    z-index: 10;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.sidebar-menu {
    list-style: none;
    margin-bottom: 30px;
}

.sidebar-item {
    margin-bottom: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-link:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.sidebar-link i:first-child {
    margin-right: 10px;
    width: 16px;
}


/* Difficulty filters */

.difficulty-checkboxes {
    display: flex;
    gap: 10px;
}

.difficulty-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    padding-left: 34px;
    /* space for custom box */
}

.difficulty-item input {
    position: absolute;
    opacity: 0;
    left: 0;
}

.count {
    margin-left: auto;
    background: var(--background-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.difficulty-item.easy .count {
    background: #e8f5e8;
    color: #2e7d32;
}

.difficulty-item.medium .count {
    background: #fff3e0;
    color: #f57c00;
}

.difficulty-item.hard .count {
    background: #ffebee;
    color: #c62828;
}

/* Fancy checkbox for difficulty filters - same as auth */
.difficulty-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    transition: all 0.2s ease;
    box-shadow: 0 1px 1px rgba(0, 16, 75, 0.05);
}

.difficulty-item::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: translateY(-60%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease 0.05s;
}

.difficulty-item:hover::before {
    border-color: var(--primary-color);
}

.difficulty-item.easy:has(input:checked)::before {
    background: #2e7d32;
    border-color: #2e7d32;
    animation: wave-4 0.4s ease;
}

.difficulty-item.medium:has(input:checked)::before {
    background: #f57c00;
    border-color: #f57c00;
    animation: wave-4 0.4s ease;
}

.difficulty-item.hard:has(input:checked)::before {
    background: #c62828;
    border-color: #c62828;
    animation: wave-4 0.4s ease;
}

.difficulty-item:has(input:checked)::after {
    opacity: 1;
}

@keyframes wave-4 {
    50% {
        transform: translateY(-50%) scale(0.9);
    }
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: white;
    min-height: 56px;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}


/* Glow effect for action buttons */
.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), #8bc34a);
    animation: actionBtnGlowPrimary 2.5s ease-in-out infinite alternate;
    box-shadow: 0 0 0 rgba(124, 179, 66, 0.4);
}

.action-btn.primary:hover {
    animation: actionBtnGlowPrimaryHover 1s ease-in-out infinite alternate;
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(124, 179, 66, 0.5);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
    animation: actionBtnGlowSecondary 2.5s ease-in-out infinite alternate;
    box-shadow: 0 0 0 rgba(33, 150, 243, 0.4);
}

.action-btn.secondary:hover {
    animation: actionBtnGlowSecondaryHover 1s ease-in-out infinite alternate;
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.5);
}

@keyframes actionBtnGlowPrimary {
    0% {
        box-shadow: 0 0 0 rgba(124, 179, 66, 0.4);
    }

    100% {
        box-shadow: 0 0 25px rgba(124, 179, 66, 0.7);
    }
}

@keyframes actionBtnGlowPrimaryHover {
    0% {
        box-shadow: 0 8px 25px rgba(124, 179, 66, 0.8);
    }

    100% {
        box-shadow: 0 8px 35px rgba(124, 179, 66, 0.9);
    }
}

@keyframes actionBtnGlowSecondary {
    0% {
        box-shadow: 0 0 0 rgba(33, 150, 243, 0.4);
    }

    100% {
        box-shadow: 0 0 25px rgba(33, 150, 243, 0.7);
    }
}

@keyframes actionBtnGlowSecondaryHover {
    0% {
        box-shadow: 0 8px 25px rgba(33, 150, 243, 0.8);
    }

    100% {
        box-shadow: 0 8px 35px rgba(33, 150, 243, 0.9);
    }
}

/* Main Content */
.main-content {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.page-header {
    margin-bottom: 30px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.breadcrumb-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #81c784, #66bb6a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);

    line-height: 1.4;
}

.page-title .highlight {
    background-image: linear-gradient(135deg, var(--primary-color) 5%, var(--secondary-color) 20%);
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    text-transform: uppercase;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
}

.search-bar-container {
    position: relative;
    max-width: 100%;
}

.main-search-bar {
    width: 100%;
    padding: 15px 60px 15px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(124, 179, 66, 0.1);
    transition: all 0.2s ease;
}

.main-search-bar:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.2);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: var(--primary-hover);
}

/* News Section */
.news-section {
    margin-top: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Home news list - subtle, vertical, no cards */
.home-news-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-color);
}

.home-news-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

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

.home-news-item:hover {
    background: var(--background-color);
}

.home-news-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

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

.home-news-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.home-news-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.home-news-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.home-news-description {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Premium Gate (task access) */
.premium-gate {
    text-align: center;
    padding: 40px 20px;
}

.premium-gate__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
    font-size: 28px;
}

.premium-gate__title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
}

.premium-gate__text {
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.premium-gate__back {
    cursor: pointer;
}

/* Premium Modal */
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.premium-modal {
    width: min(520px, 92vw);
    background: var(--surface-color);
    color: var(--text-primary);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.premium-modal__header {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
    padding: 14px 18px;
    position: relative;
}

.premium-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.premium-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.premium-modal__body {
    padding: 16px 18px 8px;
    color: var(--text-secondary);
}

.premium-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 8px 18px 18px;
}

.premium-modal__btn {
    padding: 10px 18px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: inherit;
    text-decoration: none;
    display: inline-block;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.premium-modal__btn--primary {
    border: 1px solid #e67e22;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
    box-shadow: 0 6px 16px rgba(230, 126, 34, 0.35);
}

.premium-modal__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.premium-modal__btn--primary:hover {
    box-shadow: 0 10px 24px rgba(230, 126, 34, 0.45);
    filter: brightness(1.03);
}

/* Dark mode tweaks */
[data-theme="dark"] .premium-modal {
    background: var(--surface-color);
}

[data-theme="dark"] .premium-modal__btn {
    border-color: var(--border-color);
    background: var(--background-color);
    color: var(--text-primary);
}

/* Ensure primary button keeps premium gradient in dark mode */
[data-theme="dark"] .premium-modal__btn--primary {
    border: 1px solid #e67e22;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
    box-shadow: 0 6px 16px rgba(230, 126, 34, 0.35);
}

[data-theme="dark"] .premium-modal__btn--primary:hover {
    box-shadow: 0 10px 24px rgba(230, 126, 34, 0.45);
    filter: brightness(1.03);
}

.news-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.news-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.news-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    margin-bottom: 15px;
}

.news-icon.video {
    background: var(--primary-color);
}

.news-icon.book {
    background: #2196f3;
}

.news-icon.users {
    background: var(--primary-color);
}

.news-icon.chart {
    background: var(--primary-color);
}

.news-icon.calendar {
    background: #2196f3;
}

.news-icon.lightbulb {
    background: var(--primary-color);
}

.news-date {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Section footer: See all news */
.section-footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
}

.see-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.see-all-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--background-color);
}

/* Unified back button styling inside empty states */
.no-data .btn,
.no-tasks .btn,
.no-subcategories .btn,
.no-categories .btn,
.no-data a,
.no-tasks a,
.no-subcategories a,
.no-categories a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 25px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border: none;
    font-weight: 600;
    transition: transform 0.15s ease, background 0.2s ease;
    margin-top: 10px;
}

.no-data .btn i,
.no-tasks .btn i,
.no-subcategories .btn i,
.no-categories .btn i,
.no-data a i,
.no-tasks a i,
.no-subcategories a i,
.no-categories a i {
    display: inline-block;
    font-size: 1em;
    color: inherit;
    margin-right: 6px;
    line-height: 1;
    vertical-align: middle;
    margin-bottom: 0;
}

.no-data .btn:hover,
.no-tasks .btn:hover,
.no-subcategories .btn:hover,
.no-categories .btn:hover,
.no-data a:hover,
.no-tasks a:hover,
.no-subcategories a:hover,
.no-categories a:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

/* Right Sidebar */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.widget {
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.task-of-day {
    border-left: 4px solid var(--accent-color);
}

.widget-header {
    padding: 20px 20px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.widget-header i {
    color: var(--accent-color);
    font-size: 18px;
}

.widget-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.difficulty-badge {
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.widget-content {
    padding: 20px;
}

.widget-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Zadanie dnia - przycisk */
.task-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.task-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.task-link:hover i {
    text-decoration: none;
}

.task-link i {
    font-size: 11px;
    text-decoration: none;
}

.task-formula {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-meta i {
    color: var(--primary-color);
}

.date {
    margin-left: auto;
}

.premium-widget {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.premium-content {
    padding: 25px;
    text-align: center;
}

.premium-content i {
    font-size: 32px;
    margin-bottom: 15px;
    color: #fff3e0;
}

.premium-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.premium-content p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.premium-btn {
    background: white;
    color: var(--accent-color);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.premium-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1320px) {
    .search-container {
        display: none;
    }
}

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 250px 1fr 280px;
    }
}

@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 15px;
        overflow-x: hidden;
    }

    .sidebar,
    .right-sidebar {
        position: static;
    }

    .header-container {
        padding: 0 15px;
    }

    .search-input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-input {
        width: 100%;
        max-width: 300px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .main-container {
        padding: 15px;
    }

    .main-content {
        padding: 20px;
    }
}