@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Share Tech Mono', monospace;
    color: #ccc;
}

body {
    background: #000;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s;
    word-wrap: break-word;         /* ✅ Fix long text overflow */
    overflow-wrap: anywhere;       /* ✅ Ensures long strings wrap */
}

/* --- Full-screen page transition overlay --- */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    border: 4px solid #ff4444;
    box-shadow: 0 0 20px #ff4444, inset 0 0 20px #ff4444;
    opacity: 0;
    transition: opacity 0.3s;
}

.transition-overlay.active {
    animation: screenBorderPulse 0.8s ease-in-out forwards;
}

@keyframes screenBorderPulse {
    0%   { opacity: 1; transform: scale(1); }
    30%  { box-shadow: 0 0 60px #ff4444, inset 0 0 40px #ff4444; transform: scale(1.02); }
    60%  { box-shadow: 0 0 120px #ff4444, inset 0 0 80px #ff4444; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(0.95); }
}

/* Links */
a {
    text-decoration: none;
    color: #ff4444;
    transition: 0.3s;
    z-index: 1;
    position: relative;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 3px #ff4444, 0 0 6px #ff4444;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px;
    position: relative;
    z-index: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Headings */
h1, h2, h3 {
    color: #eee;
    text-shadow: 0 0 1px #ff4444, 0 0 3px #ff4444;
}

/* Buttons */
button.custom-btn {
    background: transparent;
    border: 2px solid #ff4444;
    padding: 10px 20px;
    color: #eee;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

button.custom-btn:hover {
    background: #ff4444;
    color: #000;
    box-shadow: 0 0 8px #ff4444;
    transform: scale(1.05);
}

button.custom-btn::after {
    content: '';
    position: absolute;
    top:50%;
    left:50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%,-50%);
    transition: width 0.3s, height 0.3s;
}

button.custom-btn:hover::after {
    width: 200%;
    height: 500%;
}

/* Terminal windows */
.terminal-window {
    background: #111;
    border: 1px solid #ff4444;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 0 8px #ff4444;
    min-height: 200px;
    font-family: 'Share Tech Mono', monospace;
    color: #eee;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    transition: box-shadow 0.2s ease-in-out;
    word-wrap: break-word;      /* ✅ wrap inside terminals */
    overflow-wrap: anywhere;
}

.terminal-window.active {
    box-shadow: 0 0 20px #ff4444, 0 0 15px #ff4444 inset;
}

.terminal-window.typing {
    box-shadow: 0 0 30px #ff4444, 0 0 20px #ff4444 inset;
}

/* Blinking cursor */
.terminal-cursor {
    display: inline-block;
    width: 8px;
    background: #ff4444;
    margin-left: 2px;
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% { background: transparent; }
}

input.terminal-input {
    background: transparent;
    border: none;
    color: #eee;
    outline: none;
    width: 100%;
    font-family: 'Share Tech Mono', monospace;
}

/* Project cards */
.project-card {
    background: #111;
    border: 1px solid #ff4444;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 0 8px #ff4444;
    transition: transform 0.3s;
    word-wrap: break-word;      /* ✅ wrap inside project cards */
    overflow-wrap: anywhere;
}

.project-card:hover {
    transform: translateY(-5px);
}

/* --- Chat Styling --- */
.chat-window {
    background: #111;
    border: 1px solid #ff4444;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 8px #ff4444;
    word-wrap: break-word;      /* ✅ wrap chat text */
    overflow-wrap: anywhere;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    color: #eee;
    font-family: 'Share Tech Mono', monospace;
}

.chat-message {
    padding: 5px 8px;
    margin: 3px 0;
    border-radius: 5px;
    background: rgba(255,68,68,0.2);
    transition: background 2s ease;
}

.chat-message.recent {
    background: rgba(255,68,68,0.8);
}

.chat-message.new {
    background: rgba(255,68,68,0.5);
}

.chat-message.self {
    background: rgba(255,68,68,0.8);
    align-self: flex-end;
}

.chat-message-time {
    display: block;
    font-size: 11px;
    color: #9a9a9a;
    margin-top: 6px;
    text-align: right;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    background: transparent;
    border: 1px solid #ff4444;
    border-radius: 5px;
    padding: 10px;
    color: #eee;
    font-family: 'Share Tech Mono', monospace;
    outline: none;
}

#chatInput:focus {
    box-shadow: 0 0 10px #ff4444;
}

/* Floating login modal */
.login-modal {
    position: fixed;
    top:0;
    left:0;
    width:100vw;
    height:100vh;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-content {
    background: #111;
    border: 2px solid #ff4444;
    padding: 30px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 300px;
}

.login-content input {
    padding: 10px;
    border: 1px solid #ff4444;
    border-radius: 5px;
    background: transparent;
    color: #eee;
    font-family: 'Share Tech Mono', monospace;
}

.login-content input:focus {
    outline:none;
    box-shadow: 0 0 10px #ff4444;
}

.chat-username {
  font-weight: 600;
  color: #8ef;
  font-size: 0.9em;
  margin-bottom: 2px;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .container {
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    h2 {
        font-size: 1.4rem;
        text-align: center;
    }

    p, a, input, button {
        font-size: 0.95rem;
    }

    .project-card, .terminal-window, .chat-window {
        padding: 15px;
        margin: 15px 0;
    }

    .chat-window {
        height: 300px;
    }

    .chat-input-container {
        flex-direction: column;
    }

    #chatInput {
        width: 100%;
    }

    /* ✅ Horizontal nav only on mobile */
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }

    nav a {
        display: inline-block;
        margin: 0 8px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .project-card, .terminal-window, .chat-window {
        padding: 12px;
    }

    .chat-window {
        height: 250px;
    }

    button.custom-btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 8px;
    }

    .login-content {
        width: 90%;
        min-width: unset;
        padding: 20px;
    }

    input, #chatInput {
        font-size: 0.9rem;
        padding: 8px;
    }
}

/* --- Live Stream Window --- */
.stream-window {
    background: #111;
    border: 1px solid #ff4444;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 0 8px #ff4444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
}

.stream-window:hover {
    box-shadow: 0 0 20px #ff4444, 0 0 15px #ff4444 inset;
    transform: translateY(-3px);
}

.stream-title {
    color: #eee;
    text-shadow: 0 0 3px #ff4444, 0 0 6px #ff4444;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 1px;
}

video.stream-player {
    width: 100%;
    max-width: 900px;
    border: 2px solid #ff4444;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 0 12px #ff4444;
    transition: box-shadow 0.3s, transform 0.3s;
}

video.stream-player:hover {
    box-shadow: 0 0 20px #ff4444, 0 0 10px #ff4444 inset;
    transform: scale(1.02);
}

/* --- Responsive stream adjustments --- */
@media (max-width: 768px) {
    .stream-window {
        padding: 15px;
    }

    .stream-title {
        font-size: 1rem;
    }

    video.stream-player {
        max-width: 100%;
    }
}
