@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --primary-dark: #0a0a0f;
    --secondary-dark: #1a1a2e;
    --accent-purple: #6c5ce7;
    --accent-gold: #fdcb6e;
    --accent-green: #00b894;
    --text-light: #e8e8f0;
    --text-muted: #a0a0b0;
    --border-subtle: #2d2d3d;
    --card-bg: #16162a;
    --gradient-primary: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-gold: linear-gradient(135deg, #fdcb6e, #e17055);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Magical background effect */
.magical-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at 20% 80%, rgba(108, 92, 231, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(253, 203, 110, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(0, 184, 148, 0.05) 0%, transparent 50%);
}

/* Floating particles */
.particle {
    position: absolute;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.6; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Crimson Text', serif;
    font-size: 1.8rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: "✦";
    font-size: 1.2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-purple);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main content */
main {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Hero section */
.hero {
    padding: 4rem 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.hero h1 {
    font-family: 'Crimson Text', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    margin-bottom: 1rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.4s both;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Featured articles section */
.featured-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Crimson Text', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.difficulty-beginner {
    background: rgba(0, 184, 148, 0.2);
    color: var(--accent-green);
}

.difficulty-intermediate {
    background: rgba(253, 203, 110, 0.2);
    color: var(--accent-gold);
}

.difficulty-advanced {
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent-purple);
}

.article-card h3 {
    font-family: 'Crimson Text', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.article-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 1rem;
    color: var(--accent-gold);
}

.read-more::after {
    content: "→";
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(5px);
}

/* View all articles button */
.view-all-container {
    text-align: center;
    margin-top: 3rem;
}

.view-all-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    color: var(--accent-purple);
    text-decoration: none;
    border: 2px solid var(--accent-purple);
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

/* Search and filter */
.search-filter {
    margin-bottom: 3rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 25px;
    color: var(--text-light);
    font-size: 1rem;
    width: 300px;
    max-width: 100%;
}

.search-box::placeholder {
    color: var(--text-muted);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

/* Article page styles */
.article-header {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
}

.article-title {
    font-family: 'Crimson Text', serif;
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    margin: 3rem 0 1rem;
    color: var(--accent-purple);
}

.article-content h3 {
    font-family: 'Crimson Text', serif;
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--accent-gold);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content code {
    background: var(--card-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--accent-green);
}

.article-content pre {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-left: 4px solid var(--accent-purple);
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--accent-gold);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

/* Navigation between articles */
.article-nav {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
}

.article-nav a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-nav a:hover {
    color: var(--accent-gold);
}

/* Footer */
footer {
    background: var(--secondary-dark);
    padding: 3rem 2rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-purple);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Error message */
.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .featured-section {
        padding: 3rem 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 0 1rem 4rem;
    }
    
    .article-nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-buttons {
        justify-content: center;
    }
}

/* ===========================================
    SHARE DROPDOWN COMPONENT
    =========================================== */

.share-dropdown {
    position: relative;
    display: inline-block;
}

.share-button {
    background: transparent;
    border: 1px solid #64ffda;
    color: #64ffda;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-button:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-1px);
}

.share-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.share-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.share-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.share-dropdown.open .share-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
    color: #64ffda;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.share-dropdown-item:hover {
    background: rgba(100, 255, 218, 0.1);
}

.share-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.share-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===========================================
    SHARE DROPDOWN STYLES
    =========================================== */

.share-dropdown {
    position: relative;
    display: inline-block;
}

.share-button {
    background: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.share-button:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-1px);
}

.share-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.share-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.share-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.share-dropdown.open .share-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.share-dropdown-item:hover {
    background: rgba(100, 255, 218, 0.1);
}

.share-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.share-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Platform-specific icon colors */
.twitter-icon { fill: #1da1f2; }
.linkedin-icon { fill: #0077b5; }
.reddit-icon { fill: #ff4500; }
.facebook-icon { fill: #1877f2; }
.copy-icon { fill: var(--accent-green); }

/* Mobile responsive */
@media (max-width: 768px) {
    .share-dropdown-content {
        right: -50px;
        min-width: 180px;
    }
}