/* General body styling */
body {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content */
    align-items: center;
    min-height: 100vh;
    background-color: black;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Slightly transparent background */
    padding: 10px;
    z-index: 10; /* Ensure the header is above the other content */
    text-align: center;
}

/* Main title */
h1 {
    font-size: 4.5em;
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00;
    margin: 0;
    text-align: center;
    padding: 10px; /* Add space from the screen edges */
}

/* Content */
.content {
    margin-top: 120px; /* Increase to make space for the header */
    padding: 20px;
    width: 100%; /* Full width for better responsiveness */
    max-width: 900px;
    overflow: auto;
    display: flex;
    justify-content: center; /* Horizontally center the content */
    align-items: center; /* Vertically center the content */
}

/* Facts container */
.facts-container {
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    padding: 20px;
    border-radius: 10px;
    width: 100%; /* Ensure full width on mobile */
    max-width: 800px;
    box-shadow: 0 0 15px #00ff00;
    margin-bottom: 20px; /* Spacing at the bottom */
}

/* Facts text */
.facts {
    color: #00ff00;
    font-size: 1.25em;
    text-align: left;
    margin: 0;
    line-height: 1.3;
}

/* Footer */
footer {
    position: fixed;
    bottom: 10px;
    color: #00ff00;
    font-size: 0.7em;
    text-shadow: 0 0 10px #00ff00;
    text-align: center;
    width: 100%;
}

/* Matrix */
.matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Ensure the matrix is behind all other content */
    background-color: rgba(0, 0, 0, 0.5); /* Darken the matrix effect with semi-transparent black */
}

#matrixCanvas {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.5;
}

/* Media Queries for Responsive Design */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 3em; /* Reduce font size for smaller screens */
        padding: 5px; /* Keep some padding from the edges */
    }

    .facts-container {
        padding: 15px;
        max-width: 95%; /* Make sure it fits well on smaller screens */
    }

    .facts {
        font-size: 1em; /* Slightly smaller text for mobile */
    }

    footer {
        font-size: 0.6em; /* Adjust footer font size for mobile */
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 2.5em; /* Further reduce for smaller devices */
        padding: 5px; /* Keep padding from edges */
    }

    .facts-container {
        padding: 10px;
        max-width: 90%; /* Ensure it fits small screens */
    }

    .facts {
        font-size: 0.9em;
    }

    footer {
        font-size: 0.55em; /* Smaller footer font size */
    }
}

/* Copy button and feedback for blogi.html */

/* Article action alignment and compact button */
.article-actions {
    margin: 8px 0 18px 0;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end; /* place actions on the right */
    position: relative; /* container for absolute feedback */
}

.copy-btn {
    background: #640164;
    color: #fff;
    border: none;
    padding: 6px 10px; /* slightly smaller */
    border-radius: 6px;
    font-size: 0.85rem; /* reduced font-size */
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    line-height: 1; /* more compact */
}

.copy-btn:hover {
    background: #4a014a;
}

@media (max-width: 420px) {
    .article-actions {
        justify-content: flex-start; /* keep accessible on very small screens */
    }
    .copy-btn {
        padding: 6px 8px;
        font-size: 0.82rem;
    }
}

.copy-feedback {
    font-size: 0.85rem;
    color: #fff; /* light text for dark backgrounds */
    opacity: 0;
    transition: opacity 160ms ease-in-out, transform 160ms ease-in-out;
    position: absolute; /* overlay so it doesn't shift layout */
    right: 0; /* align to the right edge of the actions container */
    top: -34px; /* pop above the button */
    background: rgba(0,0,0,0.6);
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none; /* don't capture clicks */
    transform: translateY(-6px);
}

.copy-feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 420px) {
    /* On very small screens the actions are left-aligned; place feedback below the button */
    .copy-feedback {
        right: auto;
        left: 0;
        top: 36px;
        transform: translateY(6px);
    }
    .copy-feedback.visible {
        transform: translateY(0);
    }
}
