@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Chelsea+Market&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: grid;
    grid-template-rows: 65px 1fr 65px;
    background: #121212;
    color: #e0e0e0;
    width: 100vw;
    height: 100vh;
    height: 100svh; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    position: relative;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: #1a1a1a;
    border-bottom: 1px solid #2d2d2d;
    z-index: 10;
}

#logo { font-family: "Black Ops One", sans-serif; font-size: 1.6rem; color: #ffffff; letter-spacing: 0.5px; cursor: none; }
#logo span { font-family: "Chelsea Market", sans-serif; color: #929292; cursor: none; }

#right { display: flex; gap: 8px; align-items: center; }
.nav-item {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #aaaaaa;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-item:hover, .nav-item.active {
    color: #fff;
    background: #2a2a2a;
}
.nav-item.active { 
    color: #0084ff;
    background: rgba(0, 132, 255, 0.1);
}

#info-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    outline: none;
}
#info-btn:hover {
    color: #0084ff;
    transform: scale(1.08);
}

main {
    min-height: 0;
    overflow: hidden;
    background: #0f0f0f;
    position: relative;
}

.content-pane {
    display: none;
    width: 100%;
    height: 100%;
}
.content-pane.active { display: flex; flex-direction: column; }

#chatbox {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.leftai, .rightuser { max-width: 85%; display: flex; flex-direction: column; }
.leftai { align-self: flex-start; }
.rightuser { align-self: flex-end; }
.leftai span, .rightuser span {
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-break: break-word;
}
.leftai span { background: #222; color: #e5e5e5; border-bottom-left-radius: 2px; border: 1px solid #2d2d2d; }
.rightuser span { background: #0084ff; color: #fff; border-bottom-right-radius: 2px; }

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
    padding: 8px 15px;
    border-bottom: 1px solid #2d2d2d;
}
#detected-lang { font-size: 0.85rem; color: #888; font-family: monospace; }
#code-display {
    flex: 1;
    background: #151515;
    color: #cbcccf;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    padding: 15px;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.6;
}
.buttons button {
    background: #2a2a2a;
    color: white;
    border: none;
    padding: 6px 12px;
    margin-left: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}
.buttons button:hover { background: #3a3a3a; }
#run-btn { background: #1e7e34; }
#run-btn:hover { background: #218838; }

#preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

footer {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #1a1a1a;
    border-top: 1px solid #2d2d2d;
    z-index: 10;
}
.input-container {
    display: flex;
    width: 100%;
    background: #262626;
    border-radius: 10px;
    padding: 2px 6px 2px 12px;
    align-items: center;
    border: 1px solid #333;
}
footer input {
    flex: 1;
    height: 40px;
    border: none;
    background: transparent;
    color: white;
    font-size: 0.95rem;
    outline: none;
}
footer button {
    height: 34px;
    width: 38px;
    border: none;
    border-radius: 8px;
    background: #0084ff;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
footer button:hover { background: #0073dd; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.modal-overlay.open {
    display: flex;
    opacity: 1;
}
.modal-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 16px;
    width: 90%;
    max-width: 340px;
    padding: 30px 20px 20px 20px;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.85);
    transition: transform 0.25s ease;
}
.modal-overlay.open .modal-card {
    transform: scale(1);
}
#modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
}
#modal-close:hover { color: #fff; }

.info-icon {
    font-size: 3rem;
    color: #0084ff;
    margin-bottom: 12px;
}
.modal-body h2 {
    font-family: "Black Ops One", sans-serif;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 15px;
}
.modal-body h2 span {
    font-family: "Chelsea Market", sans-serif;
    color: #0084ff;
}
.dev-tag {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.dev-name {
    font-size: 1.4rem;
    color: #00ff88;
    margin-top: 4px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.modal-footer-line {
    font-size: 0.75rem;
    color: #555;
    border-top: 1px solid #2a2a2a;
    padding-top: 12px;
}

@media (max-width: 600px) {
    body { grid-template-rows: 60px 1fr 60px; }
    header { padding: 0 10px; }
    #logo { font-size: 1.3rem; }
    #right { gap: 4px; }
    .nav-item { padding: 6px 8px; font-size: 0.85rem; }
    .nav-item span { display: none; }
    .nav-item i { font-size: 1.1rem; }
    #info-btn { font-size: 1.25rem; padding: 4px 6px; }
    .leftai, .rightuser { max-width: 90%; }
    footer { padding: 8px 10px; }
}
