/* Base Styles & Variables */
:root {
    --primary-dark: #0f172a;
    --secondary-dark: #1e293b;
    --accent-color: #38bdf8;
    --highlight-color: #f43f5e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
    object-fit: cover;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header & Navigation */
header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--highlight-color);
}

.date-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--primary-dark);
}

.btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    padding: 15px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

nav ul::-webkit-scrollbar {
    display: none;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    height: 3px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 280px;
    height: 100vh;
    background: var(--primary-dark);
    z-index: 1001;
    transition: var(--transition);
    padding: 80px 0 20px 0;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Allow scrolling within the menu if content is long */
    display: none;
    
}

.mobile-nav.active {
    right: 0;
    display: block;
}

.mobile-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    list-style: none;
}

.mobile-nav ul li {
    width: 100%;
}

.mobile-nav ul li a {
    display: block;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-nav ul li:last-child a {
    border-bottom: none;
}

.mobile-nav ul a:hover, .mobile-nav ul a.active {
    color: var(--accent-color);
    background: var(--secondary-dark);
}

/* Overlay for mobile menu */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    height: 100vh;
    width: 100vw;
}

nav a {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    position: relative;
    padding-bottom: 5px;
}

nav a:hover, nav a.active {
    color: var(--accent-color);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--secondary-dark);
    border-radius: 20px;
    padding: 8px 15px;
    margin-left: auto;
    width: 200px;
    transition: var(--transition);
}

.search-bar:focus-within {
    width: 250px;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    margin-left: 8px;
}

/* Main Content Areas */
main {
    padding: 30px 0;
    min-height: 70vh;
}

section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-left: 4px solid var(--highlight-color);
    padding-left: 15px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.view-all {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Article Grid - Home Page */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    background: var(--secondary-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    height: 180px;
    width: 100%;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    transition: var(--transition);
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    align-self: flex-start;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

/* Featured Article - Home Page */
.featured-article {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
    background: var(--secondary-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 40px;
}

.featured-image {
    height: 100%;
    min-height: 350px;
}

.featured-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-badge {
    background: var(--highlight-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
    width: fit-content;
}

.featured-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
}

.featured-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    font-weight: 600;
    transition: var(--transition);
}

.read-more:hover {
    gap: 12px;
}

/* Trending Section */
.trending-section {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 40px;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.trending-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.trending-icon {
    color: var(--highlight-color);
    font-size: 1.5rem;
}

.trending-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.trending-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.trending-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(244, 63, 94, 0.2);
    line-height: 1;
}

.trending-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.trending-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Newsletter Section */
.newsletter {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.newsletter::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.newsletter h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    position: relative;
}

.newsletter p {
    max-width: 600px;
    margin: 0 auto 25px;
    opacity: 0.9;
    position: relative;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
    position: relative;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(5px);
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
}

.newsletter-form button {
    background: var(--highlight-color);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #e11d48;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--secondary-dark);
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    padding: 10px ;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--accent-color);
    position: relative;
    padding-bottom: 10px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--highlight-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.footer-bottom a {
    color: var(--accent-color);
}

/* Category Page Styles */
.category-header {
    text-align: center;
    padding: 40px 0;
    background: var(--secondary-dark);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--accent-color), var(--highlight-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.category-description {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.category-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color);
    color: var(--primary-dark);
    border-color: var(--accent-color);
}

/* Detail Page Styles */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.detail-header {
    text-align: center;
    margin-bottom: 30px;
}

.detail-category {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.detail-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 15px;
}

.detail-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.detail-image {
    width: 100%;
    height: 450px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 30px;
}

.detail-image img {
    width: 100%;
    height: 100%;
}

.detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.detail-content p {
    margin-bottom: 20px;
}

.detail-content h2 {
    font-size: 1.6rem;
    margin: 30px 0 15px;
    color: var(--accent-color);
}

.detail-content blockquote {
    border-left: 4px solid var(--highlight-color);
    padding: 20px;
    background: var(--secondary-dark);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 25px 0;
    font-style: italic;
    font-size: 1.2rem;
}

.share-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.share-btn {
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.share-btn.twitter {
    background: rgba(29, 155, 240, 0.15);
    color: #1da1f2;
}

.share-btn.facebook {
    background: rgba(59, 89, 152, 0.15);
    color: #3b5998;
}

.share-btn.linkedin {
    background: rgba(0, 119, 181, 0.15);
    color: #0077b5;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Privacy & Terms Page Styles */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--secondary-dark);
    padding: 40px;
    border-radius: var(--border-radius);
}

.legal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--accent-color);
    text-align: center;
}

.legal-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.legal-section h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--highlight-color);
}

.legal-section p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.legal-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.legal-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.last-updated {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 20px;
    opacity: 0.7;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .featured-article {
        grid-template-columns: 1fr;
    }

    .featured-image {
        min-height: 200px;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 15px;
        padding: 5px 0;
    }
.container{
    padding: 5px;
}
    .search-bar {
        width: 100%;
        order: 3;
        margin: 0;
    }

    .search-bar:focus-within {
        width: 100%;
    }

    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    /* Mobile Navigation Toggle */
    .nav-toggle {
        display: flex;
    }
    
    nav ul {
        display: none;
    }
}

@media (max-width: 600px) {
    .article-grid {
        grid-template-columns: 1fr;
    }

    .trending-list {
        grid-template-columns: 1fr;
    }

    .newsletter {
        padding: 30px 15px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .share-buttons {
        flex-wrap: wrap;
    }

    .share-btn {
        flex: 1;
        justify-content: center;
    }

    .legal-content {
        padding: 25px 15px;
    }

    .detail-title {
        font-size: 1.8rem;
    }

    .detail-image {
        height: 250px;
    }
    .featured-article{
        gap: 5px;
        margin-bottom: 5px;
    }
    .featured-content,.trending-section,.category-header,.article-content{
        padding: 5px;
    }
    .featured-title,.featured-description,.category-title,.category-header,.section-header,section,.article-excerpt,.trending-section{
        margin-bottom: 5px;
    }
    .article-grid{
        gap: 5px;
    }
    
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none; }

/* Dynamic Background Elements */
.bg-element {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.bg-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.bg-2 {
    width: 400px;
    height: 400px;
    background: var(--highlight-color);
    bottom: 10%;
    right: 5%;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -20px); }
    50% { transform: translate(-10px, 10px); }
    75% { transform: translate(15px, 15px); }
}

/* Page Transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
