:root {
    --primary-color: #000000;
    --secondary-color: #8ecae6;
    --accent-color: #ffb703;
    --background-color: #ffffff;
    --text-color: #333333;
    --nav-bg: #f8f9fa;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --blog-card-bg: #ffffff;
    --blog-meta-color: #666666;
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --primary-color: #8ecae6;
    --secondary-color: #3a86ff;
    --accent-color: #ffb703;
    --background-color: #1a1a1a;
    --text-color: #f2f2f2;
    --nav-bg: #2d2d2d;
    --card-bg: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --blog-card-bg: #2d2d2d;
    --blog-meta-color: #aaaaaa;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: var(--nav-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    left: 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 2rem;
    transition: color var(--transition-speed), border-bottom var(--transition-speed);
    font-weight: 500;
    padding-bottom: 5px;
    position: relative;
}

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

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

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

.theme-toggle button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
}

.theme-toggle button:hover {
    background-color: var(--shadow-color);
}

main {
    margin-top: 80px;
    padding: 2rem 5%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 200px); /* Adjusted to account for header and footer */
}

.hero {
    text-align: center;
    padding: 2rem 0; /* Reduced padding */
    min-height: calc(100vh - 360px); /* Changed from fixed height to min-height and reduced */
    max-height: 70vh; /* Added max-height to prevent overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    animation: fadeInDown 1s ease-out;
}

.subtitle {
    font-size: 1.4rem;
    color: var(--blog-meta-color);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content sections */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
    padding: 2rem 0;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Cards */
.blog-card, .project-card {
    background-color: var(--blog-card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid rgba(0,0,0,0.05);
}

.blog-card:hover, .project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.blog-card h3, .project-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.blog-meta, .project-meta {
    font-size: 0.9rem;
    color: var(--blog-meta-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.blog-meta span, .project-meta span {
    margin-right: 1rem;
}

.date:before {
    margin-right: 0.3rem;
}

.blog-preview, .project-preview {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
    transition: color var(--transition-speed);
}

.read-more:hover {
    color: var(--accent-color);
}

.read-more:after {
    content: ' →';
    transition: margin-left var(--transition-speed);
    display: inline-block;
}

.read-more:hover:after {
    margin-left: 5px;
}

.about-content {
    background-color: var(--blog-card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px var(--shadow-color);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    max-height: calc(100vh - 300px); /* Added max-height to prevent overflow */
    overflow-y: auto; /* Add scroll if content is too long */
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--nav-bg);
    color: var(--blog-meta-color);
    font-size: 0.9rem;
}

/* Social media links styling */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px var(--shadow-color);
    color: var(--primary-color);
}

.social-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-speed);
}

.social-links a:hover .social-icon {
    transform: scale(1.1);
}

/* GitHub link styling */
.social-links a:nth-child(1):hover {
    background-color: #333;
    color: white;
}

/* LinkedIn link styling */
.social-links a:nth-child(2):hover {
    background-color: #0077b5;
    color: white;
}

/* Twitter link styling */
.social-links a:nth-child(3):hover {
    background-color: #1da1f2;
    color: white;
}

/* Dark theme adjustments for social links */
[data-theme="dark"] .social-links a {
    background-color: var(--nav-bg);
    border: 1px solid var(--shadow-color);
}

/* Responsive adjustments for social links */
@media (max-width: 768px) {
    .social-links {
        gap: 1rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
    }
    
    .social-icon {
        width: 18px;
        height: 18px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .nav-links a {
        margin-left: 1rem;
        font-size: 0.9rem;
    }
    
    .hero {
        min-height: calc(100vh - 500px); /* Further reduced for mobile */
        max-height: 60vh; /* Reduced max-height for mobile */
        padding: 1rem 0; /* Reduced padding for mobile */
    }
    
    main {
        padding: 1rem 5%; /* Reduced padding for mobile */
        margin-top: 120px; /* Increased margin-top to account for taller mobile nav */
    }
}

/* Error and loading indicators */
.error {
    color: #e63946;
    background-color: rgba(230, 57, 70, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #e63946;
    margin-bottom: 1rem;
}

.error button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    margin-left: 1rem;
    cursor: pointer;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--blog-meta-color);
}

.error-card {
    border-left: 4px solid #e63946 !important;
}

.info {
    color: var(--primary-color);
    background-color: rgba(58, 134, 255, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
}

/* Diagnostic information */
.diagnostic-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: var(--blog-card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    max-width: 400px;
    box-shadow: 0 2px 10px var(--shadow-color);
    font-size: 0.8rem;
    z-index: 2000;
}

.diagnostic-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.diagnostic-info p {
    margin-bottom: 0.3rem;
    word-break: break-all;
}

.diagnostic-info button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    cursor: pointer;
}

/* Full post view */
.post-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--shadow-color);
    padding-bottom: 1.5rem;
}

.post-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0.8rem 0;
}

.post-meta {
    font-size: 0.95rem;
    color: var(--blog-meta-color);
    display: flex;
    align-items: center;
}

.post-meta span {
    margin-right: 1.5rem;
}

.post-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-content h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
}

.post-content h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.post-content h3 {
    font-size: 1.3rem;
    margin: 1.2rem 0 0.8rem;
}

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

.post-content img {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.post-content code {
    background-color: var(--shadow-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
}

.post-content pre {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--shadow-color);
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--blog-meta-color);
    font-style: italic;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.back-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background-color var(--transition-speed);
    margin-bottom: 1rem;
}

.back-button:hover {
    background-color: var(--secondary-color);
}

/* Additional responsive styles */
@media (max-width: 576px) {
    .post-header h1 {
        font-size: 1.8rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-meta span {
        margin-bottom: 0.3rem;
    }
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    font-size: 1.2rem;
    color: var(--primary-color);
    position: relative;
}

.loading:after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid var(--shadow-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    position: absolute;
    left: calc(50% - 15px);
    top: calc(50% - 15px);
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Card animations */
.blog-card, .project-card {
    animation: card-appear 0.5s ease-out;
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tags styling */
.tags:before {
    content: '🏷️ ';
}

.tags {
    display: inline-flex;
    flex-wrap: wrap;
}

/* Improved mobile navigation */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem;
    }
    
    .logo {
        margin-bottom: 0.5rem;
    }
    
    .nav-links {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 0.5rem;
    }
    
    .nav-links a {
        margin: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        margin-top: 0.5rem;
    }
}

/* Polished card styles */
.blog-card, .project-card {
    position: relative;
    overflow: hidden;
}

.blog-card:before, .project-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background-color: var(--accent-color);
    transition: height 0.3s ease;
}

.blog-card:hover:before, .project-card:hover:before {
    height: 100%;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--blog-meta-color);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
} 