/* ================================
   GENERAL UI ENHANCEMENTS
   Modern styling upgrades for Java Learning Platform
   ================================ */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--color-brand), var(--java-blue));
    border-radius: 10px;
    border: 2px solid var(--bg-tertiary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--java-orange), var(--java-red));
}

/* Selection styling */
::selection {
    background: rgba(15, 118, 110, 0.2);
    color: var(--text-strong);
}

html.dark ::selection {
    background: rgba(20, 184, 166, 0.3);
    color: var(--text-strong);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Improved button base styles */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:not(:disabled):active {
    transform: scale(0.97);
}

/* Input focus enhancements */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 
        0 0 0 3px rgba(15, 118, 110, 0.1),
        0 2px 8px rgba(15, 118, 110, 0.15);
}

/* Card base improvements */
.card-base {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-base:hover {
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(15, 118, 110, 0.1);
    transform: translateY(-2px);
}

/* Heading gradient text */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    background: linear-gradient(135deg, var(--text-strong), var(--color-brand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Link hover effects */
a {
    color: var(--color-brand);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

a:hover {
    color: var(--java-orange);
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-brand), var(--java-orange));
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid var(--border-secondary);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

/* Skeleton loading */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0px,
        var(--bg-secondary) 40px,
        var(--bg-tertiary) 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Tooltip base */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--bg-code);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Badge base enhancements */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Glow effect utility */
.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(15, 118, 110, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(15, 118, 110, 0.8);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease;
}

/* Scale bounce */
@keyframes scaleBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.scale-bounce {
    animation: scaleBounce 0.3s ease;
}

/* Gradient border animation */
@keyframes gradient-border {
    0%, 100% {
        border-color: var(--color-brand);
    }
    50% {
        border-color: var(--java-orange);
    }
}

.animated-border {
    animation: gradient-border 3s ease infinite;
}

/* Shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Enhanced navigation bar */
nav {
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

nav:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Search input enhancements */
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Enhanced select dropdowns */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Responsive typography improvements */
@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem; /* 30px */
    }
    
    h2 {
        font-size: 1.5rem; /* 24px */
    }
    
    h3 {
        font-size: 1.25rem; /* 20px */
    }
}

/* Dark mode improvements */
html.dark {
    color-scheme: dark;
}

html.dark body::before {
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(20, 184, 166, 0.03) 2px, rgba(20, 184, 166, 0.03) 4px);
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
    
    a::after {
        display: none;
    }
    
    nav,
    footer,
    button {
        display: none !important;
    }
}

/* ================================
   ADVANCED MICRO-INTERACTIONS
   ================================ */

/* Button ripple effect */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ripple-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Image hover zoom */
.image-zoom {
    overflow: hidden;
    border-radius: 0.5rem;
}

.image-zoom img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Text reveal animation */
@keyframes textReveal {
    from {
        clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    }
    to {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.text-reveal {
    animation: textReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Number counter animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.6s ease forwards;
}

/* Progress bar with gradient */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-brand), var(--java-orange), var(--java-red));
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.animated::before {
    animation: progressShine 2s ease infinite;
}

@keyframes progressShine {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Notification badge pulse */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--java-red);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Card flip effect */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* Typing indicator */
@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--color-brand);
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ================================
   NEWS NOTIFICATION SYSTEM
   ================================ */

/* News notification badge on menu button */
.news-notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgePulseNews 2s ease infinite;
    z-index: 10;
    border: 2px solid var(--bg-nav);
}

@keyframes badgePulseNews {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
    }
}

/* News modal styling */
.news-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* News item card */
.news-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--color-brand);
}

.news-item.unread {
    border-left: 4px solid var(--java-orange);
    background: linear-gradient(135deg, 
        rgba(248, 152, 32, 0.05), 
        rgba(248, 152, 32, 0.02));
}

.news-item.unread::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 10px;
    height: 10px;
    background: var(--java-orange);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(248, 152, 32, 0.2);
    animation: newsPulse 2s ease infinite;
}

@keyframes newsPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* News item header */
.news-item-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.news-item-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.news-item-content {
    flex: 1;
}

.news-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.news-item-description {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.news-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.news-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.news-item-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-item-type-badge.feature {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    color: var(--color-easy);
    border: 1px solid var(--color-easy);
}

.news-item-type-badge.improvement {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.news-item-type-badge.announcement {
    background: linear-gradient(135deg, rgba(248, 152, 32, 0.1), rgba(248, 152, 32, 0.05));
    color: var(--java-orange);
    border: 1px solid var(--java-orange);
}

/* Priority indicators */
.news-item.priority-high {
    border-top: 3px solid var(--java-red);
}

.news-item.priority-medium {
    border-top: 3px solid var(--java-orange);
}

.news-item.priority-low {
    border-top: 3px solid var(--color-brand);
}

/* Empty state */
.news-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.news-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.news-empty-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Mark all as read button */
.mark-all-read-btn {
    background: linear-gradient(135deg, var(--color-brand), var(--java-blue));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.mark-all-read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.mark-all-read-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* History toggle button */
.history-toggle-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--text-strong);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.3);
    cursor: pointer;
}

.history-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* XP Badge on news items */
.xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: linear-gradient(135deg, var(--java-orange), var(--java-red));
    color: white;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(248, 152, 32, 0.3);
    animation: xpPulse 2s ease infinite;
}

@keyframes xpPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(248, 152, 32, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(248, 152, 32, 0.5);
    }
}

/* Read badge */
.read-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-easy);
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--color-easy);
}

/* Click hint */
.click-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, rgba(248, 152, 32, 0.1), rgba(248, 152, 32, 0.05));
    color: var(--java-orange);
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--java-orange);
    animation: hintBounce 2s ease infinite;
}

/* Mark as Read button */
.mark-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, var(--java-orange), var(--java-red));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mark-read-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(248, 152, 32, 0.3);
    opacity: 0.9;
}

.mark-read-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes hintBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Read news items styling */
.news-item.read {
    opacity: 0.7;
    border-left: 4px solid var(--color-easy);
}

.news-item.read:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
    border-color: var(--color-easy);
}

.news-item.read .news-item-title {
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .news-item-icon {
        font-size: 1.5rem;
    }
    
    .news-item-title {
        font-size: 0.9rem;
    }
    
    .news-item-description {
        font-size: 0.8rem;
    }
    
    .news-notification-badge {
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
    
    .xp-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
    }
    
    .click-hint, .read-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .mark-read-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ================================
   NEWS NOTIFICATION SYSTEM
   ================================ */

/* News notification badge on menu button */
.news-notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgePulseNews 2s ease infinite;
    z-index: 10;
    border: 2px solid var(--bg-nav);
}

@keyframes badgePulseNews {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
    }
}

/* News modal styling */
.news-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* News item card */
.news-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--color-brand);
}

.news-item.unread {
    border-left: 4px solid var(--java-orange);
    background: linear-gradient(135deg, 
        rgba(248, 152, 32, 0.05), 
        rgba(248, 152, 32, 0.02));
}

.news-item.unread::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 10px;
    height: 10px;
    background: var(--java-orange);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(248, 152, 32, 0.2);
    animation: newsPulse 2s ease infinite;
}

@keyframes newsPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* News item header */
.news-item-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.news-item-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.news-item-content {
    flex: 1;
}

.news-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.news-item-description {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.news-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.news-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.news-item-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-item-type-badge.feature {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    color: var(--color-easy);
    border: 1px solid var(--color-easy);
}

.news-item-type-badge.improvement {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.news-item-type-badge.announcement {
    background: linear-gradient(135deg, rgba(248, 152, 32, 0.1), rgba(248, 152, 32, 0.05));
    color: var(--java-orange);
    border: 1px solid var(--java-orange);
}

/* Priority indicators */
.news-item.priority-high {
    border-top: 3px solid var(--java-red);
}

.news-item.priority-medium {
    border-top: 3px solid var(--java-orange);
}

.news-item.priority-low {
    border-top: 3px solid var(--color-brand);
}

/* Empty state */
.news-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.news-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.news-empty-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Mark all as read button */
.mark-all-read-btn {
    background: linear-gradient(135deg, var(--color-brand), var(--java-blue));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.mark-all-read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.mark-all-read-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .news-item-icon {
        font-size: 1.5rem;
    }
    
    .news-item-title {
        font-size: 0.9rem;
    }
    
    .news-item-description {
        font-size: 0.8rem;
    }
    
    .news-notification-badge {
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
}


/* ================================
   LEADERBOARD WIDGET STYLES
   ================================ */

#leaderboard-widget {
    animation: slideInFromRight 0.4s ease-out;
    max-width: 320px;
}

#leaderboard-widget-minimized {
    animation: scaleIn 0.3s ease-out;
}

/* Smooth slide in from right */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Leaderboard widget scroll styling */
#leaderboard-widget-content::-webkit-scrollbar {
    width: 6px;
}

#leaderboard-widget-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--java-orange), var(--java-red));
    border-radius: 3px;
}

/* Responsive: Hide widget on smaller screens */
@media (max-width: 1280px) {
    #leaderboard-widget,
    #leaderboard-widget-minimized {
        display: none !important;
    }
}

/* Add subtle pulse animation to current user row */
@keyframes userHighlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(248, 152, 32, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(248, 152, 32, 0.1);
    }
}

/* ================================
   CODE BLOCK ENHANCEMENTS
   ================================ */

/* Code block wrapper for playground buttons */
.code-block-wrapper {
    position: relative;
    margin: 1rem 0;
}

.code-block-wrapper pre {
    margin: 0;
    padding-top: 3.5rem; /* Space for button group */
}

.playground-code-btn,
.copy-code-btn {
    white-space: nowrap;
}

.playground-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 152, 32, 0.3);
}

.copy-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive button text */
@media (max-width: 640px) {
    .playground-code-btn span,
    .copy-code-btn span {
        display: none;
    }
    
    .code-block-wrapper pre {
        padding-top: 3rem;
    }
}

/* ================================
   VIDEO SECTION ENHANCEMENTS
   ================================ */

/* Aspect ratio utility for responsive videos */
.aspect-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.aspect-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ================================
   GITHUB INTEGRATION STYLING
   ================================ */

/* GitHub Submission Widget */
.github-submission-widget {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(36, 41, 46, 0.05), rgba(36, 41, 46, 0.02));
    border: 2px solid rgba(36, 41, 46, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

html.dark .github-submission-widget {
    background: linear-gradient(135deg, rgba(36, 41, 46, 0.3), rgba(36, 41, 46, 0.1));
    border-color: rgba(88, 96, 105, 0.3);
}

.github-submission-widget:hover {
    border-color: var(--color-brand);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.github-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

.github-widget-header h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-strong);
}

.github-widget-header svg {
    color: #24292f;
}

html.dark .github-widget-header svg {
    color: #f0f6fc;
}

.submitted-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.github-widget-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Submission Section */
.submission-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.submission-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-strong);
}

.submission-label svg {
    width: 1rem;
    height: 1rem;
    color: var(--color-brand);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.github-input {
    flex: 1;
    padding: 0.625rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.github-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.github-input::placeholder {
    color: var(--text-secondary);
}

.submit-btn,
.submit-btn-gist {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.submit-btn {
    background: linear-gradient(135deg, var(--java-orange), var(--java-red));
    box-shadow: 0 2px 4px rgba(248, 152, 32, 0.2);
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(248, 152, 32, 0.3);
}

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

.submit-btn-gist {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.submit-btn-gist:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

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

.input-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Submitted List */
.submitted-list {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.submitted-list-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.75rem;
}

.submitted-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.submitted-item:hover {
    border-color: var(--color-brand);
    transform: translateX(2px);
}

.submitted-item:last-child {
    margin-bottom: 0;
}

.submitted-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.submitted-item-info svg {
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.submitted-link {
    color: var(--color-brand);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.submitted-link:hover {
    color: var(--java-orange);
    text-decoration: underline;
}

.submitted-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
    margin-right: 0.5rem;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* GitHub Badge on Exercise Card */
.github-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, rgba(36, 41, 46, 0.1), rgba(36, 41, 46, 0.05));
    color: #24292f;
    border: 1px solid rgba(36, 41, 46, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

html.dark .github-badge {
    background: linear-gradient(135deg, rgba(240, 246, 252, 0.1), rgba(240, 246, 252, 0.05));
    color: #f0f6fc;
    border-color: rgba(240, 246, 252, 0.2);
}

.github-badge:hover {
    background: linear-gradient(135deg, rgba(36, 41, 46, 0.15), rgba(36, 41, 46, 0.1));
    transform: scale(1.05);
}

html.dark .github-badge:hover {
    background: linear-gradient(135deg, rgba(240, 246, 252, 0.15), rgba(240, 246, 252, 0.1));
}

.github-badge svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .github-submission-widget {
        padding: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .submit-btn,
    .submit-btn-gist {
        width: 100%;
    }
    
    .submitted-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .submitted-date {
        margin-left: 0;
        margin-right: 0;
    }
    
    .delete-btn {
        align-self: flex-end;
    }
}

/* Animation for submission success */
@keyframes submitSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.github-submission-widget.success {
    animation: submitSuccess 0.3s ease;
    border-color: #22c55e;
}
