/* =========================
   BASE GLOBALE
========================= */

* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 12px;
    background: linear-gradient(to bottom, #e6e6ff 0%, #d6d6ff 45%, #ccccff 100%);
}

#app {
    width: 100%;
    margin: 0 auto;
}

/* =========================
   HEADER
========================= */

.head {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#delim {
    text-align: center;
}

#regex {
    max-width: 100%;
    height: auto;
}

#author {
    color: blue;
    font-size: 0.85rem;
}

/* =========================
   REGEX INPUT
========================= */

.row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.label {
    font-size: 1.6rem;
    color: blue;
    white-space: nowrap;
}

input[type='text'] {
    flex: 1;
    min-width: 0;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid blue;
}

/* =========================
   FLAGS
========================= */

#ma-div {
    width: 100%;
    text-align: left;
}

#ma-div label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 5px;
}

#ma-div input[type="radio"] {
    margin-top: 3px;
}

.flags-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.flags-title {
    color: green;
}

/* =========================
   WORKZONE
========================= */

.workzone {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.left,
.right {
    width: 100%;
}

/* =========================
   TEXTAREA & RESULTS
========================= */

textarea {
    width: 100%;
    min-height: 220px;
    margin-top: 10px;
    font-weight: bold;
    resize: none;
    overflow-y: hidden;
}

textarea::placeholder {
    color: #000;
    opacity: 0.5;
    font-weight: bold;
}

#results {
    min-height: 220px;
    padding: 10px;
    border: 2px solid red;
    background-color: #ffe5e7;
    overflow-x: auto;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.line {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.4;
}

/* =========================
   BUTTONS
========================= */

.center {
    text-align: center;
    margin-top: 12px;
}

button,
.reset-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

.reset-btn {
    border: 1px solid #444;
    background: #333;
    color: yellow;
    text-decoration: none;
    border-radius: 4px;
}

/* =========================
   HIGHLIGHTS
========================= */

.match {
    color: red;
    background-color: yellow;
    font-weight: bold;
}

.mode {
    color: red;
}

.mode-bold {
    color: red;
    font-weight: bold;
}

/* =========================
   DESKTOP ≥ 600px
========================= */

@media (min-width: 600px) {

    body {
        padding: 20px;
    }

    .center {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    .flags-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .workzone {
        flex-direction: row;
    }

    .label {
        font-size: 2.2rem;
    }

    textarea {
        min-height: 300px;
    }

    #results {
        min-height: 300px;
        margin-top: 10px;
    }

}

