/*
Theme Name: TojDev Terminal
Theme URI: https://tojdev.local
Description: A retro CRT terminal-style theme for Jason "Toj" Fowler's developer portfolio
Author: Toj Fowler
Author URI: https://tojdev.local
Template: twentytwentyfive
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tojdev-terminal
*/

/* Import Retro Console Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;600;700&family=Share+Tech+Mono&family=Press+Start+2P&display=swap');

/* ============================================
   BASE RETRO CRT TERMINAL STYLES
   ============================================ */

:root {
    --terminal-bg: #0f0f0f;
    --terminal-bg-light: #1a1a1a;
    --terminal-bg-lighter: #252525;
    --terminal-border: #333;
    --terminal-green: #33ff33;
    --terminal-green-dim: #228822;
    --terminal-green-bright: #66ff66;
    --terminal-scan: rgba(0, 255, 0, 0.03);
    --terminal-glow: rgba(51, 255, 51, 0.15);
}

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

body {
    background: var(--terminal-bg) !important;
    color: var(--terminal-green) !important;
    font-family: 'Fira Code', 'Roboto Mono', 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.6 !important;
    overflow-x: hidden;
    position: relative;
    font-weight: 400;
}

/* CRT Screen Effect Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        var(--terminal-scan) 50%
    );
    background-size: 100% 4px;
    z-index: 9998;
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

/* Screen Flicker */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9997;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

@keyframes flicker {
    0% {
        opacity: 0.27861;
    }
    5% {
        opacity: 0.34769;
    }
    10% {
        opacity: 0.23604;
    }
    15% {
        opacity: 0.90626;
    }
    20% {
        opacity: 0.18128;
    }
    25% {
        opacity: 0.83891;
    }
    30% {
        opacity: 0.65583;
    }
    35% {
        opacity: 0.67807;
    }
    40% {
        opacity: 0.26559;
    }
    45% {
        opacity: 0.84693;
    }
    50% {
        opacity: 0.96019;
    }
    55% {
        opacity: 0.08594;
    }
    60% {
        opacity: 0.20313;
    }
    65% {
        opacity: 0.71988;
    }
    70% {
        opacity: 0.53455;
    }
    75% {
        opacity: 0.37288;
    }
    80% {
        opacity: 0.71428;
    }
    85% {
        opacity: 0.70419;
    }
    90% {
        opacity: 0.7003;
    }
    95% {
        opacity: 0.36108;
    }
    100% {
        opacity: 0.24387;
    }
}

/* Text Glow Effect - Subtle */
h1, h2, h3, h4, h5, h6, a, .terminal-glow {
    text-shadow: 0 0 3px var(--terminal-glow);
    color: var(--terminal-green-bright) !important;
}

/* Apply Share Tech Mono to all headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Share Tech Mono', monospace !important;
    font-weight: 400 !important;
    letter-spacing: 2px;
}

/* Links */
a {
    color: var(--terminal-green-bright) !important;
    text-decoration: none !important;
    border-bottom: 1px dotted var(--terminal-green-dim);
    transition: all 0.3s ease;
}

a:hover {
    color: #fff !important;
    border-bottom-color: var(--terminal-green-bright);
    text-shadow: 0 0 5px var(--terminal-glow);
}

/* Container & Layout */
.wp-site-blocks,
.wp-block-group,
main {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

/* Remove any borders from WordPress wrapper elements */
.wp-site-blocks,
.wp-block-group,
.alignfull,
.alignwide,
body > *,
html {
    border-top: none !important;
    border-bottom: none !important;
}

/* Hide any HR/separator elements */
hr,
.wp-block-separator {
    display: none !important;
}

/* Hide WordPress theme header and footer */
header.wp-block-template-part,
footer.wp-block-template-part {
    display: none !important;
}

/* Hide site title in header */
.wp-block-site-title,
.site-title,
header h1,
#header,
#headerimg {
    display: none !important;
}

/* Hide WordPress credit footer */
.wp-block-template-part footer,
footer p:not(.terminal-container footer p),
#footer,
div[role="contentinfo"] {
    display: none !important;
}

/* Ensure our custom footer is still visible */
.terminal-container + footer {
    display: block !important;
}

/* Navigation */
.terminal-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--terminal-bg-light);
    border: 2px solid var(--terminal-border);
    padding: 15px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.terminal-nav a {
    display: block;
    padding: 5px 0;
    font-size: 18px;
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.terminal-nav a::before {
    content: "> ";
    color: var(--terminal-green-bright);
}

/* Section Styling */
section {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Alternating section backgrounds for depth */
section:nth-child(even) {
    background: var(--terminal-bg-light);
}

/* Hero/Header Section */
.hero-section {
    text-align: center;
    position: relative;
}

.hero-section h1 {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 48px !important;
    margin-bottom: 20px;
    letter-spacing: 2px;
    line-height: 1.4;
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    from {
        text-shadow: 0 0 3px var(--terminal-glow);
    }
    to {
        text-shadow: 0 0 6px var(--terminal-glow);
    }
}

.terminal-prompt {
    font-size: 20px;
    color: var(--terminal-green);
    margin-bottom: 60px;
    text-align: left;
    position: absolute;
    top: 20px;
    left: 20px;
}

.cursor {
    display: none;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Terminal Box Sections */
.terminal-box {
    border: 2px solid var(--terminal-border);
    padding: 30px;
    margin: 20px 0;
    background: var(--terminal-bg-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    position: relative;
}

.terminal-box::before {
    content: "[ " attr(data-title) " ]";
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--terminal-bg);
    padding: 0 10px;
    color: var(--terminal-green-bright);
    font-size: 22px;
    letter-spacing: 3px;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skill-item {
    border: 1px solid var(--terminal-border);
    padding: 15px;
    background: var(--terminal-bg-lighter);
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: #2a2a2a;
    border-color: var(--terminal-green-dim);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.skill-item h3 {
    font-size: 24px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--terminal-border);
    padding-bottom: 5px;
}

/* ASCII Art Dividers */
.ascii-divider {
    text-align: center;
    font-size: 14px;
    color: var(--terminal-green-dim);
    margin: 40px 0;
    letter-spacing: 2px;
    opacity: 0.7;
}

/* Experience Timeline */
.experience-item {
    margin: 30px 0;
    padding-left: 30px;
    border-left: 3px solid var(--terminal-border);
    position: relative;
}

.experience-item::before {
    content: "●";
    position: absolute;
    left: -9px;
    top: 0;
    font-size: 20px;
    color: var(--terminal-green-bright);
}

.experience-item h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

.experience-item .company {
    color: var(--terminal-green);
    font-size: 18px;
    margin-bottom: 10px;
}

/* Certifications List */
.cert-list {
    list-style: none;
    margin-top: 20px;
}

.cert-list li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
}

.cert-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--terminal-green-bright);
    font-size: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    background: var(--terminal-bg-light);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 24px !important;
        letter-spacing: 1px;
    }

    .terminal-nav {
        position: relative;
        top: 0;
        right: 0;
        margin: 20px;
    }

    section {
        padding: 60px 10px;
        text-align: center;
    }

    /* Allow typed-text to wrap on mobile */
    .typed-text {
        white-space: normal !important;
        overflow: visible !important;
        animation: none !important;
        font-size: 18px !important;
        line-height: 1.5 !important;
    }

    /* Reduce hero subtitle font size */
    .hero-section p {
        font-size: 16px !important;
    }

    /* Make pre-formatted text wrap properly on mobile - NO horizontal scroll */
    pre {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        padding: 10px 5px !important;
        text-align: left !important;
    }

    /* Reduce terminal box padding on mobile */
    .terminal-box {
        padding: 20px 10px !important;
        margin: 20px 5px !important;
    }

    /* Reduce heading sizes on mobile */
    h2 {
        font-size: 18px !important;
    }

    h3 {
        font-size: 16px !important;
    }

    /* Reduce terminal box title font size */
    .terminal-box::before {
        font-size: 16px !important;
    }

    /* Make terminal prompt smaller on mobile */
    .terminal-prompt {
        font-size: 14px !important;
    }

    /* Reduce ascii divider font size */
    .ascii-divider {
        font-size: 10px !important;
        overflow-x: auto !important;
    }

    /* Center content within sections */
    .terminal-container {
        text-align: center;
    }

    /* Left-align terminal boxes content but center the boxes */
    .terminal-box {
        text-align: left;
    }

    /* Improve paragraph readability on mobile */
    p {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }
}

/* Kubectl Table Styles */
.kubectl-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    margin-top: 20px;
    table-layout: auto;
}

.kubectl-table thead {
    border-bottom: 1px solid var(--terminal-border);
}

.kubectl-table th {
    text-align: left;
    padding: 10px 15px;
    font-weight: 600;
    color: var(--terminal-green-dim) !important;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-shadow: none !important;
}

.kubectl-table td {
    padding: 8px 15px;
    border-bottom: 1px solid #21262d;
    color: var(--terminal-green) !important;
}

.kubectl-table tbody tr:hover {
    background-color: var(--terminal-bg-lighter);
}

.kubectl-table .namespace {
    color: #79c0ff !important;
}

.kubectl-table .name {
    color: var(--terminal-green) !important;
}

.kubectl-table .ready {
    color: #7ee787 !important;
}

.kubectl-table .age {
    color: #ffa657 !important;
}

/* Mobile responsive for kubectl table */
@media (max-width: 768px) {
    .kubectl-table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
    }

    .kubectl-table th,
    .kubectl-table td {
        padding: 8px 10px;
    }

    .kubectl-table th {
        font-size: 12px;
    }
}

/* WordPress Block Overrides */
.wp-block-group__inner-container,
.wp-block-columns,
.wp-block-column {
    background: transparent !important;
}

p {
    color: var(--terminal-green) !important;
    font-size: 18px;
}

strong, b {
    font-weight: 600;
    color: var(--terminal-green-bright) !important;
}

/* Typing Animation */
.typed-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 3px;
    animation: typing 3.5s steps(40, end);
}

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

/* ============================================
   CRT TURN-ON EFFECT
   ============================================ */

/* CRT Overlay - Full screen black background */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
}

#crt-overlay.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* The expanding horizontal line effect */
#crt-scanline {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

#crt-scanline.expand {
    animation: expandVertical 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Content and nav start hidden and over-bright */
.terminal-container,
.terminal-nav {
    opacity: 0;
    filter: brightness(1);
}

.terminal-container.crt-on,
.terminal-nav.crt-on {
    animation: crtPowerOn 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Keyframe Animations */
@keyframes expandVertical {
    0% {
        height: 2px;
        opacity: 1;
    }
    50% {
        height: 100vh;
        opacity: 0.8;
    }
    100% {
        height: 100vh;
        opacity: 0;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes crtPowerOn {
    0% {
        opacity: 0;
        filter: brightness(3) contrast(2);
    }
    40% {
        opacity: 1;
        filter: brightness(2) contrast(1.5);
    }
    70% {
        filter: brightness(1.3) contrast(1.2);
    }
    100% {
        opacity: 1;
        filter: brightness(1) contrast(1);
    }
}
