/* === CSS Variables for Color Themes === */
:root {
    --primary-color: #33ff33;
    /* Green */
    --secondary-color: #ffbc00;
    /* Amber */
    --primaryb-color: #115611;
    --primaryc-color: #002100;
    --secondaryb-color: #553e00;
    --secondaryc-color: #342600;
}

::selection {
    color: rgb(0, 0, 0);
    background-color: var(--primary-color);
}

/* === Global Styles === */
body {
    background-color: #000;
    color: var(--primary-color);
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    line-height: 1.4;
    margin: 40px auto;
    max-width: 800px;
    padding: 20px;
}

.terminal {
    border: 2px solid var(--primary-color);
    padding: 20px;
    position: relative;
}

.terminal::before {
    content: "LIGHT UPON - LOG";
    position: absolute;
    font-size: 1.4rem;
    top: -16px;
    /* Adjusted value */
    left: 20px;
    background: #000;
    padding: 0 10px;
    z-index: 1;
    /* Ensure visibility */
}

.post {
    margin-bottom: 30px;
}

.post-title {
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.post-title::before {
    content: "> ";
}

.post-date {
    opacity: 0.7;
    margin-bottom: 10px;
}

.cursor {
    animation: blink 1s infinite;
    display: inline-block;
    width: 10px;
    height: 20px;
    background: var(--primary-color);
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.pagination {
    margin-top: 70px;
    border-top: 1px solid var(--primary-color);
    padding-top: 20px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: #000;
}

.pagination a:hover {
    background: var(--primary-color);
    color: #000;
    text-decoration: none;
}

.pagination::before {
    content: "$ page ";
    color: var(--primary-color);
}

.editor .audio-player {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
    line-height: normal;
}

.editor .audio-player:after {
    content: '\200B';
    /* Zero-width space */
    display: inline;
}

.editor {
    border: 1px solid var(--primary-color);
    padding: 10px;
    margin-bottom: 20px;
    height: 200px;
    overflow-y: auto;
    background-color: #000;
    color: var(--primary-color);
}

.editor-toolbar {
    margin-bottom: 10px;
}

.editor-toolbar button {
    background: var(--primary-color);
    border: none;
    padding: 5px 10px;
    color: #000;
    margin-right: 5px;
    cursor: pointer;
}

.editor-toolbar button:hover {
    background: #000;
    color: var(--primary-color);
}

/* === Scrollbar Styles for WebKit-Based Browsers === */
/* Apply styles to the entire document */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #000;
    /* Terminal background color */
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    /* Scrollbar thumb color */
    border-radius: 6px;
    border: 3px solid #000;
    /* Creates padding around thumb */
    transition: background-color 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
    /* Lighter green on hover */
}

::-webkit-scrollbar-corner {
    background: #000;
    /* Matches the terminal background */
}

/* === Optional: Styling Scrollbars for Specific Elements === */
/* If you have specific scrollable elements, e.g., .terminal */
.terminal::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.terminal::-webkit-scrollbar-track {
    background: #000;
}

.terminal::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 6px;
    border: 3px solid #000;
    transition: background-color 0.3s;
}

.terminal::-webkit-scrollbar-thumb:hover {
    background-color: #66ff66;
}

.terminal::-webkit-scrollbar-corner {
    background: #000;
}

/* === Link Styles === */
.post-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-content a:hover {
    animation: linkFlicker 0.6s step-end infinite;
}

@keyframes linkFlicker {

    0%,
    49%,
    100% {
        background-color: transparent;
        color: var(--primary-color);
    }

    50%,
    99% {
        background-color: var(--primary-color);
        color: #000000;
    }
}

@keyframes flash {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0.2;
    }
}

.flash-text {
    color: var(--primary-color);
    animation: flash 1.5s infinite;
}

hr {
    border: none;
    border-top: 1px solid var(--primary-color);
    margin-top: 48px;
    margin-bottom: 32px;
    width: 100px;
    height: 1px;
}

.blog-h2 {
    font-weight: bold;
    font-size: calc(1.3rem + 2px);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}


/* === Color Switcher Styles === */
.wrapper {
    position: relative;
    /* Establishes a positioning context for absolute children */
    max-width: 800px;
    /* Matches the body's max-width for consistency */
    margin: 40px auto;
    /* Centers the wrapper horizontally */
    padding: 20px;
    /* Maintains existing padding */
}

/* === Color Switcher Styles === */
.color-switch {
    position: absolute;
    right: 20px;
    background: #000;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 4px 8px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 18px;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    z-index: 1000;
}

.color-switch:hover {
    background: var(--primary-color);
    color: #000;
}

/* === Admin Panel Styles === */
/* These styles are included within vt.css for consistency */
/* Adjusted to use CSS variables for color theming */

.error {
    color: red;
    margin-bottom: 10px;
}

.login-form input[type="password"] {
    background: #000;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px;
    font-family: 'VT323', monospace;
    width: 100%;
}

.login-form button {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'VT323', monospace;
}

.login-form button:hover {
    background: #66ff66;
    /* Lighter green on hover */
}

.error-message {
    color: red;
    margin-bottom: 10px;
}

.success-message {
    color: green;
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #000;
    color: var(--primary-color);
    font-family: 'VT323', monospace;
}

th,
td {
    border: 1px solid var(--primary-color);
    padding: 8px;
    text-align: left;
}

th,
td:hover {
    background-color: var(--primaryb-color);
}


th {
    background: #004400;
}

td a {
    color: var(--primary-color);
    text-decoration: none;
}

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

form input[type="text"],
form input[type="date"],
form textarea {
    width: 100%;
    background: #000;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px;
    font-family: 'VT323', monospace;
}

form button {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 5px 10px;
    font-size: 1.4rem;
    cursor: pointer;
    font-family: 'VT323', monospace;
}

form button:hover {
    background: #66ff66;
    /* Lighter green on hover */
}

/* === Date Picker Styles === */
.date-picker {
    position: relative;
    display: inline-block;
}

.calendar {
    display: none;
    position: absolute;
    background: #000;
    border: 1px solid var(--primary-color);
    padding: 10px;
    z-index: 1000;
    color: var(--primary-color);
    font-family: 'VT323', monospace;
}

.calendar.visible {
    display: block;
}

.calendar table {
    width: 100%;
    border-collapse: collapse;
}

.calendar th,
.calendar td {
    width: 14.28%;
    text-align: center;
    padding: 5px 0;
    cursor: pointer;
}

.calendar th {
    background: #004400;
}

.calendar td:hover {
    background: var(--primary-color);
    color: #000;
}

.calendar .selected {
    background: #66ff66;
    color: #000;
}

/* Image styles */
.post-image-container {
    text-align: center;
    margin: 20px 0;
}

.post-image {
    max-width: 100%;
    height: auto;
    filter: opacity(0.8) brightness(0.5) contrast(1.2);
    mix-blend-mode: screen;
}

/* Quote */

.quote {
    border: 2px solid var(--primaryb-color);
    padding-left: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin: 20px 0;
    color: var(--primary-color);
    font-style: italic;
    background-color: var(--primaryc-color);
}


/* Adjust image color based on theme */
:root[style*="--primary-color: #ffbc00"] .post-image {
    filter: sepia(100%) hue-rotate(350deg) saturate(200%) brightness(0.5) contrast(1.3);
}

:root[style*="--primary-color: #33ff33"] .post-image {
    filter: sepia(100%) hue-rotate(70deg) saturate(200%) brightness(0.5) contrast(1.3);
}

/* Editor image styles */
.editor img {
    max-width: 100%;
    height: auto;
}

/* === Audio Player Styles === */
.audio-player {
    display: inline-block;
    padding: 5px 10px;
    margin: 10px 0;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.audio-player .audio-control {
    color: var(--primary-color);
    font-weight: bold;
}

.audio-player.playing {
    animation: dash-border 1s linear infinite;
}

@keyframes dash-border {
    0% {
        border-style: dashed;
        border-image: linear-gradient(0deg, var(--primary-color) 50%, transparent 50%) 1;
    }

    25% {
        border-style: dashed;
        border-image: linear-gradient(90deg, var(--primary-color) 50%, transparent 50%) 1;
    }

    50% {
        border-style: dashed;
        border-image: linear-gradient(180deg, var(--primary-color) 50%, transparent 50%) 1;
    }

    75% {
        border-style: dashed;
        border-image: linear-gradient(270deg, var(--primary-color) 50%, transparent 50%) 1;
    }

    100% {
        border-style: dashed;
        border-image: linear-gradient(360deg, var(--primary-color) 50%, transparent 50%) 1;
    }
}

/* === Comment Window Styles === */
.comment-window {
    position: fixed;
    top: 100px;
    left: 100px;
    min-width: 200px;
    min-height: 30px;
    height: 300px;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-family: 'VT323', monospace;
    z-index: 1000;
    background-color: #000000;
    display: none;
    /* Hidden by default */
    box-sizing: border-box;
}

.comment-window.visible {
    display: block;
}

.comment-window .title-bar {
    width: 100%;
    height: 30px;
    background-color: var(--primaryc-color);
    cursor: move;
    display: flex;
    border-bottom: 2px solid var(--primary-color);
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    box-sizing: border-box;
}

.comment-window .title-bar .title {
    font-size: 1.2rem;
}

.comment-window .title-bar .window-controls {
    display: flex;
    gap: 10px;
}

.control-button svg {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
}

.control-button {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
}

.control-button:hover {
    background-color: var(--primary-color);
}

.control-button svg:hover {
    fill: #000000;
}

.comment-window .title-bar .window-controls .control-button {
    width: 16px;
    height: 16px;
    color: #000;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.comment-window .content {
    padding: 10px;
    height: calc(100% - 30px);
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
    background-color: #000000;
    /* Add these properties for text wrapping */
    word-wrap: break-word;
    white-space: normal;
    width: 100%;
}

/* Update the comment styles */
.comment-window .content .comment {
    border-bottom: 1px solid var(--primary-color);
    padding: 5px 0;
    /* Add these properties for text wrapping */
    word-wrap: break-word;
    white-space: normal;
    width: 100%;
}

/* Update the comment paragraph styles */
.comment-window .content .comment p {
    /* Add these properties for text wrapping */
    word-wrap: break-word;
    white-space: normal;
    width: 100%;
    margin: 5px 0;
}

.comment-window .content .comment:last-child {
    border-bottom: none;
}

.comment-window .input-area {
    padding: 10px;
    box-sizing: border-box;
    background-color: #000;
    display: none;
    /* Hidden by default */
    margin-top: 10px;
}

.comment-window .input-area input,
.comment-window .input-area textarea {
    width: 100%;
    background: #000;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px;
    font-family: 'VT323', monospace;
    margin-bottom: 5px;
    font-size: 1.1rem;
    box-sizing: border-box;
    resize: none;
    /* Add these properties for text wrapping */
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Add styles for placeholders */
.comment-window .input-area input::placeholder,
.comment-window .input-area textarea::placeholder {
    color: var(--primaryb-color);
    opacity: 1;
    /* Firefox needs this */
}

/* For Internet Explorer */
.comment-window .input-area input:-ms-input-placeholder,
.comment-window .input-area textarea:-ms-input-placeholder {
    color: var(--primaryb-color);
}

/* For Microsoft Edge */
.comment-window .input-area input::-ms-input-placeholder,
.comment-window .input-area textarea::-ms-input-placeholder {
    color: var(--primaryb-color);
}

.comment-window .input-area button {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'VT323', monospace;
}

.comment-window .input-area button:hover {
    background: #66ff66;
}

/* Resize Handle */
.comment-window .resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: transparent;
    border-style: solid;
    border-width: 2px;
    /* Initial thickness */
    border-color: transparent var(--primary-color) var(--primary-color) transparent;
    cursor: se-resize;
    user-select: none;
    z-index: 1;
    transition: border-width 0.2s ease;
}

.comment-window .resize-handle.active {
    border-width: 0 12px 12px 0;
    /* Increased thickness when active */
}

/* === Comment Button Styles === */
.comment-button {
    color: var(--primary-color);
    cursor: pointer;
    float: right;
    margin-top: 5px;
}

.comment-button::after {
    content: attr(data-count);
    margin-left: 18px;
}

.comment-button:hover {
    animation: linkFlicker 0.6s step-end infinite;
}

.comment-window .add-comment-button {
    color: var(--primary-color);
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
}

.comment-window .add-comment-button:hover {
    animation: linkFlicker 0.6s step-end infinite;
}

/* === Status Bar Styles === */
.status-bar {
    display: flex;
    justify-content: space-between;
    /* Positions children at ends */
    align-items: center;
    /* Vertically centers the items */
    margin-top: 16px;
    /* Adds space above the status bar */
}

/* Optional: Adjust the cursor size or animation if needed */
.status-bar .cursor {
    /* Inherit existing cursor styles */
    /* You can override or add styles here if desired */
    /* For example, change size: */
    width: 10px;
    height: 20px;
    background: var(--primary-color);
    animation: blink 1s infinite;
}



/* === Typing Simulation Styles === */
.typing-simulation {
    font-family: 'VT323', monospace;
    color: var(--primary-color);
    white-space: nowrap;
    /* Prevent text wrapping */
    overflow: hidden;
    /* Hide overflowing text */
    opacity: 1;
    /* Ensure full opacity by default */
    transition: opacity 0.2s ease-out;
    /* Transition for opacity changes */
}

.typing-simulation .cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: var(--primary-color);
    margin-left: 2px;
    margin-bottom: 4px;
    animation: blink 1s infinite;
    vertical-align: bottom;
}

/* Fade-Out Animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* .fade-out class to trigger the fade-out animation */
.fade-out {
    animation: fadeOut 0.2s forwards;
}

/* Optional: Style for the typing text */
#typing-text {
    display: inline;
}

/* Existing blink animation */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Optional: Responsive adjustments */
@media (max-width: 600px) {
    .typing-simulation {
        font-size: 1rem;
    }

    .comment-window {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-width: unset;
        min-height: unset;
        border: none;
        border-radius: 0;
        z-index: 2000;
        /* Ensure it stays above other elements */
        box-shadow: none;
        background-color: #000000;
    }

    .comment-window.visible {
        display: flex;
        flex-direction: column;
    }

    .comment-window .title-bar {
        height: 50px;
        background-color: var(--primaryc-color);
        border-bottom: 2px solid var(--primary-color);
        padding: 0 15px;
    }

    .comment-window .title-bar .title {
        font-size: 1.5rem;
    }

    .comment-window .content {
        flex: 1;
        padding: 15px;
        overflow-y: auto;
    }

    .comment-window .input-area {
        padding: 15px;
        margin-top: 10px;
    }

    /* Hide the resize handle on mobile */
    .comment-window .resize-handle {
        display: none;
    }

    /* Adjust Close and Minimize Buttons for better tap targets */
    .comment-window .window-controls {
        gap: 15px;
    }

    .comment-window .control-button {
        width: 24px;
        height: 24px;
    }

    /* Ensure buttons are easily tappable */
    .comment-window .control-button svg {
        width: 100%;
        height: 100%;
    }

    /* Optional: Add a backdrop to focus on the comment window */
    .comment-window::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: -1;
    }

    .post {
        margin-bottom: 90px;
    }

}