/* vCROCS Blog - Professional Theme */
/* Inspired by vcrocs.info */

:root {
    --vcrocs-blue: #0066cc;
    --vcrocs-dark: #1a1a2e;
    --vcrocs-darker: #141414;
    --sidebar-bg: #2d2d2d;
    --vcrocs-light: #f5f7fa;
    --vcrocs-accent: #00a8ff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --max-width: 1100px;
    --sidebar-width: 280px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--vcrocs-light);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.mobile-nav-toggle:hover {
    background: rgba(255,255,255,0.14);
    transform: translateY(-1px);
}

.mobile-nav-toggle .hamburger-lines {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-toggle .hamburger-lines span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.sidebar-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.sidebar-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.sidebar-social a {
    color: rgba(255,255,255,0.6);
    font-size: 1.5rem;
    transition: color 0.3s;
    text-decoration: none;
}

.sidebar-social a:hover {
    color: white;
}

.sidebar-nav {
    flex: 1;
    margin-top: 1rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 1.05rem;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav .icon {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: var(--max-width);
    width: 100%;
    padding: 3rem 2rem;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
}

.content-area {
    min-width: 0;
}

/* Right Sidebar */
.right-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.widget {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.widget h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget h3::before {
    font-size: 1.5rem;
}

/* Search Widget */
.search-widget {
    position: relative;
}

.search-widget input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-widget input:focus {
    outline: none;
    border-color: var(--vcrocs-blue);
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--vcrocs-blue);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-suggestion-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background: var(--vcrocs-light);
}

.search-suggestion-item strong {
    display: block;
    color: var(--vcrocs-blue);
    margin-bottom: 0.25rem;
}

.search-suggestion-item .excerpt {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

.search-suggestion-item mark {
    background: #00a8ff;
    color: white;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Archives Widget */
.archives-list {
    list-style: none;
}

.archives-list li {
    margin-bottom: 0.5rem;
}

.archives-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.archives-list a:hover {
    background: var(--vcrocs-light);
    color: var(--vcrocs-blue);
}

.archives-list .count {
    background: var(--vcrocs-light);
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Categories Widget */
.categories-widget .category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.categories-widget .category-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--vcrocs-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.categories-widget .category-item:hover {
    background: var(--vcrocs-blue);
    color: white;
}

/* Tags Widget */
.tags-widget .tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-widget .tag-item {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--vcrocs-light);
    color: var(--vcrocs-blue);
    text-decoration: none;
    border-radius: 16px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.tags-widget .tag-item:hover {
    background: var(--vcrocs-blue);
    color: white;
    border-color: var(--vcrocs-blue);
}

/* Main Content */
main {
    background: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

/* Post Cards */
.post-item {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    border-left: 6px solid var(--sidebar-bg);  /* Match sidebar color */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: var(--sidebar-bg);  /* Match sidebar color on hover */
}

.post-item h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.post-item h2 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.post-item h2 a:hover {
    color: var(--vcrocs-blue);
}

.post-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.post-meta::before {
    content: "📅";
    margin-right: 0.25rem;
}

.post-excerpt {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: var(--vcrocs-light);
    color: var(--vcrocs-blue);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--vcrocs-blue);
    color: white;
    border-color: var(--vcrocs-blue);
    transform: translateY(-1px);
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.category {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: #fff3cd;
    color: #856404;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #ffeeba;
    transition: all 0.2s;
}

.category:hover {
    background: #ffc107;
    color: white;
    border-color: #ffc107;
    transform: translateY(-1px);
}

/* Single Post Page */
article {
    background: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

article header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
}

article h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.2;
}

article h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--text-dark);
    border-left: 4px solid var(--vcrocs-blue);
    padding-left: 1rem;
}

article h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-dark);
}

article h4 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-dark);
}

article p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

article a {
    color: var(--vcrocs-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

article a:hover {
    border-bottom-color: var(--vcrocs-blue);
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Code Blocks */
code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    background: var(--vcrocs-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e83e8c;
    border: 1px solid var(--border-color);
}

pre {
    background: var(--vcrocs-dark);
    color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

pre code {
    background: none;
    padding: 0;
    color: #f8f9fa;
    border: none;
}

/* Lists */
article ul, article ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

article li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

article ul li::marker {
    color: var(--vcrocs-blue);
}

/* Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1.75rem 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

article table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

article th,
article td {
    padding: 0.9rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

article th {
    background: var(--vcrocs-light);
    color: var(--text-dark);
    font-weight: 700;
}

article tbody tr:nth-child(even) {
    background: rgba(0, 113, 227, 0.04);
}

article tbody tr:last-child td {
    border-bottom: none;
}

/* Blockquotes */
blockquote {
    border-left: 5px solid #d4a017;
    background: #f0f0f0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
    font-style: normal;
    font-weight: bold;
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 1.05rem;
}

blockquote p {
    margin: 0;
}

blockquote p:not(:last-child) {
    margin-bottom: 0.75rem;
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2.5rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-top: auto;
}

footer a {
    color: var(--vcrocs-blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    margin-top: 1rem;
}

.pagination-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--vcrocs-blue);
    color: white !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.pagination-link:hover {
    background: #004a99;
    text-decoration: none;
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Back Link */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--vcrocs-blue);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--vcrocs-dark);
    transform: translateX(-4px);
}

/* Archive Page */
.archive-year {
    margin-bottom: 3rem;
}

.archive-year h2 {
    font-size: 2rem;
    color: var(--vcrocs-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.25rem 1rem 1rem;
        overflow: visible;
    }
    
    .sidebar-avatar {
        width: 80px;
        height: 80px;
    }
    
    .sidebar-title {
        font-size: 1.25rem;
    }

    .sidebar-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }
    
    .sidebar-nav {
        flex: none;
        margin-top: 1rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.25s ease, opacity 0.2s ease;
    }

    .sidebar.mobile-nav-open .sidebar-nav {
        max-height: 60vh;
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
    }

    .sidebar.mobile-nav-open .mobile-nav-toggle .hamburger-lines span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .sidebar.mobile-nav-open .mobile-nav-toggle .hamburger-lines span:nth-child(2) {
        opacity: 0;
    }

    .sidebar.mobile-nav-open .mobile-nav-toggle .hamburger-lines span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .sidebar-nav ul {
        padding-top: 0.35rem;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .container {
        padding: 1.5rem 1rem;
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .right-sidebar {
        position: relative;
        top: 0;
    }

    .tags-widget {
        display: none;
    }
    
    main, article {
        padding: 1.5rem 1rem;
    }
    
    .post-item {
        padding: 1.5rem;
    }

    .back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 58px;
        height: 64px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: var(--vcrocs-blue);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease;
    z-index: 1500;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--vcrocs-dark);
}

/* Lightbox Styles */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    background: white;
    transform: rotate(90deg) scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Make content images clickable */
article .content img {
    cursor: zoom-in;
    transition: all 0.3s ease;
}

article .content img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-caption {
        font-size: 14px;
        padding: 8px 16px;
        max-width: 90%;
    }
}

/* YouTube Embed */
.youtube-container {
    text-align: center;
    max-width: 800px;
    margin: 1.5rem auto;
}
.youtube-thumbnail-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    text-decoration: none;
}
.youtube-thumbnail-link img {
    width: 100%;
    display: block;
}
.youtube-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.youtube-thumbnail-link:hover .youtube-play-btn {
    background: rgb(255, 0, 0);
    transform: translate(-50%, -50%) scale(1.1);
}
.youtube-play-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
    margin-left: 5px;
}
.youtube-label {
    margin-top: 14px;
    font-size: 13px;
}
.youtube-label a {
    color: #ff4e45;
    text-decoration: none;
}
.youtube-label a:hover {
    text-decoration: underline;
}