/*
This CSS file defines the visual style of the website, implementing a cyber-security/terminal theme.
It includes styles for layout, colors, fonts, and animations like the loading screen fade-out and text flickering.
*/
/* Base and CRT Effect */
html {
    overflow-y: scroll; /* Allow vertical scrolling */
}

body {
    background-color: #0a0a0a; /* Slightly off-black */
    color: #00ff41; /* Bright green */
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
}

/* Matrix Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Behind scanlines and content */
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease-out; /* フェードアウトのアニメーション */
}

#loading-screen.fade-out {
    opacity: 0;
}

.loading-text {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: -1;
    pointer-events: none;
}

/* Layout: Constrain width and center */
.terminal-container {
    max-width: 1000px; /* Constrain width */
    margin: 2rem auto; /* Center the container with top/bottom margin */
    padding: 2rem;
    border: 1px solid #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    background-color: rgba(0, 10, 0, 0.8); /* Dark green transparent background */
}

/* Header */
.terminal-header {
    text-align: center;
    border-bottom: 1px solid #00ff41;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.terminal-header h1 {
    font-size: 2.5rem;
    color: #00ff41;
    text-shadow: 0 0 5px #00ff41;
    margin-bottom: 1rem;
}

/* Flicker Effect for H1 */
.flicker-text {
    animation: flicker 3s infinite alternate; /* 3秒周期で無限に繰り返す */
}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 5px #00ff41, 0 0 10px #00ff41, 0 0 20px #00ff41, 0 0 40px #00ff41, 0 0 80px #00ff41;
        color: #00ff41;
    }
    20%, 24%, 55% {
        text-shadow: none;
        color: #00ff41;
    }
}

.terminal-header nav a {
    color: #00ff41;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s, text-shadow 0.3s;
}

.terminal-header nav a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff;
}

/* Sections */
.terminal-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    color: #888; /* Comment-like color */
    margin-bottom: 1.5rem;
    border-bottom: none;
}

/* C-like Struct for Profile */
.struct-like p {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.c-member {
    /* padding-left is now handled by &nbsp; in HTML */
}

.c-comment {
    color: #6a9955; /* Green for comments */
}

.c-type {
    color: #4ec9b0; /* Teal for types */
}

.c-typename {
    color: #dcdcaa; /* Yellow for type names */
}

.c-variable {
    display: inline-block;
    width: 12ch; /* Fixed width for alignment */
    color: #9cdcfe; /* Light blue for variables */
    padding-right: 1ch;
}

.c-string {
    color: #ce9178; /* Orange for strings */
    word-wrap: break-word; /* Long words can break and wrap */
    word-break: break-all; /* Force breaks within words */
}

/* Typing Effect */
.typing-cursor {
    animation: blink 1s step-end infinite;
    color: #00ff41;
}

@keyframes blink {
    from, to { color: transparent; }
    50% { color: #00ff41; }
}


/* Event Log Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #005a17; /* Darker green border */
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: #002a0b; /* Even darker green for header */
}

/* Network Nodes */
.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.node-category {
    color: #888;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.nodes-grid ul {
    list-style: none;
    padding: 0;
}

.nodes-grid li a {
    color: #00ff41;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: background-color 0.2s;
}

.nodes-grid li a:hover {
    background-color: #002a0b;
}

/* Footer */
.terminal-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #00ff41;
    font-size: 0.9rem;
    color: #888;
}

/* General Link Style */
a {
    color: #00ff41;
    text-decoration: none;
}

.a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Admin Page Specific Styles */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #00ff41;
}

.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="date"],
.input-group textarea {
    width: 100%;
    padding: 0.5rem;
    background-color: #001a00; /* Darker green background */
    border: 1px solid #00ff41;
    color: #00ff41;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    box-shadow: 0 0 5px #00ff41;
}

.terminal-button {
    background-color: #00ff41;
    color: #0a0a0a;
    border: 1px solid #00ff41;
    padding: 0.75rem 1.5rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.terminal-button:hover {
    background-color: #00cc33;
    color: #000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .terminal-container {
        margin: 1rem;
        padding: 1rem;
    }

    .terminal-header h1 {
        font-size: 2rem;
    }

    .terminal-header nav {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .terminal-header nav a {
        margin: 0.5rem 0;
    }
}