:root {
    --bg-color: #050505;
    --card-bg: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: #222222;
    --badge-bg: #111111;
    --accent-blue: #0070f3;
    --radius: 0.5rem;
    --grid-color: #1a1a1a;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Light Theme */
[data-theme="light"] {
    --bg-color: #2b5c96; /* Blueprint Blue Background */
    --card-bg: #ffffff;
    --text-main: #000000;
    --text-muted: #555555;
    --border-color: #bbdefb; /* Blue-ish border */
    --badge-bg: #bbdefb; /* Slightly darker blue for badges */
    --grid-color: #bbdefb;
    --accent-blue: #1976d2;
}
/* ... (lines 27-1727 skipped) ... */

/* ===== Wide Layout System ===== */
body.wide-layout .main-container {
    max-width: 1000px; /* Reduced to ensure space for 380px wide ads */
}

/* Light theme specific styles for buttons and dates */
[data-theme="light"] .social-btn {
    background-color: #1976d2;
    color: #ffffff;
    border-color: #1565c0;
}

[data-theme="light"] .social-btn:hover {
    background-color: #1565c0;
    border-color: #0d47a1;
}

[data-theme="light"] .job-date {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1976d2;
    font-weight: 600;
}

[data-theme="light"] .nav-item {
    color: #555555;
}

[data-theme="light"] .nav-item:hover {
    color: #1976d2;
    background-color: #e3f2fd;
}

[data-theme="light"] .nav-item.active {
    background-color: #1976d2;
    color: #ffffff;
}

[data-theme="light"] .bottom-nav {
    background-color: #ffffff;
    border-color: #e0e0e0;
}

/* Force ALL text to be black in light theme */
[data-theme="light"] .bio {
    color: #000000;
}

[data-theme="light"] .bio p {
    color: #000000;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    /* Subtle grid pattern */
    background-image: radial-gradient(var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 40px 20px 120px 20px;
    position: relative;
    overflow-x: hidden;
    margin: 0;
}

[data-theme="light"] .bio i {
    color: #000000;
}

[data-theme="light"] .bio strong {
    color: #000000;
}

[data-theme="light"] .user-details h1 {
    color: #000000;
}

[data-theme="light"] .user-details p {
    color: #000000;
}

[data-theme="light"] .job-details h3 {
    color: #000000;
}

[data-theme="light"] .job-details span {
    color: #666666;
}

[data-theme="light"] .section-title {
    color: #000000;
}

[data-theme="light"] .divider {
    border-top-color: #d0d0d0;
}

/* Light theme styles for project and tool items */
/* Light theme styles for project and tool items */
[data-theme="light"] .other-project-item {
    background-color: rgba(0, 0, 0, 0.08); /* Darkened from 0.03 for contrast */
}

[data-theme="light"] .other-project-item:hover {
    background-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .tool-item {
    background-color: rgba(0, 0, 0, 0.08); /* Darkened from 0.03 for contrast */
}

[data-theme="light"] .tool-item:hover {
    background-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .projects-divider {
    border-top-color: #d0d0d0;
}

[data-theme="light"] .project-image {
    border: 1px solid #d0d0d0;
}

[data-theme="light"] .project-image-placeholder,
[data-theme="light"] .project-image-real {
    border: 1px solid #d0d0d0;
}

/* Specific overrides for Content Channels in Light Mode */
[data-theme="light"] .type-card {
    background-color: #f8f9fa !important;
    border-color: #d1d9e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03) !important;
    padding: 12px 16px !important;
}

[data-theme="light"] .type-card i {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    border-color: #bbdefb !important;
    font-size: 0.9rem;
}

[data-theme="light"] .type-card .project-title {
    color: #111111 !important;
}

[data-theme="light"] .type-card::before {
    color: #1976d2 !important;
    opacity: 0.6;
}

[data-theme="light"] .type-card:hover {
    border-color: #1976d2 !important;
    background-color: #ffffff !important;
}



/* Smooth transitions for theme changes */
body,
.card,
.nav-item,
.social-btn,
.job-date,
.bottom-nav {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


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



/* Main Container for SPA */
.main-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    z-index: 5; /* Above background balloons */
}

/* SPA Page System */
.page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px 120px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.page.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* Animação de fade */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.page.active {
    animation: fadeIn 0.5s ease-in-out;
}

/* Container para agrupar os cards verticalmente */
/* Container para agrupar os cards verticalmente */
/* Removed duplicate .main-container rule to avoid conflicts. 
   Styles are already defined at line 177 with proper centering. */

/* Estilo Genérico do Card */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.2rem;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color); /* Neutral border by default */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Cabeçalho (Avatar + Nome) */
/* Cabeçalho (Avatar + Nome) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.user-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.avatar-container {
    position: relative;
    width: 64px;
    height: 64px;
    perspective: 1000px;
    cursor: pointer;
}

.avatar-flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.avatar-flipper.flip {
    transform: rotateY(180deg);
}

.avatar-front,
.avatar-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.avatar-front {
    background-image: url('../assets/images/me.png');
}

.avatar-back {
    background-image: url('../assets/images/icon.jpg');
    transform: rotateY(180deg);
}

.user-details h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}

.user-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.brand-logo {
    font-size: 1.8rem;
    color: white;
    opacity: 0.9;
}

[data-theme="light"] .brand-logo {
    color: #000000;
    opacity: 1;
}

/* Texto de Bio */
.bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #d0d0d0;
    margin-bottom: 24px;
}

.bio i {
    font-style: italic;
    font-family: "Times New Roman", serif;
    font-size: 1.05rem;
    color: #fff;
}

/* Botões Sociais */
.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.social-btn {
    background-color: #1b1b1b;
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background-color: #222;
    border-color: #555;
    color: #fff;
    transform: translateY(-1px);
}

.social-btn i {
    font-size: 1rem;
}

/* Divisor Pontilhado */
.divider {
    border: none;
    border-top: 1px dashed #333;
    margin-bottom: 32px;
    width: 100%;
}

/* Lista de Experiência */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.job-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    border-radius: 8px;
    padding: 10px 12px; /* Consistent padding for all items */
}

.job-item.highlighted-job {
    background-color: rgba(251, 255, 0, 0.15); /* More contrast */
    border: 2px solid #ff9100; /* Vibrant orange border */
    margin-bottom: 8px;
}

.job-item.highlighted-job:hover {
    background-color: rgba(251, 255, 0, 0.12);
    transform: translateY(-2px);
}

.job-left {
    display: flex;
    align-items: center;
    gap: 16px;
}


.job-details span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Quadrados Coloridos (Logos) */
.company-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: calc(var(--radius) - 4px);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.logo-yellowhood {
    background-image: url('../assets/images/companylogo.png');
}

/* Cores específicas para simular os logos */
.bg-blue {
    background-color: #0070f3;
}

.bg-green {
    background-color: #00a650;
}

.bg-lime {
    background-color: #66bb00;
}

.bg-red {
    background-color: #da2619;
}

.bg-orange {
    background-color: #ff5500;
}

.bg-darkblue {
    background-color: #304ffe;
}

/* Novas cores para Education */
.bg-bright-blue {
    background-color: #0066ff;
}

.bg-grey {
    background-color: #333333;
}

.bg-yellow-orange {
    background-color: #ff9900;
}

.bg-red-orange {
    background-color: #ff4400;
}

.job-details h3 {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #fff;
}

/* Título da seção Education */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 24px;
    color: var(--text-main);
    opacity: 1;
}

.job-date {
    background-color: #111;
    border: 1px solid #2a2a2a;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    min-width: auto;
    text-align: center;
}


/* Responsividade */
@media (max-width: 500px) {
    .profile-card {
        padding: 24px 20px;
    }

    .job-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .job-date {
        align-self: flex-start;
        margin-left: 64px;
        /* Alinhar com o texto da experiência */
    }

    .social-links {
        gap: 8px;
    }

    .social-btn {
        flex: 1 0 auto;
        /* Botões expandem no mobile */
        justify-content: center;
    }
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #0f0f0f;
    border: 1px solid #222;
    border-radius: 1rem;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    z-index: 1000; /* Always top */
    transition: all 0.4s ease-in-out;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.4s ease-in-out;
}

.nav-item {
    color: #888;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px;
    border-radius: 0.5rem;
    transition: all 0.4s ease-in-out;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Esconder os spans por padrão */
.nav-item span {
    display: inline;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.4s ease-in-out, max-width 0.4s ease-in-out;
}

/* Mostrar o span quando o item estiver ativo */
.nav-item.active span {
    opacity: 1;
    max-width: 100px;
}

.nav-item:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    background-color: #222;
    color: #fff;
    padding: 8px 16px;
    gap: 8px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-item.active i {
    font-size: 1rem;
}

.nav-item i {
    font-size: 1.1rem;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background-color: #333;
}

.icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* Responsividade para a navbar */
@media (max-width: 500px) {
    .bottom-nav {
        bottom: 16px;
        width: 90%;
        justify-content: space-between;
        padding: 8px 16px;
    }
    
    .nav-item {
        padding: 8px;
    }
    
    .nav-item.active {
        padding: 8px 16px;
    }
}

/* ===== SPA System Styles ===== */

/* App container transitions */
#app {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Projects Page Styles - Card Layout */
.projects-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.project-card {
    background-color: transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-card:hover .project-image-placeholder {
    transform: scale(1.05);
}

.project-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 12px;
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.project-image-placeholder i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Real project images - Fixed scaling */
.project-image-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.project-card:hover .project-image-real {
    transform: scale(1.05);
}

/* Type Cards - Technical Blueprint Style (Slim) */
.type-card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important; /* Slimmer */
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px; /* Tighter */
    height: auto !important;
}

/* Theme variations for Type Cards */
.type-card.bg-purple-gradient { border-color: rgba(168, 85, 247, 0.2) !important; }
.type-card.bg-purple-gradient i { 
    background: rgba(168, 85, 247, 0.1) !important; 
    color: #a855f7 !important; 
    border-color: rgba(168, 85, 247, 0.2) !important; 
}
.type-card.bg-purple-gradient:hover { 
    border-color: #a855f7 !important; 
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3) !important;
}

.type-card.bg-pink-gradient { border-color: rgba(255, 45, 85, 0.2) !important; }
.type-card.bg-pink-gradient i { 
    background: rgba(255, 45, 85, 0.1) !important; 
    color: #ff2d55 !important; 
    border-color: rgba(255, 45, 85, 0.2) !important; 
}
.type-card.bg-pink-gradient:hover { 
    border-color: #ff2d55 !important; 
    box-shadow: 0 0 20px rgba(255, 45, 85, 0.3) !important;
}

.type-card.bg-green-gradient { border-color: rgba(34, 197, 94, 0.2) !important; }
.type-card.bg-green-gradient i { 
    background: rgba(34, 197, 94, 0.1) !important; 
    color: #22c55e !important; 
    border-color: rgba(34, 197, 94, 0.2) !important; 
}
.type-card.bg-green-gradient:hover { 
    border-color: #22c55e !important; 
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3) !important;
}

.type-card.bg-cyan-gradient { border-color: rgba(6, 182, 212, 0.2) !important; }
.type-card.bg-cyan-gradient i { 
    background: rgba(6, 182, 212, 0.1) !important; 
    color: #06b6d4 !important; 
    border-color: rgba(6, 182, 212, 0.2) !important; 
}
.type-card.bg-cyan-gradient:hover { 
    border-color: #06b6d4 !important; 
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3) !important;
}

.type-card.bg-orange-gradient { border-color: rgba(249, 115, 22, 0.2) !important; }
.type-card.bg-orange-gradient i { 
    background: rgba(249, 115, 22, 0.1) !important; 
    color: #f97316 !important; 
    border-color: rgba(249, 115, 22, 0.2) !important; 
}
.type-card.bg-orange-gradient:hover { 
    border-color: #f97316 !important; 
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3) !important;
}

.type-card.bg-blue-gradient { border-color: rgba(59, 130, 246, 0.2) !important; }
.type-card.bg-blue-gradient i { 
    background: rgba(59, 130, 246, 0.1) !important; 
    color: #3b82f6 !important; 
    border-color: rgba(59, 130, 246, 0.2) !important; 
}
.type-card.bg-blue-gradient:hover { 
    border-color: #3b82f6 !important; 
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3) !important;
}

/* Page Specific Accent Themes */
.reviews-card-theme .detail-title { color: #a855f7 !important; }
.reviews-card-theme .back-button:hover { color: #a855f7 !important; border-color: #a855f7 !important; }
.reviews-card-theme .reviews-section-title i { color: #a855f7 !important; }
.reviews-card-theme .shelf-category { color: #a855f7 !important; }

.leetcode-card-theme .detail-title { color: #ff2d55 !important; }
.leetcode-card-theme .back-button:hover { color: #ff2d55 !important; border-color: #ff2d55 !important; }
.leetcode-card-theme .streak-fire { color: #ff2d55 !important; }
.leetcode-card-theme .heatmap-day.active { background-color: #ff2d55 !important; box-shadow: 0 0 8px rgba(255, 45, 85, 0.5) !important; }

.orange-card-theme .detail-title { color: #f97316 !important; }
.orange-card-theme .back-button:hover { color: #f97316 !important; border-color: #f97316 !important; }

/* Light Mode Overrides for Themes */
[data-theme="light"] .type-card.bg-purple-gradient i { background: rgba(168, 85, 247, 0.1) !important; color: #a855f7 !important; border-color: rgba(168, 85, 247, 0.2) !important; }
[data-theme="light"] .type-card.bg-pink-gradient i { background: rgba(236, 72, 153, 0.1) !important; color: #ec4899 !important; border-color: rgba(236, 72, 153, 0.2) !important; }
[data-theme="light"] .type-card.bg-green-gradient i { background: rgba(34, 197, 94, 0.1) !important; color: #22c55e !important; border-color: rgba(34, 197, 94, 0.2) !important; }
[data-theme="light"] .type-card.bg-cyan-gradient i { background: rgba(6, 182, 212, 0.1) !important; color: #06b6d4 !important; border-color: rgba(6, 182, 212, 0.2) !important; }
[data-theme="light"] .type-card.bg-orange-gradient i { background: rgba(249, 115, 22, 0.1) !important; color: #f97316 !important; border-color: rgba(249, 115, 22, 0.2) !important; }
[data-theme="light"] .type-card.bg-blue-gradient i { background: rgba(59, 130, 246, 0.1) !important; color: #3b82f6 !important; border-color: rgba(59, 130, 246, 0.2) !important; }






.type-card-header {
    background: none !important;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.type-card i {
    font-size: 1rem; /* Smaller */
    color: var(--accent-blue);
    width: 32px; /* Smaller */
    height: 32px; /* Smaller */
    background: rgba(0, 112, 243, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(0, 112, 243, 0.1);
}

.type-card .project-title {
    margin: 0;
    font-size: 0.8rem !important; /* Smaller text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

/* Bookshelf - Flat Minimalist Style */
.reading-section {
    margin-top: 32px;
    padding-bottom: 40px;
}

/* Multi-Shelf Layout */
.bookshelf-multi-container {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 12px 20px 0; /* Clear space at top/bottom */
    margin-top: 10px;
    scrollbar-width: thin;
}

/* Custom scrollbar for the bookshelf area */
.bookshelf-multi-container::-webkit-scrollbar {
    width: 4px;
}
.bookshelf-multi-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.shelf-group {
    margin-bottom: 40px;
    position: relative;
    padding-top: 35px; /* More space for the year label */
}

.shelves-wrapper {
    display: flex;
    flex-direction: column;
    gap: 35px; /* Spanning between vertical shelf boards */
}

.shelf-year-label {
    position: absolute;
    top: -5px;
    left: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.8;
}

.bookshelf {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 0 10px;
    margin-top: 0; 
    min-height: 150px; /* Increased to avoid clipping hover */
    position: relative;
    justify-content: flex-start;
    border-bottom: 8px solid #e0e0e0;
}

[data-theme="dark"] .bookshelf {
    border-bottom-color: #333;
}

.bookshelf::after {
    display: none;
}

.spine-book {
    width: 25px;
    height: 110px;
    background: #444;
    border-radius: 2px 2px 0 0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 0px;
    padding: 10px 0;
}

.spine-book:hover {
    transform: translateY(-10px) scale(1.05);
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* Vertical title inside the spine */
.spine-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
    max-height: 85%;
    overflow: hidden;
    white-space: nowrap;
}

.spine-br {
    position: absolute;
    bottom: 6px;
    font-size: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    opacity: 0.5;
    color: white;
}

/* Book variety - using nth-child for size diversity */
.spine-book:nth-child(5n+1) { height: 115px; width: 28px; }
.spine-book:nth-child(5n+2) { height: 125px; width: 32px; }
.spine-book:nth-child(5n+3) { height: 105px; width: 22px; }
.spine-book:nth-child(5n+4) { height: 110px; width: 26px; }
.spine-book:nth-child(5n) { height: 120px; width: 30px; }

/* Font variety for spines */
.spine-book:nth-child(4n+1) .spine-title { font-family: 'Sora', sans-serif; }
.spine-book:nth-child(4n+2) .spine-title { font-family: 'Outfit', sans-serif; }
.spine-book:nth-child(4n+3) .spine-title { font-family: 'JetBrains Mono', monospace; }
.spine-book:nth-child(4n) .spine-title { font-family: 'Inter', sans-serif; }

/* non-repetitive organic colors */
.spine-book:nth-child(7n+1) { background-color: #6b46c1; border-left: 2px solid rgba(0,0,0,0.1); }
.spine-book:nth-child(7n+2) { background-color: #dd6b20; border-left: 2px solid rgba(0,0,0,0.1); }
.spine-book:nth-child(7n+3) { background-color: #2b6cb0; border-left: 2px solid rgba(0,0,0,0.1); }
.spine-book:nth-child(7n+4) { background-color: #38a169; border-left: 2px solid rgba(0,0,0,0.1); }
.spine-book:nth-child(7n+5) { background-color: #e53e3e; border-left: 2px solid rgba(0,0,0,0.1); }
.spine-book:nth-child(7n+6) { background-color: #3182ce; border-left: 2px solid rgba(0,0,0,0.1); }
.spine-book:nth-child(7n) { background-color: #805ad5; border-left: 2px solid rgba(0,0,0,0.1); }

/* Brightness jitter for more realism */
.spine-book:nth-child(odd) { filter: brightness(1.05); }
.spine-book:nth-child(3n) { filter: contrast(1.1) brightness(0.95); }

/* Light Theme Adjustments */
[data-theme="light"] .spine-book {
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}
[data-theme="light"] .spine-title {
    color: rgba(255, 255, 255, 0.95);
}

/* Project info section - transparent background */
.project-info {
    padding: 8px 0 0 8px;
    background-color: transparent;
}

.project-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.project-subtitle {
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text-muted);
    margin: 0;
}

/* Projects Divider */
.projects-divider {
    border: none;
    border-top: 1px dashed #333;
    margin: 48px 0 32px 0;
    width: 100%;
}

/* Other Projects Section */
.other-projects-title {
    margin-top: 0;
    margin-bottom: 16px;
}

.other-projects-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.other-projects-category {
    margin-bottom: 32px;
}

.other-projects-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-main);
    margin-bottom: 16px;
    opacity: 0.9;
}

.other-projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.other-project-item {
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.other-project-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.other-project-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 6px 0;
}

.other-project-item p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}



/* Tools Page Styles */
.tools-section {
    margin-bottom: 32px;
}

.tools-section:last-child {
    margin-bottom: 0;
}

.tools-category {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tool-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.tool-item i {
    font-size: 2rem;
    color: var(--accent-blue);
}

.tool-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Blog Page Styles */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.blog-post {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.blog-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 8px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.post-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.read-more {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: #0056b3;
}

/* Photos Page Styles - Masonry Layout */
.photos-masonry {
    column-count: 3;
    column-gap: 20px;
    margin-top: 24px;
    width: 100%;
}

.photo-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transform: translateZ(0); /* Hardware acceleration fix for webkit */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--card-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    z-index: 10;
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s ease;
}

.photo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.photo-overlay.simple {
    background: transparent;
    top: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-desc {
    font-size: 0.9rem;
    color: white;
    margin: 0;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.photo-link-icon {
    align-self: flex-start;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: background 0.2s ease;
    pointer-events: auto;
}

.photo-link-icon:hover {
    background: rgba(255, 255, 255, 0.4);
}

.photo-item:hover img {
    transform: scale(1.03);
}

.photo-placeholder {
    width: 100%;
    padding-bottom: 100%; /* Square aspect ratio placeholder */
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.photo-placeholder i {
    font-size: 2rem;
    color: var(--text-muted);
}

.photo-placeholder p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive adjustments for new pages */
@media (max-width: 900px) {
    .photos-masonry {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .projects-grid-cards {
        grid-template-columns: 1fr;
    }
    
    .other-projects-list {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .photos-masonry {
        column-count: 1;
    }
}

/* ===== Detail Page Styles ===== */

/* Detail Card - Standard width for all detail views */
.detail-card {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

/* TOC Styles */
.toc-container {
    position: absolute;
    top: 150px;
    right: -240px;
    width: 220px;
}

.toc-sticky {
    position: sticky;
    top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-h2 {
    font-weight: 500;
}

.toc-h3 {
    padding-left: 15px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.toc-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--accent-blue);
    transform: translateX(3px);
}

/* Responsive TOC */
@media (max-width: 1400px) {
    .toc-container {
        display: none; /* Hide TOC on smaller screens for now */
    }
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 24px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateX(-2px);
}

.back-button i {
    font-size: 0.85rem;
}

/* Detail Header */
.detail-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--border-color);
    transition: all 0.3s ease;
}

.leetcode-card-theme .detail-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom-color: rgba(255, 45, 85, 0.2);
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.2;
}

.detail-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.detail-date {
    display: inline-block;
    background-color: var(--badge-bg);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-state i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

.loading-state p {
    font-size: 1rem;
}

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

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.error-state i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 16px;
}

.error-state h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.error-state p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.retry-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background-color: #0051cc;
    transform: translateY(-1px);
}

/* Markdown Content Styles */
.markdown-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
}

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.markdown-content h1:first-child {
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.markdown-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.markdown-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.markdown-content p {
    margin-bottom: 16px;
    color: #d0d0d0;
}

.markdown-content a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.markdown-content a:hover {
    border-bottom-color: var(--accent-blue);
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.markdown-content li {
    margin-bottom: 8px;
    color: #d0d0d0;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--text-main);
}

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

.markdown-content code {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #ff79c6;
}

.markdown-content pre {
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    overflow-x: auto;
    position: relative;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: #f8f8f2;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Code Copy Button */
.code-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.markdown-content pre:hover .code-copy-button {
    opacity: 1;
}

.code-copy-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.code-copy-button.copied {
    background-color: #00a650;
    border-color: #00a650;
    color: white;
}

.markdown-content blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 32px 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.markdown-content table th,
.markdown-content table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-content table th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* Light theme adjustments for markdown */
[data-theme="light"] .markdown-content p,
[data-theme="light"] .markdown-content li {
    color: #333333;
}

[data-theme="light"] .markdown-content code {
    background-color: #f5f5f5;
    color: #c7254e;
}

[data-theme="light"] .markdown-content pre {
    background-color: #f8f8f8;
}

[data-theme="light"] .markdown-content pre code {
    color: #333333;
}

/* ===== Balloon System Styles ===== */
.floating-balloon {
    pointer-events: auto;
    cursor: pointer;
    width: 380px;
}

/* Use custom properties to avoid transform conflicts */
.floating-balloon {
    --balloon-rotation: 0deg;
    transform: rotate(var(--balloon-rotation));
}

.floating-balloon:hover {
    animation-play-state: paused;
    z-index: 1000;
}

/* Quadrilateral shapes with subtle rounding */
.balloon-card {
    background: #fff;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: transform 0.3s ease;
    color: #000;
    border-radius: 2.4rem;
    min-width: 380px;
    min-height: 160px; /* Enforce min-height for tails */
}

/* Round Avatars */
.balloon-avatar {
    width: 64px;
    height: 64px;
    object-fit: cover;
    margin-bottom: 5px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50% !important; /* Force round */
}

/* Vibrant Colors + Diverse Geometric "Lobe" Tails */
.balloon-bg-blue { background-color: #3b82f6; }
.balloon-bg-blue::after {
    content: ""; position: absolute; background: inherit; width: 100px; height: 60px;
    bottom: -35px; left: 40px; border-radius: 0 0 50% 50%; z-index: -1;
}

.balloon-bg-green { background-color: #22c55e; }
.balloon-bg-green::after {
    content: ""; position: absolute; background: inherit; width: 100px; height: 50px;
    top: -25px; right: 60px; border-radius: 20px 20px 0 0; transform: perspective(100px) rotateX(20deg); z-index: -1;
}

.balloon-bg-yellow { background-color: #eab308; }
.balloon-bg-yellow::after {
    content: ""; position: absolute; background: inherit; width: 60px; height: 60px;
    top: 50%; right: -25px; transform: translateY(-50%) rotate(45deg); border-radius: 12px; z-index: -1;
}

.balloon-bg-orange { background-color: #f97316; }
.balloon-bg-orange::after {
    content: ""; position: absolute; background: inherit; width: 80px; height: 80px;
    bottom: -30px; right: 40px; border-radius: 50%; z-index: -1;
}

.balloon-bg-pink { background-color: #ec4899; }
.balloon-bg-pink::after {
    content: ""; position: absolute; background: inherit; width: 60px; height: 100px;
    top: 30px; left: -30px; border-radius: 50% 0 0 50%; z-index: -1;
}

.balloon-bg-purple { background-color: #a855f7; }
.balloon-bg-purple::after {
    content: ""; position: absolute; background: inherit; width: 120px; height: 40px;
    bottom: -30px; left: 50%; transform: translateX(-50%); border-radius: 15px; z-index: -1;
}

.floating-balloon:hover .balloon-card {
    transform: scale(1.05);
}

.balloon-character {
    display: none; /* Removed happy faces as requested */
}

.balloon-eyes {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -2px;
}

.balloon-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balloon-name {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #000;
}

.balloon-badge {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.45);
    margin-left: 8px;
    font-weight: 600;
}

/* LeetCode specific streak bubble */
.balloon-type-leetcode .balloon-badge {
    background: white;
    color: #ff2d55; /* Pink theme */
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 900;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.balloon-message {
    font-size: 1.3rem; /* Original size for regular balloons */
    line-height: 1.3;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
    letter-spacing: -0.02em;
    color: #000;
    margin-top: 5px;
    
    /* Default truncation */
    display: -webkit-box;
    -webkit-line-clamp: 10;
    line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 15em;
}

/* Specific styling for Release and Daily Challenge balloons to fit more content */
.balloon-bg-green .balloon-message,
.balloon-bg-pink .balloon-message {
    font-size: 0.9rem !important;
    -webkit-line-clamp: 15 !important;
    line-clamp: 15 !important;
    max-height: 22em !important;
}

/* Regular balloons (blue ad) keep default appearance */
.balloon-bg-blue .balloon-message {
    font-size: 1.15rem; /* Classic ad size */
    -webkit-line-clamp: 6;
    line-clamp: 6;
    max-height: 10em;
}

/* Specific styling for the new Title line */
.balloon-title {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
    color: #000; /* Normalized to match message */
    margin: 8px 0 4px 0;
    line-height: 1.25;
}

/* Markdown Support Inside Balloons */
.balloon-message h1, .balloon-message h2, .balloon-message h3 {
    font-family: 'Sora', sans-serif;
    font-weight: 900;
    margin: 12px 0 6px 0;
    line-height: 1.2;
}
.balloon-message h1 { font-size: 1.25rem; }
.balloon-message h2 { font-size: 1.15rem; }
.balloon-message h3 { font-size: 1.05rem; }

.balloon-message p {
    margin: 0 0 8px 0;
}
.balloon-message p:last-child {
    margin-bottom: 0;
}
.balloon-message ul, .balloon-message ol {
    margin: 4px 0 8px 18px;
    padding: 0;
}
.balloon-message li {
    margin-bottom: 4px;
}
.balloon-message strong {
    font-weight: 900;
}

/* Balloon Link/Button */
.balloon-link {
    display: inline-block;
    width: fit-content; /* Fix: prevents border from stretching */
    margin-top: 14px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(0, 0, 0, 0.8);
    padding-bottom: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.balloon-link:hover {
    opacity: 0.7;
    transform: translateX(4px);
}

/* Standard notification layout overrides */
.balloon-card.organic-balloon {
    border: none;
    box-shadow: none;
}

/* Standardized YellowHood Ad styles concluded */
.balloon-card.balloon-twitter:hover {
    border-color: #333;
    background-color: #050505;
}

/* ===== Detail Page Styles ===== */
.detail-card {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    /* Ensure content doesn't break layout */
    max-width: 100%; 
    width: 100%; /* Force full width within container */
    overflow: hidden; 
}

.detail-header {
    text-align: left; /* Reverted to left alignment */
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.detail-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.detail-date {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--badge-bg);
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.back-button {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.2s;
}

.back-button:hover {
    background-color: var(--badge-bg);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Fix Markdown Overflow */
.markdown-content {
    width: 100%;
    overflow-wrap: break-word;
}

.markdown-content pre {
    overflow-x: auto; /* Allow code blocks to scroll horizontally instead of widening page */
    max-width: 100%;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
}


/* Base styles for Scattered Balloons */
.floating-balloon {
    width: 380px;
    position: absolute;
    will-change: left, right, transform, opacity;
    pointer-events: auto;
    cursor: pointer;
    z-index: 1;
    opacity: 0;
    transform: scale(0);
    /* Multi-animation shorthand: Entrance (0.8s) + Idle (Infinite) 
       NOTE: Delays are handled via JS animation-delay property */
    animation: balloon-pop-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               balloon-idle 6s ease-in-out infinite alternate 0.8s;
}

/* Ensure stable state after entrance */
.floating-balloon.is-ready {
    opacity: 1;
    transform: scale(1) rotate(var(--balloon-rotation, 0deg));
}

.floating-balloon:hover {
    z-index: 10000 !important;
}

.floating-balloon:hover .balloon-card {
    transform: scale(1.03) rotate(0deg) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
}

/* Exit animations override everything else */
.floating-balloon.balloon-exit-left {
    animation: balloon-slide-left 0.6s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important;
}

.floating-balloon.balloon-exit-right {
    animation: balloon-slide-right 0.6s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important;
}

@keyframes balloon-slide-left {
    from {
        transform: scale(1) rotate(var(--balloon-rotation, 0deg));
        opacity: 1;
    }
    to {
        transform: translateX(-150%) scale(0.9) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes balloon-slide-right {
    from {
        transform: scale(1) rotate(var(--balloon-rotation, 0deg));
        opacity: 1;
    }
    to {
        transform: translateX(150%) scale(0.9) rotate(20deg);
        opacity: 0;
    }
}

/* Subtle background life */
@keyframes balloon-idle {
    0% {
        transform: scale(1) translateY(0) rotate(var(--balloon-rotation, 0deg));
        opacity: 1;
    }
    50% {
        transform: scale(1) translateY(-15px) rotate(calc(var(--balloon-rotation, 0deg) + 2deg));
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0) rotate(var(--balloon-rotation, 0deg));
        opacity: 1;
    }
}

/* Entrance Animation: Small -> Big -> Settle */
@keyframes balloon-pop-in {
    0% {
        transform: scale(0) rotate(var(--balloon-rotation, 0deg));
        opacity: 0;
    }
    70% {
        transform: scale(1.08) rotate(var(--balloon-rotation, 0deg));
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(var(--balloon-rotation, 0deg));
        opacity: 1;
    }
}

/* Hide original move-up animation as we're switching systems */
@keyframes balloon-move-up {
    from { opacity: 0; }
    to { opacity: 0; }
}

/* Light theme adjustments for balloons */
[data-theme="light"] .balloon-card {
    box-shadow: none !important;
}

[data-theme="light"] .floating-balloon:hover .balloon-card {
    box-shadow: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Hide balloons completely on mobile */
    #balloon-container {
        display: none !important;
    }
    
    .floating-balloon {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .floating-balloon {
        width: 280px;
    }
    
    .balloon-card {
        padding: 12px;
    }
    
    .balloon-avatar {
        width: 40px;
        height: 40px;
    }
    
    .balloon-name {
        font-size: 0.85rem;
    }
    
    .balloon-message {
        font-size: 0.8rem;
    }
}


/* Responsive adjustments for detail page */
@media (max-width: 500px) {
    .detail-title {
        font-size: 1.5rem;
    }

    .detail-subtitle {
        font-size: 1rem;
    }

    .markdown-content h1 {
        font-size: 1.5rem;
    }

    .markdown-content h2 {
        font-size: 1.25rem;
    }

    .markdown-content h3 {
        font-size: 1.1rem;
    }

    .markdown-content pre {
        padding: 12px;
        font-size: 0.85rem;
    }
}


/* Old photos CSS removed to avoid conflicts */

/* Cleanup unused classes */
.photo-info, .photo-title {
    display: none;
}

/* Loading State */
.loading-state,
.error-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-muted);
    gap: 16px;
}

.loading-state i,
.error-state i {
    font-size: 2rem;
}

.error-state i {
    color: #ef4444;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Photos Page Masonry Layout */
/* Styles moved to main section above */

/* ===== Wide Layout System ===== */
body.wide-layout .main-container {
    max-width: 1000px; /* Reduced to ensure space for 380px wide ads */
}

/* Adjust grid/masonry for wide layout */
body.wide-layout .photos-masonry {
    column-count: 4; /* More columns on wide screens */
}

/* Responsive adjustments for wide layout */
@media (max-width: 1600px) {
    body.wide-layout .main-container {
        max-width: 1200px;
    }
    body.wide-layout .photos-masonry {
        column-count: 3;
    }
}

@media (max-width: 1200px) {
    body.wide-layout .main-container {
        max-width: 900px;
    }
}

@media (max-width: 900px) {
    body.wide-layout .photos-masonry {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    body.wide-layout .photos-masonry {
        column-count: 1;
    }
}


/* Feed System */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.feed-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
    gap: 12px;
}

.feed-item-header {
    padding: 4px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-item-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-item-content {
    padding: 4px;
}

.feed-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.feed-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 600px) {
    .feed-item-image {
        aspect-ratio: 4 / 3;
    }
}

.feed-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #444;
    transform: translateY(-4px);
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.feed-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    background-color: var(--badge-bg);
    color: var(--text-main);
    border-radius: 4px;
    letter-spacing: 0.05em;
}



.feed-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.feed-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

[data-theme="light"] .feed-item {
    background-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .feed-item:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .feed-tag {
    background-color: #e3f2fd;
    color: #1976d2;
}/* Article Types Grid (2x2) */
.article-types-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

.type-card {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.type-card-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.type-card-header i {
    font-size: 1rem;
    color: #fff;
}

.type-card-header .project-title {
    margin: 0;
    font-size: 0.9rem;
}

[data-theme="light"] .type-card {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

@media (max-width: 500px) {
    .article-types-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Academic Section - Wider Layout (Matching Photos page -> 1000px) */
.academic-page-container {
    max-width: 1000px !important;
    margin-left: auto;
    margin-right: auto;
}

.academic-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.academic-item {
    padding: 24px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.academic-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #444;
    transform: translateY(-2px);
}

.academic-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.academic-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.academic-type {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    background-color: var(--badge-bg);
    color: var(--accent-blue);
    border-radius: 4px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0, 112, 243, 0.2);
}

.academic-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.academic-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.academic-link {
    color: var(--accent-blue);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.academic-link:hover {
    text-decoration: underline;
}

/* Standardized wide layout rule above at line 30 handles this instantly */

/* ===== Sidebar Layout System ===== */
/* CV / Academic Section Styles */
.cv-profile-header {
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.cv-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.cv-title {
    font-size: 1.1rem;
    color: var(--accent-blue);
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cv-citation {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-family: monospace;
}

.cv-bio {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 800px;
}

.cv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cv-meta span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-section-card {
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.cv-section {
    margin-bottom: 0;
}

.cv-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 32px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 16px;
}

.cv-section-title i {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

/* Timeline Styles */
.cv-timeline {
    position: relative;
    padding-left: 32px;
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-left: 10px;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -40px;
    top: 6px;
    width: 14px;
    height: 14px;
    background-color: var(--bg-main);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 4px var(--bg-main);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.timeline-period {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    background: rgba(0, 112, 243, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.timeline-institution {
    font-size: 1rem;
    color: var(--text-main);
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.academic-item {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border-color) !important;
    padding: 24px !important;
    margin-bottom: 16px;
}

.academic-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--accent-blue) !important;
}

.academic-title {
    font-size: 1.3rem !important;
    margin-bottom: 12px !important;
}

.page-layout-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    width: 100%;
}

@media (max-width: 900px) {
    .page-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* Hide sidebar on mobile to keep focus on feed */
    }
}

.main-content-area {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 40px;
    align-self: start;
}

/* Detail Page Width Adjustment */
body.detail-mode .main-container {
    max-width: 1000px;
}

/* Feed Filtering Styles */
.feed-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.clear-filter-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.clear-filter-btn:hover {
    opacity: 0.9;
}

.no-results, .no-content-msg {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    padding: 20px 0;
    text-align: center;
}

.clickable-card-filter {
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.clickable-card-filter:hover {
    transform: translateY(-4px) !important;
    opacity: 1 !important;
}

.clickable-filter {
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.clickable-filter:hover, .clickable-filter.active {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

.type-card.active {
    background-color: rgba(0, 112, 243, 0.05);
}

.sidebar-tag.clickable-filter.active {
    background-color: var(--hover-color);
    color: white;
    border-color: var(--hover-color);
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-tag.clickable-filter:hover {
    background-color: var(--hover-color);
    color: white;
    border-color: var(--hover-color);
}

.sidebar-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .sidebar-card {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-label {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-main);
    opacity: 0.9;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Collapsible Section (Mobile Only) */
.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-section .sidebar-section-header {
    cursor: pointer;
}

.sidebar-toggle-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    display: none; /* Hidden by default (desktop) */
}

.collapsible-section .sidebar-toggle-icon {
    display: block;
}

.collapsible-section.expanded .sidebar-toggle-icon {
    transform: rotate(180deg);
}

.sidebar-section-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.collapsible-section .sidebar-section-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.collapsible-section.expanded .sidebar-section-content {
    max-height: 500px;
    opacity: 1;
    margin-top: 16px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-tag {
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    --hover-color: var(--accent-blue); /* Default */
}

[data-theme="light"] .sidebar-tag {
    background-color: #f5f5f5;
    color: #333;
}

.sidebar-tag:hover, .sidebar-tag.active {
    border-color: var(--hover-color);
    color: white;
    background-color: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .sidebar-tag:hover, [data-theme="light"] .sidebar-tag.active {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    color: white;
}

/* Specific Tech Hover Colors (can be overridden via JS data) */
.sidebar-tag[data-tag="CSS"] { --hover-color: #264de4; }
.sidebar-tag[data-tag="React"] { --hover-color: #61dafb; }
.sidebar-tag[data-tag="Animation"] { --hover-color: #ff007a; }
.sidebar-tag[data-tag="Career"] { --hover-color: #4caf50; }
.sidebar-tag[data-tag="JavaScript"] { --hover-color: #f7df1e; }
.sidebar-tag[data-tag="SVG"] { --hover-color: #ffb13b; }
.sidebar-tag[data-tag="Next.js"] { --hover-color: #ffffff; }
[data-theme="light"] .sidebar-tag[data-tag="Next.js"] { --hover-color: #000000; }
.sidebar-tag[data-tag="General"] { --hover-color: #888888; }
.sidebar-tag[data-tag="AI"] { --hover-color: #9c27b0; }
.sidebar-tag[data-tag="Web Tools"] { --hover-color: #03a9f4; }
.sidebar-tag[data-tag="Project"] { --hover-color: #e91e63; }
.sidebar-tag[data-tag="Site"] { --hover-color: #009688; }
.sidebar-tag[data-tag="VS Code"] { --hover-color: #007acc; }

/* Academic / Skills Specific Colors */
.sidebar-tag[data-tag="Large Language Models"] { --hover-color: #ff5722; }
.sidebar-tag[data-tag="Full Stack Development"] { --hover-color: #4caf50; }
.sidebar-tag[data-tag="System Architecture"] { --hover-color: #673ab7; }
.sidebar-tag[data-tag="UI/UX Design"] { --hover-color: #e91e63; }
.sidebar-tag[data-tag="Product Strategy"] { --hover-color: #ff9800; }
.sidebar-tag[data-tag="Automation"] { --hover-color: #00bcd4; }
.sidebar-tag[data-tag="Python"] { --hover-color: #3776ab; }
.sidebar-tag[data-tag="C++"] { --hover-color: #00599c; }
.sidebar-tag[data-tag="Node.js"] { --hover-color: #339933; }
.sidebar-tag[data-tag="TypeScript"] { --hover-color: #3178c6; }
.sidebar-tag[data-tag="LeetCode"] { --hover-color: #ff2d55; }
.sidebar-tag[data-tag="Study Notes"] { --hover-color: #06b6d4; }
.sidebar-tag[data-tag="Book Review"] { --hover-color: #a855f7; }
.sidebar-tag[data-tag="Guides"] { --hover-color: #f97316; }
.sidebar-tag[data-tag="Photos"] { --hover-color: #22c55e; }
.sidebar-tag[data-tag="Updates"] { --hover-color: #3b82f6; }
.sidebar-tag[data-tag="Thoughts"] { --hover-color: #3b82f6; }
.sidebar-tag[data-category="Full Reviews"]:hover { --hover-color: #a855f7 !important; }
.sidebar-tag[data-category="Mastery & Guides"]:hover { --hover-color: #f97316 !important; }
.sidebar-tag[data-category="Book Review"]:hover { --hover-color: #a855f7 !important; }
.sidebar-tag[data-category="Reviews"]:hover { --hover-color: #a855f7 !important; }
.sidebar-tag[data-tag="Book Review"] { --hover-color: #a855f7; }
.sidebar-tag[data-tag="Full Reviews"] { --hover-color: #a855f7; }
.sidebar-tag[data-tag="Reviews"] { --hover-color: #a855f7; }



/* Sidebar Link List */
.sidebar-link-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover {
    color: #ff007a;
}

.sidebar-link:hover i {
    transform: translateX(4px);
    color: #ff007a;
}

/* Responsive Visibility Utilities */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

@media (max-width: 900px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Modal Overlay & Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-window {
    background-color: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.active .modal-window {
    transform: scale(1);
}

.modal-header {
    padding: 40px 60px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.modal-info-left {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.modal-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -2px;
}

.modal-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 0 60px 60px;
    overflow-y: auto;
    flex: 1;
}

.pub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    width: 100%;
}

.pub-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s ease-out;
    cursor: pointer;
    height: 100%;
}

.pub-card:hover {
    border-color: var(--accent-blue);
    background-color: rgba(255, 255, 255, 0.02);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.pub-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--text-main);
}

.pub-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-blue);
    text-decoration: none;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.read-more-btn::after {
    content: '→';
    transition: transform 0.2s;
}

.pub-card:hover .read-more-btn::after {
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .pub-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        padding: 30px;
    }
    
    .modal-title {
        font-size: 2.2rem;
    }
    
    .modal-body {
        padding: 0 30px 30px;
    }
    
    .pub-card {
        padding: 30px;
    }
}

/* --------------------------------------------------------
   LEETCODE MASTERY PAGE
----------------------------------------------------------- */
/* Standardized LeetCode list container within Detail Card */
.leetcode-heatmap-container {
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 20px 0 30px;
    transition: all 0.3s ease;
}

[data-theme="light"] .leetcode-heatmap-container {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.05);
}

.leetcode-heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.leetcode-heatmap-title {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    color: #ff2d55;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.leetcode-heatmap {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
    padding-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 45, 85, 0.3) transparent;
}

.leetcode-heatmap::-webkit-scrollbar {
    height: 6px;
}

.leetcode-heatmap::-webkit-scrollbar-track {
    background: transparent;
}

.leetcode-heatmap::-webkit-scrollbar-thumb {
    background-color: rgba(255, 45, 85, 0.2);
    border-radius: 10px;
}

.leetcode-heatmap:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 45, 85, 0.4);
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.heatmap-day {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    transition: all 0.2s;
    flex-shrink: 0;
}

[data-theme="light"] .heatmap-day {
    background: rgba(0, 0, 0, 0.05);
}

.heatmap-day.active {
    background: #ff2d55;
    box-shadow: 0 2px 6px rgba(255, 45, 85, 0.3);
}

.heatmap-day:hover {
    transform: scale(1.2);
    z-index: 5;
    background: rgba(255, 45, 85, 0.6);
}

.heatmap-day.not-2026 {
    opacity: 0.2;
}

/* Month Separation & Carousel */
.leetcode-months-scroll-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 20px;
    margin-top: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 45, 85, 0.3) transparent;
}

.leetcode-months-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.leetcode-months-scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 45, 85, 0.2);
    border-radius: 10px;
}

.leetcode-months-grid {
    display: flex;
    gap: 40px;
    padding: 0 5px;
}

.heatmap-month-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.month-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #ff2d55;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* Pink accents for LeetCode internal elements */
.leetcode-badge-pink {
    background-color: rgba(255, 45, 85, 0.1) !important;
    color: #ff2d55 !important;
    border-color: rgba(255, 45, 85, 0.3) !important;
}

.leetcode-item-card:hover {
    border-color: #ff2d55 !important;
}

.leetcode-item-card:hover .read-more-btn {
    color: #ff2d55 !important;
}

/* Category Card Pink Palette (target by ID via sibling or specific class) */
/* Redundant LeetCode rules removed (Consolidated into bg-pink-gradient) */

[data-theme="light"] [data-type-id="leetcode-resolutions"].type-card {
    background-color: #f8f9fa !important;
}

[data-theme="light"] .heatmap-month-block .heatmap-day:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.heatmap-day.not-this-month {
    opacity: 0.1;
}

/* LeetCode card theme overrides for back button and retry */
.leetcode-card-theme:hover {
    border-color: #ff2d55 !important;
}

.leetcode-card-theme .back-button:hover {
    background-color: rgba(255, 45, 85, 0.1);
    color: #ff2d55;
    border-color: #ff2d55;
}

.leetcode-card-theme .retry-button {
    background-color: #ff2d55;
}

.leetcode-card-theme .retry-button:hover {
    background-color: #cc2444;
}

/* --------------------------------------------------------
   LEETCODE FILTERS & CATEGORIES
----------------------------------------------------------- */
.leetcode-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #ff2d55;
    color: white;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: #ff2d55;
    background: rgba(255, 255, 255, 0.08);
}

.sort-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
}

/* Category Tags */
.card-category-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.card-category-tag.daily {
    background: rgba(255, 45, 85, 0.1);
    color: #ff2d55;
    border: 1px solid rgba(255, 45, 85, 0.2);
}

.card-category-tag.training {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.article-badge.training {
    background: #007aff;
}

.practice-tag {
    color: #007aff;
    font-weight: 600;
}

/* LeetCode heatmap refining for pub-grid layout */
.leetcode-pub-grid {
    margin-top: 24px;
}

.pub-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .pub-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .leetcode-item-card {
    background: rgba(0, 0, 0, 0.01) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .leetcode-item-card:hover {
    background: white !important;
    border-color: #ff2d55 !important;
    box-shadow: 0 10px 30px rgba(255, 45, 85, 0.08);
}

[data-theme="light"] .leetcode-filters {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .filter-group {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .search-box input,
[data-theme="light"] .sort-group select {
    background: white;
    border-color: rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------
   LEETCODE DETAIL PAGE
----------------------------------------------------------- */
a.pub-card, a.back-button {
    text-decoration: none !important;
    color: inherit !important;
}

a.pub-card *, a.back-button * {
    text-decoration: none !important;
}

.leetcode-item-card h3 {
    text-decoration: none !important;
    color: var(--text-main);
}

.read-more-btn {
    color: #ff2d55 !important;
    text-decoration: none !important;
}
.leetcode-detail {
    padding-bottom: 120px;
}


.article-header {
    margin-bottom: 40px;
}

.article-badge {
    color: #ff2d55;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 850;
    margin: 12px 0;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.streak-fire {
    color: #ff2d55;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main);
    opacity: 0.95;
}

.article-content h1, .article-content h2, .article-content h3 {
    font-family: 'Sora', sans-serif;
    color: var(--text-main);
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    font-weight: 800;
}

.article-content h2 { 
    font-size: 1.6rem; 
    border-left: 4px solid #ff2d55; 
    padding-left: 15px; 
}

.article-content p { margin-bottom: 1.5em; }

.article-content code {
    background: rgba(255, 45, 85, 0.08);
    color: #ff2d55;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: #0d0d0d;
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .article-content pre {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.05);
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.9rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5em;
    padding-left: 20px;
}

.article-content li { margin-bottom: 10px; }

.article-content img {
    max-width: 100%;
    border-radius: 24px;
    margin: 2em 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.article-content a {
    color: var(--pink);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-meta .external-link {
    color: var(--pink);
    text-decoration: none;
    font-weight: 800;
}

.article-meta .external-link:hover {
    text-decoration: underline;
}

/* Light Mode Overrides for Detail Content */
[data-theme="light"] .article-content {
    color: #222222;
}

[data-theme="light"] .article-content h1, 
[data-theme="light"] .article-content h2, 
[data-theme="light"] .article-content h3 {
    color: #111111;
}

[data-theme="light"] .error-state {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .article-content code {
    background: rgba(255, 45, 85, 0.05);
    border: 1px solid rgba(255, 45, 85, 0.1);
}

/* Ensure detail-mode handles backgrounds if needed */
body.detail-mode {
    background-attachment: fixed;
}

/* ===== Study Notes Page Styles ===== */
.notes-card-theme {
    min-height: 80vh;
}

.notes-controls {
    margin: 12px 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.notes-search-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.notes-search-box:focus-within {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.1);
}

.notes-search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    font-size: 1rem;
    outline: none;
}

.notes-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.tag-cloud-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: 8px;
    font-weight: 500;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}



.clear-tags-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 8px;
}

.clear-tags-btn:hover {
    color: var(--text-main);
}

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

.note-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.note-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.04);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.note-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.note-tags {
    display: flex;
    gap: 6px;
}



.note-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.4;
}

.note-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.read-note-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.read-note-btn:hover {
    gap: 10px;
}

/* Tag Overflow Tooltip */
.more-tags {
    position: relative;
    cursor: help;
    background: transparent !important;
    color: var(--text-muted) !important;
    padding: 0 4px !important;
    font-size: 1.2rem !important;
    line-height: 0.5;
    top: 4px;
}

.more-tags:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: pre-wrap;
    min-width: 150px;
    max-width: 200px;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    text-align: center;
    pointer-events: none;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

/* Tooltip Arrow */

/* ===== Full Reviews (Acrylic Bookshelf) ===== */
.reviews-card-theme {
    min-height: 80vh;
}

.shelves-container {
    display: flex;
    flex-direction: column;
    gap: 48px;
    margin-top: 32px;
}

.shelf-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.shelf-category {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.shelf-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.shelf-count i {
    font-size: 0.7rem;
}

/* Acrylic Shelf styling */
.acrylic-shelf-wrapper {
    position: relative;
    padding-bottom: 24px; /* Space for the barrier below books */
    overflow: hidden; /* Hide overflow locally if needed, but horizontal scroll on track */
}

.books-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 12px 12px 24px 12px;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none; 
    position: relative;
    z-index: 1; /* Behind Acrylic */
}

.books-track::-webkit-scrollbar {
    display: none;
}

.book-item {
    flex: 0 0 auto;
    width: 140px; /* Adjust size later */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 5;
    position: relative;
}

.book-item:hover {
    transform: translateY(-16px) scale(1.05); /* Pop up effect */
    z-index: 10;
}

.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    /* Reflective Shine */
    position: relative;
}

/* Acrylic Barrier */
.acrylic-barrier {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%; 
    border-radius: 12px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2); 
    z-index: 20; /* In front of books (bottom part) */
    pointer-events: none; /* Allow clicks through? Actually no, usually barrier blocks */
}

/* Tint Colors */
.acrylic-barrier.orange-tint {
    background: linear-gradient(180deg, rgba(255, 120, 0, 0.05), rgba(255, 100, 0, 0.15));
    border-top: 2px solid rgba(255, 150, 50, 0.2);
}

.acrylic-barrier.blue-tint {
    background: linear-gradient(180deg, rgba(0, 112, 243, 0.05), rgba(0, 90, 200, 0.15));
    border-top: 2px solid rgba(50, 150, 255, 0.2);
}

.acrylic-barrier.purple-tint {
    background: linear-gradient(180deg, rgba(121, 40, 202, 0.05), rgba(100, 30, 180, 0.15));
    border-top: 2px solid rgba(150, 50, 255, 0.2);
}

/* Screws */
.screw-head {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, #f0f0f0, #aaa);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
    z-index: 21;
}

.screw-head::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 2px;
    background: #888;
    transform: translate(-50%, -50%) rotate(45deg);
}

.screw-head::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 2px;
    background: #888;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.screw-head.left { left: 16px; }
.screw-head.right { right: 16px; }

/* Reviews Page Styles */
.reviews-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.book-grid-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.book-grid-item:hover {
    transform: translateY(-5px);
}

.book-cover-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.75rem;
}

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

.book-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.book-status-badge.reading {
    background-color: #eab308;
}

.book-status-badge.finished {
    background-color: #22c55e;
}

.book-info {
    text-align: center;
}

.book-title-text {
    font-size: 0.95rem; /* Slightly larger */
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
    
    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* Acrylic Shelf (keeping legacy support) */
.acrylic-shelf-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.05); /* Subtle glass shelf */
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-top: 4px solid rgba(255,255,255,0.1);
}

.books-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.books-track .book-item {
    width: 100px;
    flex-shrink: 0;
}


/* Enhanced Book Feed Styles */
.book-feed-container {
    background: rgba(0,0,0,0.1) !important;
    padding: 20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 320px !important; /* Larger for better visibility */
}

.book-feed-img {
    width: auto !important;
    height: 100% !important;
    max-height: 280px !important;
    object-fit: contain !important;
    box-shadow: 10px 10px 20px rgba(0,0,0,0.4), -2px -2px 5px rgba(255,255,255,0.05);
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.feed-item:hover .book-feed-img {
    transform: scale(1.03) translateZ(10px);
}

.status-indicator {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.status-indicator.reading {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}



/* Tag Color Variations - Fixed */
.feed-tag.tag-pink {
    background: rgba(236, 72, 153, 0.1) !important;
    color: #ec4899 !important;
}

.feed-tag.tag-pink {
    background: rgba(236, 72, 153, 0.1) !important;
    color: #ec4899 !important;
}

.feed-tag.tag-orange {
    background: rgba(249, 115, 22, 0.1) !important;
    color: #f97316 !important;
}

.feed-tag.tag-green {
    background: rgba(34, 197, 94, 0.1) !important;
    color: #22c55e !important;
}

.feed-tag.tag-cyan {
    background: rgba(6, 182, 212, 0.1) !important;
    color: #06b6d4 !important;
}

.feed-tag.tag-purple {
    background: rgba(168, 85, 247, 0.1) !important;
    color: #a855f7 !important;
}

.feed-tag.tag-blue {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
}

/* ===== Admin Dashboard Styles ===== */
.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

/* Dashboard Layout */
.admin-dashboard {
    width: 90vw;
    max-width: 1400px;
    margin: 20px auto;
    left: 50%;
    transform: translateX(-50%);
    position: relative;
    padding: 0 !important;
    overflow: hidden;
    height: 85vh;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.admin-dashboard:hover {
    transform: translateX(-50%) translateY(-2px) !important;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: var(--card-bg);
}

.login-header i {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-family: 'Sora', sans-serif;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 14px;
    background: rgba(128,128,128,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

[data-theme="light"] .login-form input {
    color: #000 !important;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-error-msg {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 15px;
}

.caps-warning-msg {
    color: #f59e0b;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 8px;
    background: rgba(245, 158, 11, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100%;
}

.admin-sidebar {
    background: rgba(255,255,255,0.02);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 10px;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
}

.admin-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
}

.admin-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-nav {
    flex: 1;
}

.admin-nav-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 15px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.admin-nav-item i {
    width: 20px;
    text-align: center;
}

.admin-nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.admin-nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.admin-logout-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.8;
}

.admin-logout-btn:hover {
    opacity: 1;
}

.admin-main-content {
    padding: 40px;
    overflow-y: auto;
}

/* Tab Header */
.admin-tab-header {
    margin-bottom: 30px;
}

.admin-tab-header .header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-tab-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.8rem;
    margin: 0;
}

.admin-tab-header p {
    color: var(--text-muted);
    margin-top: 5px;
}

.btn-action {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* Stats */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Three Panel Workflow */
.admin-three-panel {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    height: calc(100% - 130px);
}

.admin-three-panel > div {
    display: flex;
    flex-direction: column;
}

.admin-three-panel h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.panel-inventory {
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.inventory-list {
    overflow-y: auto;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.inventory-item:hover {
    background: rgba(255,255,255,0.03);
}

.inventory-item.active {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

.inventory-item img {
    width: 40px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
}

.item-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-form .form-group {
    margin-bottom: 15px;
}

.admin-form label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.admin-form input, 
.admin-form select, 
.admin-form textarea {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
}

.upload-row {
    display: flex;
    gap: 10px;
}

.btn-upload-label {
    flex: 0 0 45px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 !important;
}

.btn-upload-label:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-save {
    width: 100%;
    padding: 12px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

/* Photos Grid in Inventory */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
}

.grid-item.active {
    border-color: var(--accent-blue);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Balloons Admin */
.balloon-list-admin {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.balloon-item-admin {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.balloon-badge-mini {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.balloon-badge-mini.blue { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.balloon-badge-mini.green { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.balloon-badge-mini.pink { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.balloon-badge-mini.yellow { background: rgba(234, 179, 8, 0.2); color: #eab308; }

.balloon-info-admin {
    flex: 1;
}

.balloon-title-admin {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.balloon-msg-admin {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.balloon-date-admin {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-action.secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
}

.btn-action.secondary:hover {
    background: rgba(255,255,255,0.1);
}
