/* styles.css */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
}

h1 {
    margin-bottom: 10px;
    text-align: center;
    font-size: 28px;
}

#container {
    display: flex;
    gap: 20px;
}

/* Left column (crib sheet) */
#crib {
    width: 60%;
    background: white;
    padding: 15px;
    border-radius: 8px;
    overflow: auto;
    transition: width 0.3s, opacity 0.3s;
    opacity: 1;
}

#crib.closed {
    width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    border-bottom: 1px solid #ddd;
    padding: 8px 6px;
}

th {
    background: #eee;
}

.status-ok {
    color: green;
    font-weight: bold;
}

.status-fail {
    color: red;
    font-weight: bold;
}

/* Right column (stack builder) */
#stack-ui {
    width: 40%;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

#stack-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

#stack-list li {
    padding: 8px;
    background: #e8e8e8;
    margin: 6px 0;
    border-radius: 6px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove {
    cursor: pointer;
    color: #900;
    font-weight: bold;
}

#add-layer {
    margin-top: 10px;
}

button {
    margin-top: 20px;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
}

#preview-wrapper {
    display: flex;
    margin-top: 20px;
}

#preview-wrapper>div {
    flex: 1;
    padding: 10px;
    background: #f0f0f0;
    min-height: 50px;
}

#create-experiment-section {
    margin-bottom: 20px;
}

#experiment-prompt,
#experiment-plaintext,
#encode-input,
#decode-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

#experiment-status {
    margin-top: 10px;
    color: green;
}

#encode-output,
#decode-output {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 30px;
}

#copy-encoded,
#copy-decoded {
    margin-left: 10px;
}

#create-experiment-section>div[style*="flex-direction: row"] {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}



@media (max-width: 768px) {
    #container {
        flex-direction: column;
        gap: 15px;
    }

    #toggle-crib {
        width: 100%;
        padding: 14px;
        font-size: 18px;
        background: #333;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
    }

    #crib,
    #stack-ui {
        width: 100% !important;
        box-sizing: border-box;
    }

    #crib {
        max-height: 80vh;
        /* limits crib height on small screens */
        transition: max-height 0.45s ease, opacity 0.3s ease;
        opacity: 1;
    }

    #crib.closed {
        max-height: 0 !important;
        opacity: 0;
        overflow: hidden;
        padding: 0 !important;
        margin: 0 !important;
        pointer-events: none;
    }

    #preview-wrapper {
        flex-direction: column;
    }

    #preview-wrapper>div {
        margin-bottom: 12px;
        min-height: 60px;
    }

    /* Make buttons and inputs more touch-friendly */
    button,
    input,
    textarea,
    select {
        font-size: 16px !important;
        /* prevents iOS zoom */
        min-height: 48px;
    }

    #stack-list li {
        padding: 12px;
        font-size: 16px;
    }
}