/**
 * Main Stylesheet for Cognitive Nexus AI Website
 * Organized and modular CSS with clear sections
 * Enhances Tailwind with custom animations and effects
 */

/* Import CSS Variables */
@import url('./variables.css');

/* ======================
   Reset & Base Styles
   ====================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-dark);
    color: var(--color-text-secondary);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ======================
   Custom Scrollbar
   ====================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-dark);
}

/* ======================
   Typography
   ====================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

p {
    margin-bottom: var(--space-md);
}

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

a:hover {
    color: var(--color-primary);
}

code {
    font-family: var(--font-mono);
}

/* ======================
   Layout Container
   ====================== */

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

/* ======================
   Animations & Keyframes
   ====================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Float Animation - Slower */
@keyframes floatSlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(-5px, -20px);
    }
    75% {
        transform: translate(-10px, -10px);
    }
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(var(--color-primary-rgb), 0.6);
    }
}

/* Glow Pulse Effect */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Loading Animation */
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ======================
   Animation Utility Classes
   ====================== */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

/* Delay utilities for staggered animations */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* ======================
   Gradient Backgrounds
   ====================== */

.gradient-bg {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-lighter) 50%, var(--color-dark-card) 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

.bg-gradient-radial {
    background: radial-gradient(circle at center, var(--tw-gradient-stops));
}

/* Hero background enhancements */
#home {
    background: linear-gradient(180deg, var(--color-dark) 0%, #0d1019 50%, var(--color-dark) 100%);
}

/* ======================
   Text Effects
   ====================== */

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-glow {
    text-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.5);
}

/* ======================
   Card Styles
   ====================== */

.card-glass {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-light);
}

.card-hover-scale {
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.card-hover-scale:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-2xl);
}

.dark-card-enhanced {
    background: #000000;
}

/* ======================
   Button Styles
   ====================== */

.btn-primary {
    background: var(--color-primary);
    color: var(--color-dark);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-slow);
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--color-primary-light);
    box-shadow: var(--shadow-primary-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-slow);
    border: 2px solid var(--color-primary);
    cursor: pointer;
    display: inline-block;
}

.btn-secondary:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    box-shadow: var(--shadow-primary-sm);
}

/* ======================
   Hover Effects
   ====================== */

.hover-lift {
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(var(--color-primary-rgb), 0.2);
}

.hover-glow {
    transition: box-shadow var(--transition-slow);
}

.hover-glow:hover {
    box-shadow: var(--shadow-primary-md);
}

/* ======================
   Image Effects
   ====================== */

.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform var(--transition-slower);
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* ======================
   Loading States
   ====================== */

.skeleton {
    background: linear-gradient(90deg, #000000 25%, #0a0a0a 50%, #000000 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

/* ======================
   Focus States (Accessibility)
   ====================== */

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

a:focus,
button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ======================
   Grid Enhancements
   ====================== */

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

/* ======================
   Notification Styles
   ====================== */

.notification-enter {
    animation: slideUp 0.3s ease-out;
}

.notification-exit {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

/* ======================
   Custom Transitions
   ====================== */

.transition-smooth {
    transition: all var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-bounce {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ======================
   Accessibility
   ====================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-dark {
        background: #000;
    }
    
    .text-gray-400 {
        color: #ccc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ======================
   Print Styles
   ====================== */

@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ======================
   Responsive Utilities
   ====================== */

@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
}

/* ======================
   Blog-Specific Styles
   ====================== */

/* Blog Hero Section */
.blog-hero {
    position: relative;
    color: var(--color-text-secondary);
    padding: 8rem 0 3rem;
    text-align: center;
    overflow: hidden;
    background: var(--color-dark);
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(var(--color-primary-rgb), 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.2;
    pointer-events: none;
}

.blog-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
    pointer-events: none;
}

.blog-hero .container {
    position: relative;
    z-index: 1;
}

.blog-hero h1 {
    font-size: var(--font-size-5xl);
    margin-bottom: 0;
    font-weight: var(--font-weight-extrabold);
    color: var(--color-text-primary);
    text-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.3);
    letter-spacing: -0.02em;
}

.blog-hero h1 span {
    background: linear-gradient(135deg, var(--color-primary) 0%, #00dc8d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-left: 0.5rem;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: var(--line-height-relaxed);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Blog Controls */
.blog-controls {
    background: transparent;
    padding: var(--space-xl) 0;
    margin-top: 0;
}

.controls-toggle-wrapper {
    margin-bottom: var(--space-md);
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.02);
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
    width: 100%;
    justify-content: center;
}

.filter-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary);
}

.filter-toggle svg {
    width: 16px;
    height: 16px;
}

.controls-section {
    display: none;
}

.controls-section .search-box-wrapper {
    margin-bottom: var(--space-md);
}

.controls-section .search-box {
    width: 100%;
}

.controls-section .filters-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

@media (min-width: 768px) {
    .controls-section {
        display: block;
    }

    .controls-section .search-box-wrapper {
        margin-bottom: var(--space-md);
    }

    .controls-section .filters-section {
        flex-direction: row;
        align-items: center;
        padding-top: var(--space-md);
        gap: var(--space-xl);
    }
    
    .filter-group {
        flex: 1;
    }
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text-secondary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-border-primary);
    box-shadow: 0 6px 18px rgba(var(--color-primary-rgb), 0.06);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

/* Filter Groups */
.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-group label {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.filter-group {
    min-width: 160px;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background-color: #0a0a0a;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--color-border-primary);
    box-shadow: 0 6px 18px rgba(var(--color-primary-rgb), 0.06);
}

.filter-group select option {
    background-color: var(--color-dark);
    color: var(--color-text-secondary);
    padding: var(--space-sm);
    font-size: var(--font-size-base);
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Fix dropdown width in Webkit browsers */
.filter-group select::-webkit-scrollbar {
    width: 8px;
}

.filter-group select::-webkit-scrollbar-track {
    background: var(--color-dark);
}

.filter-group select::-webkit-scrollbar-thumb {
    background: var(--color-border-primary);
    border-radius: var(--radius-sm);
}

/* Ensure consistent option sizing */
.filter-group select option {
    min-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Featured Posts Section */
.featured-posts {
    padding: var(--space-2xl) 0;
    background: transparent;
}

.section-title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-xl);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-bold);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

/* All Posts Section */
.all-posts {
    padding: var(--space-2xl) 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Blog Card */
.blog-card {
    background: var(--color-dark-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(var(--color-primary-rgb), 0.15), 0 0 0 1px rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.3);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Image */
.card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    filter: brightness(0.9);
}

.blog-card:hover .card-image img {
    transform: scale(1.03);
    filter: brightness(1);
}

.featured-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--color-primary);
    color: var(--color-dark);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
}

/* Card Content */
.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.card-title {
    font-size: var(--font-size-xl);
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    line-height: var(--line-height-snug);
    font-weight: var(--font-weight-bold);
}

.card-excerpt {
    color: #9aa3b2;
    line-height: var(--line-height-relaxed);
    margin-bottom: 0.75rem;
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: 0;
}

.tag {
    background: rgba(var(--color-primary-rgb), 0.06);
    color: var(--color-primary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

/* Card Author */
.card-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.author-bio {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Featured Card Variations */
.featured-card .card-image {
    height: 280px;
}

.featured-card .card-title {
    font-size: 1.75rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.no-results svg {
    color: #62758a;
    margin-bottom: var(--space-lg);
    width: 48px;
    height: 48px;
}

.no-results h3 {
    font-size: var(--font-size-2xl);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    font-weight: var(--font-weight-semibold);
}

.no-results p {
    color: var(--color-text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* Newsletter Section */
.newsletter-section {
    padding-bottom: var(--space-4xl);
    padding-right: var(--space-4xl);
    padding-left: var(--space-4xl);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.newsletter-box {
    text-align: center;
    color: white;
}

.newsletter-box h2 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-sm);
    text-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.6),
                 0 0 60px rgba(var(--color-primary-rgb), 0.4);
}

.newsletter-box p {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-xl);
    opacity: 0.95;
    text-shadow: 0 0 10px var(--color-cyan, 0.6),
                 0 0 60px var(--color-cyan, 0.4);
}

.newsletter-form {
    display: flex;
    gap: var(--space-md);
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem var(--space-md);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--color-border-primary);
    box-shadow: 0 6px 18px rgba(var(--color-primary-rgb), 0.06);
}

.newsletter-form input::placeholder {
    color: var(--color-text-muted);
}

.newsletter-form button {
    padding: 0.875rem var(--space-xl);
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.newsletter-form button:hover {
    background: rgba(var(--color-primary-rgb), 0.16);
    border-color: rgba(var(--color-primary-rgb), 0.24);
    transform: translateY(-1px);
}

/* ======================
   Blog Post Page Styles
   ====================== */

.blog-post-page {
    background: transparent;
}

.post-header {
    padding: 6rem 0 var(--space-xl);
    background: transparent;
    text-align: center;
    position: relative;
    z-index: 1;
}

.post-meta {
    display: flex;
    gap: var(--space-lg);
    color: var(--color-text-muted);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
    justify-content: center;
}

.post-title {
    font-size: 2.25rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    line-height: var(--line-height-tight);
    font-weight: var(--font-weight-extrabold);
    text-align: center;
}

.post-description {
    font-size: var(--font-size-lg);
    color: #9aa3b2;
    line-height: var(--line-height-loose);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.post-author-section {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    justify-content: center;
}

.author-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name-large {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.author-bio-large {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.post-tags-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.post-featured-image {
    width: 100%;
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.post-featured-image .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.post-featured-image img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-xl);
    box-shadow: 0 15px 40px rgba(2, 6, 23, 0.7);
}

.post-content {
    padding: var(--space-xl) 0 var(--space-2xl);
}

.content-wrapper {
    max-width: 820px;
    margin: 0 auto;
}

/* Markdown Content Styles */
.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4 {
    color: var(--color-text-secondary);
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-snug);
}

.content-wrapper h1 { font-size: 2.25rem; }
.content-wrapper h2 { font-size: 1.75rem; }
.content-wrapper h3 { font-size: 1.25rem; }
.content-wrapper h4 { font-size: 1.05rem; }

.content-wrapper p {
    color: #d6dee8;
    line-height: var(--line-height-loose);
    margin-bottom: 1.25rem;
    font-size: var(--font-size-lg);
}

.content-wrapper ul,
.content-wrapper ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
    color: #d6dee8;
    line-height: var(--line-height-loose);
}

.content-wrapper li {
    margin-bottom: var(--space-sm);
}

.content-wrapper a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.12);
    transition: opacity var(--transition-base);
}

.content-wrapper a:hover {
    opacity: 0.85;
}

.content-wrapper strong {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
}

.content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 1.8rem 0;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.6);
}

.content-wrapper blockquote {
    border-left: 4px solid rgba(var(--color-primary-rgb), 0.12);
    margin: 1.8rem 0;
    color: #bcd0dc;
    font-style: italic;
    background: rgba(var(--color-primary-rgb), 0.02);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
}

.content-wrapper code {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.2rem var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.95em;
    color: #ffdede;
}

.content-wrapper pre {
    background: #071027;
    color: var(--color-text-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: var(--space-lg) 0;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.content-wrapper pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.content-wrapper hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 2.25rem 0;
}

/* Post Footer */
.post-footer {
    padding: var(--space-xl) 0 var(--space-2xl);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: var(--space-2xl);
}

.engagement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    align-items: stretch;
}

.share-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-primary);
    background: radial-gradient(circle at top right, rgba(0, 255, 163, 0.15), transparent 55%),
                linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 0, 0, 0.65));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.share-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.share-header {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.share-header h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.share-header p {
    color: var(--color-text-tertiary);
    margin: 0;
}

.share-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.12);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: var(--space-md);
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6rem var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text-secondary);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-semibold);
    min-width: 120px;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    cursor: pointer;
}

.share-btn svg,
.share-btn i { 
    width: 18px; 
    height: 18px; 
    flex-shrink: 0; 
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-btn.twitter {
    color: #1da1f2;
    border-color: rgba(29, 161, 242, 0.12);
    background: transparent;
}

.share-btn.twitter:hover { 
    background: #1da1f2; 
    color: #fff; 
}

.share-btn.linkedin {
    color: #0077b5;
    border-color: rgba(0, 119, 181, 0.12);
    background: transparent;
}

.share-btn.linkedin:hover { 
    background: #0077b5; 
    color: #fff; 
}

.share-btn.facebook {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.15);
}

.share-btn.facebook:hover {
    background: #1877f2;
    color: #fff;
}

.share-btn.whatsapp {
    color: #25d366;
    border-color: rgba(37, 211, 102, 0.15);
}

.share-btn.whatsapp:hover {
    background: #25d366;
    color: #071b12;
}

.share-btn.reddit {
    color: #ff4500;
    border-color: rgba(255, 69, 0, 0.18);
}

.share-btn.reddit:hover {
    background: #ff4500;
    color: #fff;
}

.share-btn.telegram {
    color: #229ed9;
    border-color: rgba(34, 158, 217, 0.15);
}

.share-btn.telegram:hover {
    background: #229ed9;
    color: #fff;
}

.share-btn.email {
    color: var(--color-text-secondary);
    border-color: rgba(255, 255, 255, 0.12);
}

.share-btn.email:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-dark);
}

.share-btn.copy {
    color: var(--color-text-muted);
    border-color: var(--color-border-light);
}

.share-btn.copy:hover { 
    background: rgba(255, 255, 255, 0.04); 
    color: var(--color-text-secondary); 
}

/* Related Posts */
.related-posts {
    padding: var(--space-2xl) 0;
    background: transparent;
}

.related-posts h2 {
    font-size: var(--font-size-4xl);
    margin-bottom: 1.25rem;
    color: var(--color-text-secondary);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.related-posts-grid .blog-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--color-dark-card);
}

/* Post CTA */
.cta-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-primary);
    background: linear-gradient(135deg, rgba(0, 255, 163, 0.2), rgba(0, 0, 0, 0.8));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.cta-card::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(0, 255, 163, 0.25), transparent 65%);
    top: -120px;
    right: -80px;
    filter: blur(20px);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.cta-content h3 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.cta-content p {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-lg);
    color: var(--color-text-tertiary);
    max-width: 760px;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.cta-actions .btn-primary,
.cta-actions .btn-secondary {
    min-width: 200px;
    text-align: center;
}

/* ======================
   Responsive Design
   ====================== */

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: var(--font-size-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    .search-box {
        width: 100%;
        min-width: auto;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .featured-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-section {
        padding: var(--space-xl) var(--space-md);
    }
    
    .newsletter-box h2 {
        font-size: var(--font-size-2xl);
    }
    
    .newsletter-box p {
        font-size: var(--font-size-base);
    }
    
    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
        padding: 0 var(--space-sm);
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        font-size: var(--font-size-sm);
        padding: 0.75rem var(--space-sm);
    }
    
    .post-title {
        font-size: var(--font-size-4xl);
    }
    
    .post-description {
        font-size: var(--font-size-base);
    }
    
    .content-wrapper {
        padding: 0 var(--space-lg);
    }
    
    .content-wrapper h1 { font-size: 1.75rem; }
    .content-wrapper h2 { font-size: 1.5rem; }
    .content-wrapper h3 { font-size: 1.25rem; }
    
    .share-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .share-btn {
        width: auto;
        min-width: auto;
        padding: 0.75rem;
        justify-content: center;
    }
    
    .share-btn svg,
    .share-btn i {
        width: 20px;
        height: 20px;
    }
    
    /* Hide text labels on mobile, show only icons */
    .share-btn .share-label {
        display: none;
    }

    .engagement-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .cta-card,
    .share-card {
        padding: var(--space-lg);
    }

    .cta-content h3 {
        font-size: var(--font-size-2xl);
    }

    .cta-content p {
        font-size: var(--font-size-base);
    }

    .cta-actions {
        flex-direction: column;
    }

    .cta-actions .btn-primary,
    .cta-actions .btn-secondary {
        width: 100%;
        min-width: 0;
    }
    
    #contact {
        overflow-x: hidden;
    }
    
    #contact .container {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
    
    #contact .grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    #contact .max-w-6xl {
        max-width: 100%;
        padding: 0;
    }
    
    #contact form,
    #contact input,
    #contact textarea,
    #contact button {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .bg-dark-card {
        max-width: 100%;
    }
    
    .mapouter,
    .gmap_canvas,
    .gmap_iframe {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: var(--font-size-3xl);
    }
}

/* ======================
   Toast Notification
   ====================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--color-dark-card);
    border: 1px solid var(--color-primary);
    color: var(--color-text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 255, 163, 0.2);
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
    transition: all var(--transition-normal);
    z-index: 9999;
    max-width: 90vw;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.toast span {
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
}

@media (max-width: 640px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.875rem 1.25rem;
    }
}
