
/* Matrix-style background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 65, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

:root {
    --bg-terminal: #0c0c0c;
    --bg-header: #1e1e1e;
    --text-primary: #00ff41;
    --text-secondary: #33ff33;
    --text-muted: #808080;
    --text-white: #ffffff;
    --text-blue: #569cd6;
    --text-yellow: #dcdcaa;
    --text-pink: #c586c0;
    --text-orange: #ce9178;
    --border-color: #333;
    --cursor-color: #00ff41;
    --btn-close: #ff5555;
    --btn-minimize: #ff9500;
    --btn-maximize: #00ca4e;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-terminal);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-weight: 550;
}

.terminal-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: var(--bg-terminal);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: relative;
}

.terminal-header {
    background: var(--bg-header);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.terminal-body {
    padding: 20px;
    height: calc(100% - 45px);
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 550;
}

#terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0;
}

/* Blog links in terminal should work normally */
#terminal-output a.blog-link {
    cursor: pointer;
}

.input-line {
    display: flex;
    align-items: center;
    position: sticky;
    bottom: 0;
    background: var(--bg-terminal);
    padding: 0;
    position: relative;
}

.prompt {
    color: var(--text-primary);
    margin-right: 8px;
    font-weight: 700;
}

#input-display {
    color: var(--text-primary);
    white-space: pre;
}

.cursor-block {
    color: var(--cursor-color);
    animation: blink 1s infinite;
    font-weight: bold;
}

#terminal-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.help-hint {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.7;
}

/* Command buttons - hidden by default */
.command-buttons {
    display: none;
}

.highlight {
    color: var(--text-yellow);
    font-weight: 600;
}

/* Terminal content styling */
.command {
    color: var(--text-primary);
}

.output {
    color: var(--text-white);
    margin-left: 0;
}

.error {
    color: #ff6b6b;
}

.success {
    color: var(--text-secondary);
}

.info {
    color: var(--text-blue);
}

.warning {
    color: var(--text-yellow);
}

.header {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 16px;
    margin: 15px 0 10px 0;
}

.subheader {
    color: var(--text-blue);
    font-weight: 600;
    margin: 10px 0 5px 0;
}

.list-item {
    color: var(--text-white);
    margin-left: 20px;
}

/* Blog listing styles for dedicated page */
.blog-item-page {
    margin: 20px 0;
    padding: 16px;
    border-left: 3px solid var(--text-secondary);
    padding-left: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.blog-item-page:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--text-primary);
}

.blog-item-header-page {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.blog-date-page {
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.blog-link-page {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    flex: 1;
    min-width: 200px;
}

.blog-link-page:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.blog-summary-page {
    color: var(--text-white);
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0 8px 0;
    opacity: 0.9;
}

.blog-slug-page {
    color: var(--text-muted);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    display: inline-block;
    margin-top: 4px;
}

.tech-item {
    color: var(--text-pink);
    display: inline-block;
    margin-right: 15px;
}

.link {
    color: var(--text-orange);
    text-decoration: underline;
    cursor: pointer;
}

a.link {
    color: var(--text-orange);
    text-decoration: underline;
}

a.link:hover {
    color: var(--text-yellow);
    text-decoration: none;
}

/* Blog links should work normally - they have target="_blank" */
a.blog-link {
    text-decoration: none !important;
}

a.blog-link:hover {
    text-decoration: underline !important;
}

.award {
    color: var(--text-yellow);
    font-weight: 500;
}

.date {
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .terminal-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .terminal-body {
        padding: 15px;
        font-size: 13px;
        padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)); /* extra space for content & comfortable room above buttons */
    }
    
    .terminal-header {
        padding: 8px 12px;
    }
    
    .help-hint {
        display: none;
    }
    
    /* Show command buttons on mobile */
    .command-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-header);
        padding: 12px;
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: var(--border-color) var(--bg-header); /* Firefox */
    }
    
    /* Always visible scrollbar for command buttons on mobile */
    .command-buttons::-webkit-scrollbar {
        height: 8px;
    }
    
    .command-buttons::-webkit-scrollbar-track {
        background: var(--bg-header);
    }
    
    .command-buttons::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }
    
    .command-buttons::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }
    
    .cmd-btn {
        background: var(--bg-terminal);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        padding: 10px 16px;
        border-radius: 4px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        flex: 0 0 auto;
        white-space: nowrap;
        touch-action: manipulation;
    }
    
    .cmd-btn:active {
        background: var(--border-color);
        transform: scale(0.95);
    }

    .input-line {
        position: relative; /* return to normal document flow */
        bottom: initial;
        z-index: auto;
        background: var(--bg-terminal);
    }
    
    /* Mobile blog page improvements */
    body.blog-page > div {
        padding: 0 12px;
        margin: 20px auto;
    }
    
    /* Mobile blog title - make it more prominent */
    #post-title {
        font-size: 24px;
        font-weight: 700;
        line-height: 1.3;
        margin: 0 0 12px;
        letter-spacing: -0.3px;
    }
    
    body.blog-page header {
        margin: 16px 0 20px;
        padding-bottom: 12px;
    }
    
    body.blog-page a.link {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    #post-meta {
        font-size: 13px;
    }
    
    .table-wrapper {
        margin: 16px -12px;
        padding: 0 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .table-wrapper::-webkit-scrollbar {
        height: 6px;
    }
    
    .table-wrapper::-webkit-scrollbar-track {
        background: var(--bg-terminal);
    }
    
    .table-wrapper::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
    
    #post-content table {
        min-width: 600px;
        font-size: 11px;
        margin: 0;
    }
    
    #post-content table th {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    #post-content table td {
        padding: 8px 6px;
        font-size: 11px;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Reduce header font size on mobile */
    .header {
        font-size: 14px;
        margin: 12px 0 8px 0;
    }
    
    /* Mobile blog listing on page */
    .blog-item-page {
        margin: 16px 0;
        padding: 12px;
        padding-left: 14px;
        border-left-width: 2px;
    }
    
    .blog-item-header-page {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .blog-date-page {
        font-size: 12px;
    }
    
    .blog-link-page {
        font-size: 16px;
        min-width: auto;
        width: 100%;
    }
    
    .blog-summary-page {
        font-size: 13px;
        margin: 8px 0 6px 0;
    }
    
    .blog-slug-page {
        font-size: 11px;
    }
}

/* Scrollbar styling */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: var(--bg-terminal);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Animation for text appearing */
.typing {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(50) 1s 1 normal both;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* Secret: Indraja modal and hearts */
.i-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.i-modal {
    background: #111;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 18px;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.i-title {
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.i-question { color: var(--text-blue); margin: 6px 0 8px 0; text-align: center; }
.i-input {
    width: 100%;
    background: #0c0c0c;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}
.i-actions { display:flex; gap:8px; justify-content:flex-end; margin-top: 12px; }
.i-btn { background: var(--bg-header); color: var(--text-primary); border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 4px; cursor: pointer; font-family: inherit; }
.i-btn:hover { background: var(--border-color); }
.i-hint { color: var(--text-muted); font-size: 12px; margin-top: 8px; text-align: center; }

.i-shake { animation: i-shake 0.4s; }
@keyframes i-shake { 10%, 90% { transform: translateX(-1px);} 20%, 80% { transform: translateX(2px);} 30%, 50%, 70% { transform: translateX(-4px);} 40%, 60% { transform: translateX(4px);} }

.i-hearts { color: #ff6b6b; margin: 8px 0; animation: i-pulse 1.6s infinite; }
@keyframes i-pulse { 0%,100%{ opacity:0.7; transform: scale(0.98);} 50%{ opacity:1; transform: scale(1.02);} }

.i-photo { margin: 10px 0; }
.i-photo img { max-width: 240px; width: 100%; border-radius: 8px; border: 1px solid var(--border-color); display:block; }

/* Blog page overrides */
body.blog-page { height: auto; min-height: 100vh; overflow: auto; display: block; align-items: initial; justify-content: initial; }
body.blog-page > div { max-width: 860px; margin: 32px auto; padding: 0 16px; }

/* Blog title styling */
#post-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #33ff33 0%, #00ff41 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    position: relative;
}

/* Fallback for browsers that don't support gradient text */
@supports not (-webkit-background-clip: text) {
    #post-title {
        color: var(--text-secondary);
        background: none;
        -webkit-text-fill-color: initial;
    }
}

#post-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

body.blog-page header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

body.blog-page a.link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 14px;
    transition: all 0.2s;
}

body.blog-page a.link:hover {
    color: var(--text-secondary);
    transform: translateX(-2px);
}

#post-content pre { overflow: auto; padding: 12px; border: 1px solid var(--border-color); border-radius: 6px; background: #0f0f0f; }
#post-content code { font-family: 'JetBrains Mono', monospace; }
#post-content img { max-width: 100%; height: auto; display: block; margin: 12px 0; border-radius: 4px; }
#post-content p { margin: 12px 0; }
#post-content ul { margin: 12px 0 12px 20px; }
#post-content table { width: 100%; border-collapse: collapse; margin: 16px 0; border: 1px solid var(--border-color); }
#post-content table th { background: var(--bg-header); color: var(--text-primary); padding: 10px 12px; border: 1px solid var(--border-color); font-weight: 600; }
#post-content table td { padding: 10px 12px; border: 1px solid var(--border-color); color: var(--text-white); }
#post-content table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
#post-content table tbody tr:hover { background: rgba(0, 255, 65, 0.05); }

/* Table scrolling wrapper - will be applied via JS wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px -16px;
    padding: 0 16px;
}

.table-wrapper table {
    margin: 0;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .cursor-block {
        animation: none;
    }
    .typing {
        animation: none;
    }
}

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

