/* General CRT body */
body {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    background: #0f0f0f;
    color: #00ff00;
    overflow: hidden;
}

/* CRT container */
.crt-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    box-shadow: 0 0 60px #00ff00, 0 0 120px #00ff00, 0 0 200px #00ff00;
}

/* Left panel */
.project-list {
    width: 250px;
    background: rgba(0, 40, 0, 0.9);
    overflow-y: auto;
    padding: 10px;
    border-right: 2px solid #00ff00;
    text-shadow: 0 0 8px #00ff00;
}

.project-list h2 {
    margin-top: 0;
    text-align: center;
}

.project-list ul {
    list-style: none;
    padding-left: 0;
}

.project-list li {
    padding: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    text-shadow: 0 0 5px #00ff00, 1px 0 1px rgba(0,255,0,0.5);
}

.project-list li:hover {
    border: 1px solid #00ff00;
    background: rgba(0, 100, 0, 0.3);
}

/* Right panel */
.project-preview {
    flex: 1;
    padding: 20px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px #00ff00;
}

/* Exit button */
.admin-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    background: black;
    color: #00ff00;
    border: 1px solid #00ff00;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #00ff00;
}

.admin-btn:hover {
    background: #00ff00;
    color: black;
}

#preview {
    margin-top: 50px;
}

.preview-image {
    width: 100%;
    max-width: 600px;
    height: 300px;
    background-color: #111;
    background-size: cover;
    background-position: center;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00 inset;
}

/* CRT overlay for entire container */
.crt-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%),
        linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
    z-index: 2;
    background-size: 100% 4px, 4px 100%;
    pointer-events: none;
}

.crt-container::after {
    content: " ";
    display: block;
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(18,16,16,0.1);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

/* Flicker animation */
@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; }
}

/* Color separation on text */
.crt-container * {
    animation: textShadow 1.6s infinite;
}

@keyframes textShadow {
  0% { text-shadow: 0.43px 0 1px rgba(0,30,255,0.5), -0.43px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  25% { text-shadow: 1.6px 0 1px rgba(0,30,255,0.5), -1.6px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  50% { text-shadow: 0.08px 0 1px rgba(0,30,255,0.5), -0.08px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  75% { text-shadow: 1.89px 0 1px rgba(0,30,255,0.5), -1.89px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  100% { text-shadow: 0.43px 0 1px rgba(0,30,255,0.5), -0.43px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
}

/* Hide native cursor */
* {
    cursor: none !important;
}

#ui-cursor {
    position: fixed;
    width: 12px;
    height: 12px;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00 inset;
    pointer-events: none;
    border-radius: 2px;
    z-index: 99999;
    transform: translate(-50%, -50%);
}

/* LOGIN PAGE STYLES */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.login-box {
    background: rgba(0, 20, 0, 0.9);
    border: 2px solid #00ff00;
    padding: 50px;
    width: 360px;
    text-align: center;
    box-shadow: 0 0 50px #00ff00, 0 0 100px #00ff00 inset;
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
}

.login-box h2 {
    color: #00ff00;
    margin-bottom: 25px;
    text-shadow: 0 0 12px #00ff00;
    font-size: 1.6rem;
}

.login-box input {
    width: 100%;
    max-width: 320px;
    padding: 12px;
    margin: 12px auto;
    display: block;
    background: black;
    border: 1px solid #00ff00;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    font-size: 1.1rem;
    box-shadow: 0 0 8px #00ff00 inset;
}

.login-box input::placeholder {
    color: #00ff00;
    opacity: 0.7;
}

.button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin: 15px auto 0 auto;
}

.login-box .login-button {
    flex: 1;
    margin-left: 10px;
    background: black;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 12px;
    font-size: 1.1rem;
    text-shadow: 0 0 5px #00ff00;
    box-shadow: 0 0 8px #00ff00 inset;
}

.login-box .back-button {
    flex: 0 0 90px;
    background: black;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 12px;
    font-size: 1.1rem;
    text-shadow: 0 0 5px #00ff00;
    box-shadow: 0 0 8px #00ff00 inset;
}

.login-box button:hover,
.login-box .back-button:hover {
    background: #00ff00;
    color: black;
    text-shadow: none;
    cursor: pointer;
}

.login-box input:focus {
    outline: none;
    border: 1px solid #00ff00;
    box-shadow: 0 0 8px #00ff00 inset, 0 0 15px #00ff00;
}

/* PROJECT-PREVIEW (Admin) FORM */
.project-preview form {
    width: 90%;
    max-width: 700px;
    margin-top: 20px;
    text-align: left;
}

.project-preview input[type="text"],
.project-preview textarea,
.project-preview input[type="file"] {
    width: 100%;
    margin: 10px 0;
    display: block;
    padding: 6px;
    background: black;
    border: 1px solid #00ff00;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

/* File input as green button */
.project-preview input[type="file"] {
    width: auto;
    padding: 6px 12px;
    background: black;
    border: 1px solid #00ff00;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    cursor: pointer;
}

.project-preview input[type="file"]:hover {
    background: #00ff00;
    color: black;
}

.project-preview input::placeholder,
.project-preview textarea::placeholder {
    color: #00ff00;
    opacity: 0.7;
}

.project-preview input:focus,
.project-preview textarea:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

/* Admin buttons aligned with inputs */
.project-preview .button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

.project-preview .button-left {
    display: flex;
    gap: 10px;
}

.project-preview .button-right {
    display: flex;
}

.project-preview .button-left button,
.project-preview .button-right button {
    background: black;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 6px 12px;
    cursor: pointer;
    text-shadow: 0 0 5px #00ff00;
}

.project-preview .button-left button:hover,
.project-preview .button-right button:hover {
    background: #00ff00;
    color: black;
}

/* Image preview inside form (hidden border, constrained) */
#imagePreview {
    display: block;
    width: 100%;
    max-width: 600px;
    max-height: 300px;
    margin: 10px 0;
    object-fit: contain;
    box-shadow: 0 0 10px #00ff00 inset;
    border: none;
}

#imagePreview[src="#"] {
    display: none;
}

.file-btn {
    display: inline-block;
    padding: 6px 12px;
    background: black;
    color: #00ff00;
    border: 1px solid #00ff00;
    cursor: pointer;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
}

.file-btn:hover {
    background: #00ff00;
    color: black;
}


.project-item {
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
}

.project-item:hover {
    border: 1px solid #00ff00;
    background: rgba(0, 100, 0, 0.2);
}

.project-name {
    display: block;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
}

.project-desc {
    display: block;
    font-size: 0.9rem;
    color: #00ff00;
    opacity: 0.8;
    margin-top: 2px;
}

.view-project-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 8px;
    border: 1px solid #00ff00;
    color: #00ff00;
    text-decoration: none;
    font-size: 0.85rem;
    text-shadow: 0 0 5px #00ff00;
}

.view-project-btn:hover {
    background: #00ff00;
    color: black;
}

/* GLOBAL SCANLINES — MORE NOTICEABLE */
html::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 99998;

    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 255, 0, 0.09) 0px,  /* brighter line */
        rgba(0, 255, 0, 0.09) 2px,  /* thicker line */
        rgba(0, 255, 0, 0) 2px,
        rgba(0, 255, 0, 0) 4px     /* shorter dark gap */
    );

    animation: scanMove 0.9s linear infinite;
}

@keyframes scanMove {
    0% { background-position-y: 0; }
    100% { background-position-y: 4px; }
}

.welcome-panel {
    width: 100%;
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    padding: 40px;
    color: #00ff00;
    font-family: 'Courier New', monospace;

    font-size: 1.4rem;
    line-height: 1.6;

    /* Match CRT glow */
    text-shadow:
        0 0 6px #00ff00,
        0 0 12px rgba(0,255,0,0.7),
        0 0 18px rgba(0,255,0,0.4);

    /* Allow flicker + RGB separation like rest of CRT */
    animation: textShadow 1.6s infinite;
}

.welcome-panel h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;

    text-shadow:
        0 0 8px #00ff00,
        0 0 16px rgba(0,255,0,0.8),
        0 0 24px rgba(0,255,0,0.5);

    animation: textShadow 1.6s infinite;
}
