@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
    --primary: #2ea043;
    --primary-hover: #3fb950;
    --secondary: #0d1117;
    --accent: #58a6ff;
    --accent-rgb: 88, 166, 255;

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #21262d;
    --bg-glass: rgba(33, 38, 45, 0.7);
    --border-color: #30363d;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
    --success: #28a745;
    --error: #dc3545;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-mode {
    --primary: #2ea043;
    --primary-hover: #3fb950;
    --secondary: #f6f8fa;
    --accent: #0969da;
    --accent-rgb: 9, 105, 218;

    --text-primary: #24292f;
    --text-secondary: #57606a;
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: #d0d7de;
    --shadow-sm: 0 3px 6px rgba(140, 149, 159, 0.15);
    --shadow-md: 0 3px 12px rgba(140, 149, 159, 0.2);
    --shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

body {
    font-family: 'Inter', 'Tajawal', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 1;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-.895 3-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='currentColor' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Navbar Styling */
.navbar {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-card));
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link i {
    font-size: 1.1em;
}

.nav-link:hover {
    color: var(--accent);
    background-color: var(--bg-card);
}

.nav-link.active {
    color: var(--accent);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background-color: var(--accent);
    border-radius: 50%;
}

/* Navbar Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.nav-close {
    display: none;
}

@media (max-width: 992px) {
    .navbar {
        padding: 0.8rem 1.5rem;
        position: relative;
        z-index: 1001;
    }
    .navbar-container {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100vw;
        width: min(280px, 80vw);
        max-width: 320px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: flex-start;
        padding: 5rem 1.5rem 2rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1002;
        transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        overflow-x: hidden;
        display: none;
        opacity: 0;
        visibility: hidden;
        overscroll-behavior: contain;
        margin: 0;
        box-sizing: border-box;
        word-wrap: break-word;
        border: none;
        outline: none;
    }
    
    .nav-links.active {
        display: flex;
        right: 0;
        opacity: 1;
        z-index: 1002;
        visibility: visible;
        position: fixed;
    }
    
    .nav-link {
        width: 100%;
        max-width: 100%;
        padding: 0.9rem 1.25rem;
        margin: 0.25rem 0;
        border-radius: 12px;
        font-size: 1.05rem;
        font-weight: 500;
        color: var(--text-primary);
        text-decoration: none;
        display: flex;
        align-items: center;
        transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        box-sizing: border-box;
        white-space: nowrap;
    }
    
    .nav-link i {
        width: 24px;
        min-width: 24px;
        text-align: center;
        margin-left: 8px;
        font-size: 1.1em;
        color: var(--text-secondary);
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    
    .nav-link:hover {
        background: var(--bg-secondary);
        transform: translateX(4px);
    }
    
    .nav-link.active {
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent);
        font-weight: 600;
    }
    .mobile-menu-btn {
        display: block;
        z-index: 1003;
    }
    
    .mobile-menu-btn.active {
        z-index: 1;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
/* Navigation Close Button */
.nav-close.active {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-close:hover.active {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.nav-close:focus.active {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* For light mode */
.light-mode .nav-close.active {
    color: #333;
}

.light-mode .nav-close:hover.active {
    background: rgba(0, 0, 0, 0.05);
}
    
    
    .nav-actions {
        position: relative;
        justify-content: flex-end;
        align-items: center;
    }
    
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    body.nav-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    .navbar,
    .nav-links,
    .nav-link {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .nav-links * {
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .nav-links {
        width: min(260px, 85vw);
        padding: 4rem 1rem 2rem;
    }
    
    .nav-link {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

@media (min-width: 993px) {
    .nav-links {
        position: static !important;
        display: flex !important;
        right: auto !important;
        width: auto !important;
        height: auto !important;
        background: none !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
        z-index: auto !important;
        transition: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .nav-overlay {
        display: none !important;
    }
}

@media (max-width: 576px) {    
    .site-logo {
        width: 35px;
        height: 35px;
    }
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.logo-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.site-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-link h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.theme-toggle button,
.language-toggle button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-toggle button:hover,
.language-toggle button:hover {
    background: var(--bg-card);
    color: var(--accent);
    transform: scale(1.1);
}

.language-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 101;
}

.language-toggle button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Tajawal', 'Inter', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background, box-shadow, color;
}

.language-toggle button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(88, 166, 255, 0.4);
    background: linear-gradient(145deg, var(--accent), var(--primary));
    color: var(--text-primary);
}

.language-toggle button i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.language-toggle button:hover i {
    transform: rotate(20deg);
}

.language-toggle .dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    pointer-events: auto;
}

.language-toggle.active .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-toggle .dropdown .language-option {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-size: 1.0rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Tajawal', 'Inter', sans-serif;
}

.language-toggle .dropdown .language-option:hover {
    background: rgba(var(--accent-rgb), 0.6) !important;
    color: var(--text-primary);
    border-radius: 12px;
    text-decoration: none;
}

.language-toggle .dropdown .language-option.selected {
    background: linear-gradient(145deg, var(--accent), var(--primary));
    font-weight: 600;
    font-family: 'Tajawal', 'Inter', sans-serif;
    border-radius: 12px;
    color: var(--text-primary);
}

.back-to-home {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.back-to-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(88, 166, 255, 0.4);
    background: linear-gradient(145deg, var(--accent), var(--primary));
    color: var(--text-primary);
}

.back-to-home i {
    font-size: 1.2rem;
}

@media (min-width: 1024px) {
    .navbar {
        padding: 1rem 2rem;
    }
    .theme-toggle,
    .language-toggle {
        margin-left: 1rem;
    }
    .back-to-home {
        margin-left: auto;
        margin-right: 1.5rem;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    .theme-toggle,
    .language-toggle,
    .back-to-home {
        margin-left: 0.5rem;
    }
    .back-to-home {
        margin-right: 0.5rem;
    }
    .language-toggle button {
        padding: 0.5rem;
    }
}

@media (max-width: 767px) {
    .navbar {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .theme-toggle,
    .language-toggle,
    .back-to-home {
        margin: 0 0.25rem;
    }
    .language-toggle button,
    .back-to-home {
        padding: 0.5rem;
        border-radius: 50%;
    }
    .language-toggle button span,
    .back-to-home span {
        display: none;
    }
    .back-to-home i {
        font-size: 1.2rem;
    }
    .language-toggle .dropdown {
        min-width: 120px;
        right: 0;
    }
    .language-toggle .dropdown .language-option {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .language-toggle button {
        padding: 0.5rem;
        font-size: 1.0rem;
        border-radius: 20px;
    }
    .language-toggle i {
        text-align: center;
        justify-content: center;
        align-items: center;
        font-size: 1.0rem;
    }
    .language-toggle .dropdown {
        min-width: 100px;
    }
}


/* Enhanced Skeleton Loading Styles */
.skeleton {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.light-mode .skeleton {
    backdrop-filter: blur(4px);
}

.skeleton-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.skeleton-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    pointer-events: none;
}

.skeleton-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-text {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
    height: 1rem;
}

.skeleton-title {
    width: 70%;
    height: 1.5rem;
    margin-bottom: 0.5rem;
}

.skeleton-meta {
    width: 50%;
    height: 0.875rem;
    margin-bottom: 0.25rem;
}

.skeleton-description {
    width: 100%;
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-description:nth-child(2) {
    width: 90%;
}

.skeleton-description:nth-child(3) {
    width: 60%;
}

.skeleton-button {
    width: 120px;
    height: 2.25rem;
    margin-top: auto;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

@keyframes skeletonPulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading and Error Styles */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin: 2rem 0;
}

.error-message {
    color: var(--error);
    font-size: 1.1rem;
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--error);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.retry-button {
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.retry-button:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(88, 166, 255, 0.4);
}

.retry-button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Main Content Styling */
main.container {
    padding: 2rem;
    min-height: calc(100vh - 200px); /* لضمان أن الـ footer يبقى في الأسفل */
}

section {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    min-height: 500px; /* ارتفاع أدنى لضمان عدم وجود فراغ */
    opacity: 1;
    transform: translateY(0);
    transition: box-shadow 0.3s ease;
}

.light-mode section {
    backdrop-filter: blur(4px);
}

section:hover {
    box-shadow: var(--shadow-lg);
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.15) 0%, rgba(88, 166, 255, 0) 70%);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: 16px;
    transition: opacity 0.3s ease;
}

section:hover::before {
    opacity: 1;
}

h2 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    min-height: 100px;
}

.new-article {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    display: flex;
    flex-direction: column;
}

.new-article.loaded {
    opacity: 1;
    transform: translateY(0);
}

.light-mode .new-article {
    backdrop-filter: blur(4px);
}

.new-article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.new-article:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.new-article__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.new-article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    transition: transform 0.4s ease;
}

.new-article__image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: none;
}

.new-article:hover img {
    transform: scale(1.05);
}

.new-article__content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.new-article h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.new-article__meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.new-article .source,
.new-article .published {
    display: block;
}

.new-article .source strong,
.new-article .published strong {
    color: var(--text-primary);
}

.new-article__description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.new-article__link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: auto;
}

.new-article__link:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(88, 166, 255, 0.4);
}

.new-article__link:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.light-mode .new-article__link {
    color: #fff;
}

/* Footer Styling */
footer {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.light-mode footer {
    backdrop-filter: blur(4px);
}

footer p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
}

footer #footer-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-link i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
    transform: translateY(-2px);
}

.footer-link:hover i {
    transform: scale(1.1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(135deg, var(--bg-secondary), rgba(88, 166, 255, 0.1));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Page Loading */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.9), rgba(88, 166, 255, 0.1));
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-loading.active {
    display: flex;
    opacity: 1;
}

.page-loading .loading-spinner {
    width: 80px;
    height: 80px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pulse 2s ease-in-out infinite;
}

.page-loading .spinner-core {
    width: 40px;
    height: 40px;
    background: var(--accent, #58A6FF);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.7), 0 0 30px rgba(88, 166, 255, 0.4);
    animation: scaleCore 1.5s ease-in-out infinite;
}

.page-loading .spinner-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    box-shadow: 0 0 10px rgba(46, 160, 67, 0.5);
}

.page-loading .orbit-1 {
    border-top-color: var(--primary, #2EA043);
    animation: spinOrbit 1.2s linear infinite;
}

.page-loading .orbit-2 {
    border-bottom-color: var(--primary-hover, #3FB950);
    animation: spinOrbit 1.2s linear infinite reverse;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes scaleCore {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(88, 166, 255, 0.7); }
    50% { transform: scale(1.2); box-shadow: 0 0 25px rgba(88, 166, 255, 1); }
}

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

body.light-mode .page-loading {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(88, 166, 255, 0.1));
}

body.light-mode .spinner-core {
    background: var(--accent, #58A6FF);
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.7), 0 0 30px rgba(88, 166, 255, 0.4);
}

body.light-mode .orbit-1 {
    border-top-color: var(--primary, #2EA043);
}

body.light-mode .orbit-2 {
    border-bottom-color: var(--primary-hover, #3FB950);
}

@media (max-width: 767px) {
    main.container {
        padding: 1rem;
    }
    section {
        padding: 1.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .new-article__image {
        aspect-ratio: 16 / 9;
    }
    .new-article h3 {
        font-size: 1.2rem;
    }
    .new-article__meta {
        font-size: 0.85rem;
    }
    .new-article__description {
        font-size: 0.95rem;
        line-clamp: 2;
    }
    .new-article__link {
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .site-logo {
        width: 40px;
        height: 40px;
    }
    section {
        padding: 1rem;
    }
    h2 {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .new-article,
    .new-article__link,
    .section,
    .navbar,
    .logo-link,
    .theme-toggle button,
    .language-toggle button,
    .back-to-home,
    .page-loading,
    .page-loading .loading-spinner,
    .spinner-core,
    .spinner-orbit {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
    .new-article:hover,
    .new-article__link:hover,
    .section:hover,
    .logo-link:hover,
    .theme-toggle button:hover,
    .language-toggle button:hover,
    .back-to-home:hover {
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .nav-link.active::after {
        display: none;
    }
}