/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Extra small devices (480px and below) - Enhanced Vertical Layout */
@media (max-width: 480px) {
    /* Base adjustments for wider cards */
    .container {
        padding: 0 0.125rem;
    }
    
    section {
        margin-bottom: 2.5rem;
    }
    
    /* Improve spacing for article detail page */
    .article-section {
        padding: 2rem 0;
    }
    
    /* Header vertical optimization */
    header {
        padding: 0.75rem 1rem;
    }
    
    .menu-toggle {
        font-size: 1.35rem;
        padding: 0.6rem;
    }
    
    header nav {
        width: 280px;
        right: -280px;
        padding: 2.5rem 1rem 1rem;
    }
    
    header nav ul {
        gap: 0.75rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    header nav ul li a {
        padding: 0.7rem 0.8rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    /* Search container vertical spacing */
    .search-container {
        margin-bottom: 1rem;
        width: 100%;
    }
    
    #search-input {
        padding: 0.75rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    /* Enhanced vertical layout for categories */
    .categories-grid {
        gap: 1.5rem;
        margin-top: 2.5rem;
    }
    
    .category-card {
        padding: 2rem 1.5rem;
        min-height: auto;
        height: auto;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .category-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.25rem;
    }
    
    .icon {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1.35rem;
        margin-bottom: 0.75rem;
    }
    
    .category-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

:root {
    /* Default Light Theme */
    
    /* Primary colors */
    --primary-color: #6c63ff;
    --primary-dark: #5a52d9;
    --primary-light: #8F87F5;
    
    /* Secondary colors */
    --secondary-color: #ff6584;
    --secondary-dark: #e05a76;
    --secondary-light: #ff89a2;
    
    /* Accent color */
    --accent-color: #ff6584;
    
    /* Text colors */
    --text-color: #333333;
    --text-dark: #1A1A1A;
    --light-text: #666666;
    --text-light: #999999;
    
    /* Background colors */
    --bg-color: #f9f9f9;
    --background-light: #F8F9FA;
    --white: #fff;
    --card-bg: rgba(255, 255, 255, 0.98);
    --card-hover-bg: #F9F9FC;
    
    /* Border colors */
    --border-color: #eaeaea;
    --border-light: #f0f0f0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6c63ff, #5a52d9);
    --gradient-secondary: linear-gradient(135deg, #ff6584, #e05a76);
    --header-bg: linear-gradient(135deg, #6c63ff, #5a52d9);
    
    /* Shadows */
    --box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-card-hover: 0 12px 30px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Typography */
    --font-main: 'Poppins', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;
    --footer-height: 80px;
}

html {
    scroll-behavior: smooth;
    min-height: 100vh;
}

a {
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform var(--transition);
    transform-origin: bottom right;
}

a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Dark Theme */
body.dark-theme {
    --primary-color: #8a84ff;
    --secondary-color: #7a72e9;
    --accent-color: #ff7a94;
    --text-color: #e0e0e0;
    --light-text: #b0b0b0;
    --white: #333;
    --bg-color: #121212;
    --card-bg: rgba(40, 40, 40, 0.95);
    --border-color: #444;
    --box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    --header-bg: linear-gradient(135deg, #403a99, #353088);
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #f5f7ff 0%, #e9ecff 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

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

/* Main content - make it expand to push footer to bottom */
main {
    flex: 1;
}

/* Header Styles */
header {
    background: var(--header-bg);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

header .logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

header .logo span {
    color: #ffd700;
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    width: 35px;
    height: 30px;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 2px;
    display: block;
}

/* Mobile menu active state */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Header animations */
header .logo a:hover span {
    transform: scale(1.1);
}

/* Navigation Menu */
header nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 20px;
}

header nav ul li {
    margin-left: 1.5rem;
}

/* Mobile Navigation */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }
    
    header nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: var(--header-bg);
        z-index: 1000;
        transition: all 0.3s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        display: flex;
        flex-direction: column;
        padding: 3rem 1.5rem 1.5rem;
        box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }
    
    header nav.active {
        right: 0;
    }
    
    /* Add overlay when menu is open */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    header nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    header nav ul li {
        margin-left: 0;
        width: 100%;
    }
    
    header nav ul li a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        position: relative;
        overflow: hidden;
        transition: all 0.2s ease;
    }
    
    header nav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.15);
        transform: translateX(5px);
    }
    
    header nav ul li a::before {
        content: '';
        position: absolute;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        transition: left 0.5s ease;
    }
    
    header nav ul li a:hover::before {
        left: 100%;
    }
    
    .search-container {
        margin-left: 0;
        margin-bottom: 1.5rem;
        width: 100%;
    }
    
    #search-input {
        width: 100%;
    }
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 1.5rem;
}

#search-input {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    color: white;
    transition: all 0.3s ease;
}

#search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

#search-input:focus {
    border-color: white;
    background-color: rgba(255,255,255,0.2);
}

#search-btn {
    padding: 8px 16px;
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.4);
    opacity: 0;
    transition: opacity var(--transition);
    z-index: -1;
}

#search-btn:hover::before {
    opacity: 1;
}

#search-btn:hover {
    background-color: rgba(255,255,255,0.3);
    border-color: white;
    transform: translateY(-1px);
}

#search-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.7);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

#search-btn:focus:not(:active)::after {
    animation: ripple 1.5s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.7;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Theme Toggle Button */
#theme-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

#theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#theme-toggle svg {
    transition: transform 0.3s ease;
}

body.dark-theme #theme-toggle svg {
    transform: rotate(180deg);
}

header nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced header navigation effects */
header nav ul li a {
    position: relative;
    overflow: hidden;
}

header nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease, left 0.3s ease;
}

header nav ul li a:hover::before {
    width: 100%;
    left: 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(94, 84, 217, 0.95) 0%, rgba(76, 66, 192, 0.95) 100%);
    color: white;
    padding: 6rem 0 4rem;
    text-align: center;
    border-radius: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive hero section */
@media (max-width: 767px) {
    .hero {
        padding: 5rem 1.5rem 4rem;
        min-height: auto;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.25rem !important;
        line-height: 1.25;
        margin-bottom: 1.25rem;
        padding: 0 0.5rem;
    }
    
    .hero p {
        font-size: 1.1rem !important;
        line-height: 1.6;
        padding: 0 0.5rem;
        max-width: 100%;
    }
    
    .hero-content {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .btn-primary {
        padding: 1rem 2rem;
        font-size: 1rem;
        margin-top: 2rem;
        min-width: 200px;
    }
}

/* Extra small devices (480px and below) */
@media (max-width: 480px) {
    .hero {
        padding: 4.5rem 1rem 3.5rem;
    }
    
    .hero h1 {
        font-size: 1.85rem !important;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
    }
    
    .btn-primary {
        padding: 0.85rem 1.75rem;
        font-size: 0.95rem;
        margin-top: 1.5rem;
        width: 100%;
        max-width: 280px;
    }
    
    .hero::before {
        background-image: radial-gradient(circle at center, rgba(108, 99, 255, 0.2) 0%, rgba(255, 101, 132, 0.1) 50%, transparent 100%);
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
    animation: float 15s ease-in-out infinite;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, var(--bg-color), transparent);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.35rem;
    opacity: 0.95;
    max-width: 750px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    font-weight: 300;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-cta {
    display: inline-block;
    background: var(--white);
    color: var(--primary-dark);
    padding: 1rem 2.5rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
}

/* Section Styles */
.section {
    padding: 5rem 0;
    background-color: var(--white);
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
    position: relative;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(5px, -5px) rotate(1deg);
    }
    50% {
        transform: translate(0, 10px) rotate(0deg);
    }
    75% {
        transform: translate(-5px, -5px) rotate(-1deg);
    }
}

/* Categories Grid Styles */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.category-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Enhanced hover effects for category cards */
.category-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f9faff 100%);
}

/* Add subtle animation to category cards */
@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.category-card:hover {
    animation: none; /* Disable animation on hover to allow for transform */
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.category-icon {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(255, 101, 132, 0.1));
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.category-card:hover .category-icon {
    transform: scale(1.15);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.3), rgba(255, 101, 132, 0.3));
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.2);
}

.icon {
    font-size: 2.5rem;
    display: block;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.category-card:hover .category-title {
    color: var(--primary-color);
}

.category-description {
    color: var(--light-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* View All Button */
.view-all-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
    font-size: 1rem;
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* Spacing Utilities */
.mt-8 {
    margin-top: 2rem;
}

.text-center {
    text-align: center;
}

/* Improved Vertical Layout for Mobile */
@media (max-width: 767px) {
    /* Container adjustments for wider cards */
    .container {
        padding: 0 0.25rem;
    }
    
    /* Enhanced section spacing for better vertical rhythm */
    section {
        margin-bottom: 3rem;
        padding-top: 1.25rem;
    }
    
    /* Typography adjustments for vertical readability */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.25;
        margin-bottom: 1.25rem;
    }
    
    /* Categories grid with optimized vertical layout */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0;
        margin-top: 3rem;
    }
    
    .category-card {
        padding: 2.5rem 1.75rem;
        box-shadow: var(--shadow-light);
        border-radius: 20px;
        transform: translateY(0);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border: 1px solid var(--border-light);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: 280px;
        justify-content: space-between;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }
    
    .category-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-color);
    }
    
    .category-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
        background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(255, 101, 132, 0.1));
        border-radius: 50%;
    }
    
    .icon {
        font-size: 2.25rem;
    }
    
    .category-title {
        font-size: 1.45rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    .category-description {
        font-size: 1rem;
        line-height: 1.65;
    }
    
    /* Articles section vertical layout */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0;
        width: 100%;
        margin: 0 auto;
    }
    
    .article-card {
        display: flex;
        flex-direction: column;
        min-height: 380px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .article-card img {
        height: 200px;
        object-fit: cover;
    }
    
    .article-content {
        padding: 1.5rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .article-title {
        font-size: 1.45rem;
        margin-bottom: 0.75rem;
    }
    
    .article-excerpt {
        font-size: 1rem;
        line-height: 1.65;
        margin-bottom: 1.25rem;
    }
    
    /* Footer vertical layout */
    footer {
        padding: 2.5rem 1.5rem;
        text-align: center;
    }
    
    footer .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    footer .footer-links {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    }


/* Extra small devices (480px and below) */
@media (max-width: 480px) {
    .categories-grid {
        gap: 1.5rem;
    }
    
    .category-card {
        padding: 2rem 1.25rem;
        border-radius: 16px;
    }
    
    .category-icon {
        width: 75px;
        height: 75px;
        margin-bottom: 1rem;
    }
    
    .icon {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1.3rem;
        margin-bottom: 0.65rem;
    }
    
    .category-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Add swipe indicator for mobile users */
    .category-card::after {
        content: '';
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
        border-radius: 3px;
        opacity: 0.7;
    }
}

/* Improved responsive breakpoints */
@media (min-width: 640px) and (max-width: 767px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
}

@keyframes float {
    0% { transform: translate(0%, 0%) rotate(0deg); }
    33% { transform: translate(5%, 5%) rotate(5deg); }
    66% { transform: translate(-5%, 5%) rotate(-5deg); }
    100% { transform: translate(0%, 0%) rotate(0deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

/* Apply animations to elements when they appear in viewport */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(94, 84, 217, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(76, 66, 192, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 90, 122, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.section > * {
    position: relative;
    z-index: 2;
}

.section:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.95);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #667eea;
    text-align: center;
    font-weight: 600;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    position: relative;
}

/* Enhanced Article Card Styles */
.article-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
    animation: fadeInUp 0.6s ease-out both;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(108, 99, 255, 0.3);
}

.article-card:active {
    transform: translateY(-3px);
}

.article-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
    border-radius: 16px 16px 0 0;
}

.article-card:hover img {
    transform: scale(1.08);
}

.article-card-content {
    padding: 1.75rem;
    position: relative;
}

.article-card-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.article-card:hover .article-card-category {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.article-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.article-card:hover .article-card-title {
    color: var(--primary-color);
}

.article-card-description {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-light);
}

.article-card-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-card-date svg {
    width: 16px;
    height: 16px;
}

.article-card-read-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-card-read-time svg {
    width: 16px;
    height: 16px;
}

/* Section Title Enhancement */
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2rem;
    position: relative;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Responsive Grid Adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 767px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding: 0 0.5rem;
    }
    
    .article-card {
        border-radius: 16px;
        overflow: hidden;
        box-shadow: var(--shadow-light);
    }
    
    .article-card img {
        height: 200px;
        object-fit: cover;
    }
    
    .article-card-content {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.75rem;
        text-align: center;
        padding: 0 1rem;
        line-height: 1.3;
    }
    
    .section-description {
        text-align: center;
        padding: 0 1rem;
        line-height: 1.6;
    }
    
    .view-all-btn {
        font-size: 0.95rem;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .articles-grid {
        gap: 1.5rem;
    }
    
    .article-card img {
        height: 180px;
    }
    
    .article-card-content {
        padding: 1rem;
    }
    
    .article-category {
        font-size: 0.85rem;
        padding: 0.35rem 0.75rem;
    }
    
    .article-title {
        font-size: 1.25rem;
        line-height: 1.3;
        margin: 0.75rem 0;
    }
    
    .article-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    
    .section-description {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    /* Improve touch targets for mobile */
    .btn-primary, .btn-secondary, .view-all-btn {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 4rem;
    padding: 1rem 0;
}

.pagination button {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

.page-numbers {
    display: flex;
    margin: 0 1rem;
}

.page-numbers button {
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0.2rem;
}

.page-numbers button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-numbers {
        margin: 0.5rem 0;
    }
    
    .pagination button {
        margin: 0.2rem;
        padding: 0.6rem 1rem;
    }
}

/* Search Section Styles - High specificity to ensure priority */
/* Modern Search Styles */
#search-section .search-container {
    margin-left: 0 !important;
    margin-bottom: 2rem !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 100 !important;
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 隐藏搜索建议框 */
#search-suggestions {
    display: none !important;
}

#search-section #search-input {
    padding: 16px 24px !important;
    border: 2px solid #e0e0e0 !important;
    background-color: white !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    outline: none !important;
    color: #2d3748 !important;
    transition: all 0.3s ease !important;
    flex: 1 !important;
    min-height: 56px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

#search-section #search-input::placeholder {
    color: #a0aec0 !important;
    font-weight: 400 !important;
}

#search-section #search-input:focus {
    border-color: #4299e1 !important;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15) !important;
    transform: translateY(-1px) !important;
}

#search-section #search-btn {
    padding: 16px 28px !important;
    background: linear-gradient(135deg, #4299e1, #3182ce) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    min-height: 56px !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3) !important;
}

#search-section #search-btn:hover {
    background: linear-gradient(135deg, #3182ce, #2c5282) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4) !important;
}

#search-section #search-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3) !important;
}

/* Search Results Styles */
.search-results {
    margin-top: 40px;
    display: none;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.search-header h2 {
    color: #fff;
    font-size: 1.8rem;
    margin: 0;
}

#clear-search {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#clear-search:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.results-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.no-results {
    color: #ccc;
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px 0;
    font-size: 1.1rem;
}

/* Highlight search terms */
mark {
    background-color: rgba(108, 99, 255, 0.4);
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
}

.article-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(108, 99, 255, 0.2);
}

.article-card:active {
    transform: translateY(-2px);
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 12px 12px 0 0;
}

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

.article-card-content {
    padding: 1.5rem;
    position: relative;
}

.article-card-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-color);
    line-height: 1.4;
}

.article-card-description {
    color: var(--light-text);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.article-card-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-card-link:hover {
    color: var(--secondary-color);
}

/* Favorite Button Styles */
.favorite-btn {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    padding: 5px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #f44336; /* Red color for active favorites */
    transform: scale(1.1);
}

.favorite-btn.active svg {
    fill: #f44336;
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
}

/* Favorites Page Styles */
.favorites-content {
    margin-top: 40px;
}

.no-favorites {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.no-favorites p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.no-favorites .btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.no-favorites .btn:hover {
    background-color: var(--secondary-color);
}

.error-message {
    text-align: center;
    color: #f44336;
    font-size: 1.1rem;
    padding: 40px;
}

/* Article Card Footer Styles */
.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.article-card-footer .read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-card-footer .read-more:hover {
    color: var(--secondary-color);
}

/* Article Detail Page */
.article-section {
    padding: 3rem 0;
    background-color: var(--bg-color);
}

.article {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.article-header {
    margin-bottom: 2rem;
}

/* Back Button Styles */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.back-button:active {
    transform: translateY(0);
}

/* Responsive Back Button */
@media (max-width: 768px) {
    .back-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }
    
    .back-button svg {
        width: 20px;
        height: 20px;
    }
}

.article-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-description {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.article-image {
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.article-content {
    color: #333;
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Mobile back to top button */
@media screen and (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    /* Mobile search styles */
    #search-section .search-container {
        margin-left: 0 !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        max-width: none !important;
        padding: 0 1rem !important;
    }
    
    #search-section #search-input {
        padding: 16px 20px !important;
        border: 2px solid #e0e0e0 !important;
        background-color: white !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 400 !important;
        color: #2d3748 !important;
        width: 100% !important;
        min-height: 56px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    }
    
    #search-section #search-input::placeholder {
        color: #a0aec0 !important;
    }
    
    #search-section #search-input:focus {
        border-color: #4299e1 !important;
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15) !important;
    }
    
    #search-section #search-btn {
        padding: 16px 20px !important;
        background: linear-gradient(135deg, #4299e1, #3182ce) !important;
        color: white !important;
        border: none !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        min-height: 56px !important;
        width: 100% !important;
        box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3) !important;
    }
    
    #search-section #search-btn:hover {
        background: linear-gradient(135deg, #3182ce, #2c5282) !important;
        box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4) !important;
    }
}

@media screen and (max-width: 480px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 38px;
        height: 38px;
    }
    
    /* Small mobile search styles */
    #search-section .search-container {
        margin-left: 0 !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        max-width: none !important;
        padding: 0 1rem !important;
    }
    
    #search-section #search-input {
        padding: 16px 18px !important;
        border: 2px solid #e0e0e0 !important;
        background-color: white !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 400 !important;
        color: #2d3748 !important;
        width: 100% !important;
        min-height: 56px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    }
    
    #search-section #search-input::placeholder {
        color: #a0aec0 !important;
    }
    
    #search-section #search-input:focus {
        border-color: #4299e1 !important;
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15) !important;
    }
    
    #search-section #search-btn {
        padding: 16px 18px !important;
        background: linear-gradient(135deg, #4299e1, #3182ce) !important;
        color: white !important;
        border: none !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        min-height: 56px !important;
        width: 100% !important;
        box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3) !important;
    }
    
    #search-section #search-btn:hover {
        background: linear-gradient(135deg, #3182ce, #2c5282) !important;
        box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4) !important;
    }
}

/* Contact Section */
.contact-section {
    padding: 60px 0;
    background-color: var(--background-light);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 40px;
    align-items: flex-start;
}

.contact-form-container,
.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-form {
    background-color: #fff;
    padding: 30px;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
    color: var(--text-dark);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
     box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
    transition: color 0.3s ease;
}

.form-input:focus::placeholder,
.form-textarea:focus::placeholder {
    color: transparent;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

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

/* Input validation styles */
.form-input:invalid,
.form-textarea:invalid {
    border-color: #e74c3c; /* Error color */
}

.form-input:valid:focus,
.form-textarea:valid:focus {
    border-color: #2ecc71; /* Success color */
}

/* Responsive adjustments for form */
@media (max-width: 768px) {
    .contact-form {
        padding: 24px;
    }
    
    .form-input,
    .form-textarea {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .btn-primary {
        width: 100%;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .contact-content {
        gap: 30px;
    }
    
    .contact-form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* Footer Styles */
footer {
    background-color: rgba(51, 51, 51, 0.95);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-radius: 8px 8px 0 0;
}

footer .footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

footer .footer-links a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

footer .footer-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

footer .footer-links a:not(:last-child)::after {
    content: '|';
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* For mobile view */
@media screen and (max-width: 768px) {
    footer .footer-links {
        gap: 1rem;
        flex-direction: column;
    }
    
    footer .footer-links a:not(:last-child)::after {
        display: none;
    }
    
    footer .footer-links a {
        font-size: 0.9rem;
    }
}

/* Mobile Enhancements */
@media screen and (max-width: 768px) {
    /* Add subtle background pattern for mobile */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: radial-gradient(circle at 10% 20%, rgba(94, 84, 217, 0.1) 0%, rgba(76, 66, 192, 0.1) 90%);
        pointer-events: none;
        z-index: -1;
    }
    
    /* Improve hero section for mobile */
    .hero {
        margin: 1rem;
        padding: 4rem 1.5rem 3rem;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }
    
    /* Add decorative elements */
    .section::before {
        content: '';
        display: block;
        width: 60px;
        height: 4px;
        background: var(--gradient-primary);
        margin: 0 auto 2rem;
        border-radius: 2px;
    }
    
    /* Enhance article cards for mobile */
    .article-card {
        border-radius: 16px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
        transition: all 0.4s ease;
        overflow: hidden;
        margin-bottom: 1.5rem;
        transform: translateY(0);
    }
    
    .article-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--gradient-primary);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }
    
    .article-card:active::after {
        transform: scaleY(1);
    }
    
    .article-card img {
        height: 180px;
        border-radius: 16px 16px 0 0;
    }
    
    .article-card-content {
        padding: 1.5rem;
        background-color: var(--card-bg);
    }
    
    .article-card-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
        line-height: 1.4;
        font-weight: 600;
    }
    
    .article-card-description {
        font-size: 0.95rem;
        line-height: 1.65;
        color: var(--light-text);
        margin-bottom: 1rem;
    }
    
    /* Improve article grid spacing */
    .articles-grid {
        gap: 1.5rem;
        margin-top: 2.5rem;
        display: flex;
        flex-direction: column;
    }
    
    /* Add visual separators between sections */
    .section {
        position: relative;
        overflow: hidden;
        border-radius: 16px;
        margin: 0 1rem 1.5rem;
        padding: 3rem 1.5rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    }
    
    /* Enhance section titles */
    .section-title {
        position: relative;
        display: inline-block;
        padding-bottom: 0.5rem;
        margin-bottom: 2rem;
        font-size: 1.8rem;
        font-weight: 600;
    }
    
    .section-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 3px;
        background: var(--gradient-primary);
        border-radius: 2px;
    }
    
    /* Add hover effects for mobile (touch feedback) */
    .article-card:active {
        transform: translateY(-4px) scale(0.98);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    }
    
    /* Improve form elements for mobile */
    input, textarea, button {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* Enhance touch targets */
    a, button, .favorite-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improve readability */
    p {
        letter-spacing: 0.02em;
        word-spacing: 0.05em;
    }
    
    /* Back to top button improvements */
    .back-to-top {
        width: 50px;
        height: 50px;
        box-shadow: 0 5px 15px rgba(94, 84, 217, 0.4);
    }
    
    /* Improve article detail view */
    .article {
        padding: 2rem 0.75rem;
        border-radius: 16px;
        width: 100%;
        max-width: 98%;
        margin: 0 auto;
    }
    
    .article-title {
        font-size: 1.9rem;
        line-height: 1.25;
        margin-bottom: 1.5rem;
        font-weight: 700;
        letter-spacing: -0.02em;
    }
    
    .article-content {
        font-size: 1.05rem;
        line-height: 1.75;
        letter-spacing: 0.01em;
        word-spacing: 0.03em;
    }
    
    .article-content p {
        margin-bottom: 1.5rem;
        text-align: left;
        hyphens: auto;
    }
        /* Mobile header adjustments */
    header {
        padding: 0.8rem 0;
    }
    
    header .container {
        flex-direction: row;
        align-items: center;
        position: relative;
    }
    
    header .logo a {
        font-size: 1.5rem;
    }
    
    /* Show hamburger menu */
      .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        transition: transform 0.3s ease;
        cursor: pointer;
      }
      
      .menu-toggle:active {
        transform: scale(0.95);
    }
    
    /* Hide navigation by default */
    header nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 60px 0 20px;
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
        max-height: 0;
    }
    
    /* Show navigation when active */
      header nav.active,
      #nav-menu.active {
        display: block;
        right: 0;
        max-height: 100vh;
      }
    
    /* Navigation overlay */
    header nav.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    header nav ul {
        flex-direction: column;
        margin-top: 0;
        padding: 0 20px;
    }
    
    header nav ul li {
        margin-left: 0;
        margin-bottom: 0.3rem;
        width: 100%;
    }
    
    header nav ul li a {
        display: block;
        padding: 0.8rem 1rem;
        border-radius: 6px;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
    }
    
    header nav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.2);
        border-left-color: white;
        transform: translateX(5px);
    }
    
    /* Mobile search styles */
    .search-container {
        margin-left: 0;
        margin-bottom: 1rem;
        width: 100%;
        padding: 0 20px;
        display: flex;
    }
    
    #search-input {
        flex: 1;
        width: 100%;
        padding: 10px 12px;
        border-radius: 25px 0 0 25px;
        border-right: none;
    }
    
    #search-btn {
        border-radius: 0 25px 25px 0;
        border-left: none;
    }
    
    /* Hamburger menu animation */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Theme toggle positioning in mobile */
    #theme-toggle {
        margin-right: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 3.5rem 1.25rem 2.5rem;
        margin: 0.75rem;
        border-radius: 12px;
    }
    
    .hero h1 {
        font-size: 1.7rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 0;
    }
    
    .section {
        padding: 2.5rem 1.25rem;
        margin: 0 0.75rem 1.25rem;
        border-radius: 12px;
    }
    
    .section-title {
        font-size: 1.7rem;
        margin-bottom: 1.5rem;
        text-align: center;
        padding-bottom: 0.4rem;
    }
    
    .section::before {
        width: 50px;
        margin-bottom: 1.5rem;
    }
    
    .article-card {
        margin-bottom: 1.25rem;
        border-radius: 12px;
    }
    
    .article-card img {
        height: 160px;
        border-radius: 12px 12px 0 0;
    }
    
    .article-card-content {
        padding: 1.25rem;
    }
    
    .article-card-title {
        font-size: 1.2rem;
        margin-bottom: 0.7rem;
        line-height: 1.4;
    }
    
    .article-card-description {
        font-size: 0.9rem;
        margin-bottom: 0.9rem;
        line-height: 1.6;
    }
    
    /* Improve articles grid for small screens */
    .articles-grid {
        gap: 1.25rem;
        margin-top: 2rem;
    }
    
    /* Add loading animation for article cards */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .article-card {
        animation: fadeInUp 0.6s ease forwards;
        opacity: 0;
    }
    
    /* Stagger animation for article cards */
    .article-card:nth-child(1) { animation-delay: 0.1s; }
    .article-card:nth-child(2) { animation-delay: 0.2s; }
    .article-card:nth-child(3) { animation-delay: 0.3s; }
    .article-card:nth-child(4) { animation-delay: 0.4s; }
    .article-card:nth-child(5) { animation-delay: 0.5s; }
    .article-card:nth-child(6) { animation-delay: 0.6s; }
    
    /* Improve touch targets on very small screens */
    a, button, .favorite-btn {
        min-height: 48px;
        min-width: 48px;
        font-size: 16px;
    }
    
    /* Improve form elements on very small screens */
    input, textarea, button {
        padding: 14px 16px;
    }
    
    /* Improve back to top button on very small screens */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
    }
    
    /* Improve article detail view on very small screens */
    .article {
        padding: 1.5rem 0.5rem;
        border-radius: 12px;
        width: 100%;
        max-width: 99%;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    .article-title {
        font-size: 1.6rem;
        line-height: 1.2;
        margin-bottom: 1.25rem;
        font-weight: 700;
        letter-spacing: -0.01em;
        word-wrap: break-word;
    }
    
    .article-content {
        font-size: 1.05rem;
        line-height: 1.75;
        letter-spacing: 0.015em;
        word-spacing: 0.02em;
    }
    
    .article-content p {
        margin-bottom: 1.25rem;
        text-align: left;
        hyphens: auto;
        word-wrap: break-word;
    }
    
    /* Footer adjustments */
    footer {
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }
    
    /* Ensure text doesn't overflow */
    .article-card-title, .section-title, .article-title {
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Header logo size reduction */
    header .logo a {
        font-size: 1.4rem;
    }
    
    /* Ensure navigation items are comfortable to tap */
    header nav ul li a {
        padding: 1rem;
        font-size: 1.1rem;
    }
}