/* Retro Terminal Styling */
:root {
    --bg-color: #000000;
    --text-color: #00ff41;
    /* Matrix Green */
    --accent-color: #008f11;
    --dim-color: #003b00;
    --crt-flicker: 0.05;
}

@font-face {
    font-family: 'VT323';
    src: url('https://fonts.gstatic.com/s/vt323/v17/pxiKyp0ihIEF2isRFJ4.woff2') format('woff2');
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'VT323', 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
    text-shadow: 0 0 5px var(--accent-color);
}

/* CRT Scanline Overlay */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 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: 999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #050505;
    border-right: 2px solid var(--text-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    box-shadow: inset -5px 0 15px rgba(0, 255, 65, 0.1);
}

.back-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: block;
    text-transform: uppercase;
    border: 1px solid transparent;
    padding: 5px;
}

.back-link:hover {
    background-color: var(--text-color);
    color: black;
    text-shadow: none;
    box-shadow: 0 0 10px var(--text-color);
}

.user-profile {
    margin-top: auto;
    border-top: 2px solid var(--dim-color);
    padding-top: 20px;
}

#user-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 0;
    /* Square for retro feel */
    border: 2px solid var(--text-color);
    filter: grayscale(100%) sepia(100%) hue-rotate(90deg) saturate(300%);
    /* Green tint */
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-label {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-transform: uppercase;
}

input[type="text"] {
    background: #000;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 8px;
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
    box-shadow: 0 0 5px var(--dim-color);
}

input[type="text"]:focus {
    box-shadow: 0 0 10px var(--text-color);
}

button {
    background: #000;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
    box-shadow: 0 0 5px var(--dim-color);
}

button:hover:not(:disabled) {
    background: var(--text-color);
    color: black;
    box-shadow: 0 0 15px var(--text-color);
    text-shadow: none;
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--dim-color);
    color: var(--dim-color);
    box-shadow: none;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Slides Section */
.slides-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--text-color);
    padding: 20px;
    position: relative;
}

.slides-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--dim-color);
    padding-bottom: 10px;
}

h2 {
    margin: 0;
    border: none;
    filter: contrast(1.1) brightness(0.9);
    /* Slight retro adjustment */
}

#no-slides-placeholder {
    position: absolute;
    text-align: center;
    color: var(--dim-color);
    font-size: 1.5rem;
    text-transform: uppercase;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.controls {
    display: flex;
    gap: 10px;
}

#slide-url-input {
    width: 300px;
}

/* Chat Section */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #000;
}

.chat-header {
    padding: 15px;
    border-bottom: 2px solid var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #050505;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 1.1rem;
}

.message {
    padding: 5px 0;
    border-bottom: 1px dotted var(--dim-color);
    word-wrap: break-word;
    line-height: 1.4;
}

.message.self {
    color: #ccffcc;
    /* Slightly brighter for self */
}

.message.system {
    color: var(--accent-color);
    font-style: italic;
    border: 1px solid var(--dim-color);
    padding: 10px;
    text-align: center;
}

.message-author {
    font-weight: bold;
    color: var(--text-color);
    margin-right: 10px;
}

.message-author::after {
    content: ">";
    margin-left: 5px;
}

.chat-input-area {
    padding: 15px;
    border-top: 2px solid var(--text-color);
    display: flex;
    gap: 10px;
    background-color: #050505;
}

#message-input {
    flex: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    background: #000;
}

::-webkit-scrollbar-track {
    border-left: 1px solid var(--dim-color);
}

::-webkit-scrollbar-thumb {
    background: var(--dim-color);
    border: 1px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        border-right: none;
        border-bottom: 2px solid var(--text-color);
    }

    .user-profile {
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }

    .main-content {
        flex-direction: column;
        height: auto;
    }

    .slides-container {
        height: 50vh;
        border-right: none;
        border-bottom: 2px solid var(--text-color);
    }

    .chat-container {
        height: 50vh;
    }
}