/* CSS Design System for Devix247 */

:root {
    /* Color Palette - Vibrant Light Mode First (Default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Layout Constants */
    --navbar-height: 80px;
    --container-width: 1200px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-hero: radial-gradient(circle at top, rgba(37, 99, 235, 0.08) 0%, rgba(248, 250, 252, 0) 70%);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-secondary: #161f30;
    --bg-tertiary: #1f2c42;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2e3d56;
    --gradient-hero: radial-gradient(circle at top, rgba(59, 130, 246, 0.15) 0%, rgba(11, 15, 25, 0) 70%);
}

/* Base resets & styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Typography & Buttons */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* Navbar Style */
.navbar {
    height: var(--navbar-height);
    background-color: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-smooth);
}

[data-theme="dark"] .navbar {
    background-color: rgba(11, 15, 25, 0.8);
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-accent {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

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

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
}

/* Hero Section */
.hero {
    position: relative;
    padding-top: calc(var(--navbar-height) + 4rem);
    padding-bottom: 5rem;
    background: var(--gradient-hero);
    overflow: hidden;
    text-align: center;
}

.hero-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.hero-orb-1 {
    top: 10%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: #3b82f6;
}

.hero-orb-2 {
    bottom: 20%;
    right: 15%;
    width: 400px;
    height: 400px;
    background: #8b5cf6;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
}

.hero-stats {
    display: flex;
    gap: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
    width: 100%;
    max-width: 800px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition-smooth);
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ad Placements */
.ad-container {
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.ad-slot {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ad-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sections Global */
section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.section-tag {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
}

/* Categories Section */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.category-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.05);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.category-card h3 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.category-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Articles Section */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.article-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.article-card:hover h3 a {
    color: var(--accent-color);
}

.article-card h3 a::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.article-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

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

.article-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.article-category {
    color: var(--accent-color);
    font-weight: 600;
}

.article-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.article-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

.article-featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.article-featured .article-image {
    aspect-ratio: auto;
    height: 100%;
}

.article-featured .article-content {
    padding: 2.5rem;
    justify-content: center;
}

.section-cta {
    text-align: center;
    margin-top: 4rem;
}

/* Newsletter Section */
.newsletter-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

.newsletter-content h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.newsletter-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.newsletter-form .input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 500px;
}

.newsletter-form input {
    flex-grow: 1;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-smooth);
}

.newsletter-form input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.newsletter-visual {
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.float-card {
    position: absolute;
    background: rgba(22, 31, 48, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.fc-1 {
    top: 10%;
    left: 10%;
    animation: float 4s ease-in-out infinite;
}

.fc-2 {
    top: 50%;
    right: 5%;
    animation: float 4s ease-in-out infinite 1.3s;
}

.fc-3 {
    bottom: 10%;
    left: 25%;
    animation: float 4s ease-in-out infinite 2.6s;
}

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

/* Tools Section */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.tool-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.tool-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.tool-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tool-link {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
}

.testimonial-stars {
    color: #fbbf24;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.testimonial-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 45px;
    height: 45px;
    background: var(--gradient-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.testimonial-author strong {
    display: block;
    color: var(--text-primary);
}

.testimonial-author span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Footer Section */
.footer {
    background-color: #f1f5f9;
    border-top: 1px solid var(--border-color);
    padding: 5rem 0 2rem 0;
    color: var(--text-secondary);
}

[data-theme="dark"] .footer {
    background-color: #080c14;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-primary);
}

.social-link:hover {
    background: var(--gradient-accent);
    color: white;
    transform: translateY(-2px);
}

.footer-links h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 99;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .article-featured {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
    .article-featured .article-image {
        aspect-ratio: 16/9;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .nav-links {
        position: fixed;
        top: var(--navbar-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--navbar-height));
        background-color: var(--bg-primary);
        flex-direction: column;
        align-items: center;
        padding-top: 3rem;
        transition: 0.3s ease;
        border-top: 1px solid var(--border-color);
    }
    .nav-links.active {
        left: 0;
    }
    .hamburger {
        display: flex;
    }
    .newsletter-card {
        grid-template-columns: 1fr;
        padding: 2.5rem;
    }
    .newsletter-visual {
        display: none;
    }
    .hero-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        text-align: center;
    }
}
