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

:root {
    --primary-color: #2D3748;
    --secondary-color: #4FD1C7;
    --accent-color: #805AD5;
    --text-dark: #1A202C;
    --text-light: #718096;
    --bg-light: #F7FAFC;
    --bg-white: #FFFFFF;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --border-color: #E2E8F0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --success-color: #48BB78;
    --error-color: #F56565;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

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

/* Header & Navigation */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Account button in navigation should look like other nav links */
.nav-links .account-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: inherit !important;
    font-weight: 500 !important;
    color: var(--text-dark) !important;
    text-decoration: none !important;
    transition: color 0.3s !important;
    display: inline !important;
    gap: 0 !important;
    min-height: auto !important;
    min-width: auto !important;
}

.nav-links .account-btn:hover {
    color: var(--accent-color) !important;
    background: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.mobile-menu span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 60px 0;
    background: var(--bg-white);
    color: var(--text-dark);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas background for wavy effect */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Safari-specific blur filter fallback */
.safari .hero-canvas {
    filter: blur(10px);
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.2s backwards;
}

/* Blog List View */
.blog-list-view {
    padding: 40px 0 80px;
    background: var(--bg-light);
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.blog-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
}

.blog-card-content.no-image {
    flex-direction: column;
    gap: 1rem;
}

.blog-card-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.blog-card-image-content {
    width: 280px;
    flex-shrink: 0;
}

.blog-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    min-height: 180px;
    max-height: 220px;
}

.blog-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.blog-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

.blog-author-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.blog-author-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    display: block;
}

.blog-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
    text-align: left;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    text-align: left;
    margin: 0;
}

.blog-card-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-read-time {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.blog-meta-separator {
    color: var(--text-light);
    font-weight: 300;
}

.blog-card-date {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.blog-card-separator {
    height: 1px;
    background: var(--border-color);
    margin: 0 1.5rem;
}

.blog-card-share {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
}

.blog-share-icons {
    display: flex;
    gap: 1rem;
}

.blog-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-light);
    transition: all 0.3s;
    text-decoration: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.blog-share-icon:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.blog-share-icon svg {
    width: 18px;
    height: 18px;
}

.copy-success-message {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
    animation: copyMessageFade 2s ease-in-out;
}

@keyframes copyMessageFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Blog Single View */
.blog-single-view {
    padding: 0;
    background: var(--bg-white);
}

.blog-single-view .container {
    max-width: 900px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.back-button:hover {
    background: var(--accent-color);
    color: white;
    transform: translateX(-4px);
}

.post-header {
    padding: 2rem 0 0;
    margin-bottom: 0;
    position: static;
}

/* Date and read time at top */
.post-date-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.post-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
    text-align: center;
}

/* Post excerpt styling */
.post-excerpt {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-light);
    margin: 0 0 2rem 0;
    font-style: italic;
    text-align: center;
}

/* Author section between header and content */
.post-author-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.post-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.post-meta-separator {
    color: var(--text-light);
}

.post-date,
.post-read-time {
    color: var(--text-light);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    padding: 0;
    margin-top: 0;
}

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

.post-content strong {
    font-weight: 700;
}

.post-content em {
    font-style: italic;
}

.post-content .underline {
    text-decoration: underline;
}

.post-content .quote,
.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
}

.post-content img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

.post-content li {
    margin-bottom: 0.8rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.8rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.3rem;
}

/* Blog Newsletter Section */
.blog-newsletter {
    margin: 3rem 0 2rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: 12px;
    text-align: center;
}

.blog-newsletter-content h3 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.blog-newsletter-content p {
    font-size: 1rem;
    color: white;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.blog-newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.blog-newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
}

.blog-newsletter-form button {
    padding: 12px 30px;
    background: var(--bg-white);
    color: var(--accent-color);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    min-width: 120px;
}

.blog-newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.post-footer {
    padding: 2rem 0 3rem;
    margin-top: 3rem;
}

.post-separator {
    height: 1px;
    background: var(--border-color);
    margin-bottom: 1.5rem;
}

.post-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.post-share-icons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

/* Loading and Messages */
.loading-message,
.no-posts-message,
.post-not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.loading-message p,
.no-posts-message p {
    font-size: 1.2rem;
    color: var(--text-light);
}

.post-not-found {
    background: var(--bg-light);
    border-radius: 12px;
    margin: 4rem auto;
    max-width: 600px;
}

.post-not-found h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.post-not-found p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    border: none;
}

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

/* Footer */
footer {
    padding: 40px 0;
    background: var(--text-dark);
    color: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #CBD5E0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-links-columns {
    display: flex;
    gap: 2rem;
}

.footer-links-column {
    flex: 1;
    list-style: none;
}

.footer-links-column:first-child {
    padding-right: 2rem;
    border-right: 1px solid #4A5568;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4A5568;
    color: #CBD5E0;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        gap: 1rem;
        z-index: 999;
        text-align: center;
    }

    .nav-links.mobile-active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 1rem;
    }

    .mobile-menu {
        display: flex;
    }

    .mobile-menu.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

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

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

    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-excerpt {
        font-size: 1rem;
    }

    .post-date-meta {
        font-size: 0.85rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .container {
        padding: 0 15px;
    }

    .footer-content {
        gap: 2rem;
        text-align: center;
    }

    .logo-img {
        height: 35px;
    }

    .logo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .blog-card-title {
        font-size: 1.3rem;
    }

    .blog-card-content {
        padding: 1rem;
        flex-direction: column-reverse;
    }

    .blog-card-content.no-image {
        flex-direction: column;
    }

    .blog-card-image-content {
        width: 100%;
    }

    .blog-main-image {
        max-height: 200px;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .post-excerpt {
        font-size: 0.95rem;
    }

    .post-date-meta {
        font-size: 0.8rem;
    }

    .blog-newsletter {
        padding: 2rem 1.5rem;
    }

    .blog-newsletter-content h3 {
        font-size: 1.5rem;
    }

    .blog-newsletter-content p {
        font-size: 0.95rem;
    }

    .blog-newsletter-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .blog-newsletter-form input,
    .blog-newsletter-form button {
        width: 100%;
    }

    .back-button-container {
        padding: 1rem 0 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .blog-card,
    .post-hero-image {
        border: 2px solid var(--text-dark);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .back-button,
    .btn,
    .loading-spinner {
        transition: none;
        animation: none;
    }

    .loading-spinner {
        border: 4px solid var(--accent-color);
        border-radius: 0;
    }
}
