/* =====================================================
GLOBAL
===================================================== */


/* =====================================================
MAIN REGEX WORKSPACE
===================================================== */


.regex-layout{

    display:grid;

    grid-template-columns:
    500px
    1fr;

    gap:25px;

    align-items:start;

}


/* =====================================================
LEFT BUILDER
===================================================== */


.builder-panel{

    position:sticky;

    top:20px;

}


.builder-panel .card{

    max-height:
    calc(100vh - 40px);

    overflow-y:auto;

}



/* scrollbar */

.builder-panel .card::-webkit-scrollbar{

    width:6px;

}


.builder-panel .card::-webkit-scrollbar-thumb{

    background:#263859;

    border-radius:20px;

}



/* =====================================================
CARDS
===================================================== */


.card{

    background:
    linear-gradient(
        145deg,
        #151f33,
        #101827
    );


    border:

    1px solid

    rgba(255,255,255,.08);


    border-radius:18px;


    padding:24px;


    margin-bottom:20px;


    box-shadow:

    0 20px 40px rgba(0,0,0,.25);

}



.card h2{

    margin-top:0;

    margin-bottom:20px;

    font-size:20px;

    display:flex;

    align-items:center;

    gap:10px;

}



/* =====================================================
RIGHT DASHBOARD
===================================================== */


.result-panel{

    display:grid;

    grid-template-columns:

    repeat(
        2,
        minmax(300px,1fr)
    );

    gap:20px;

}



/*
Large sections
*/


.result-panel .card:first-child,
.result-panel .card:nth-last-child(2),
.result-panel .card:last-child{


    grid-column:

    span 2;


}



/* =====================================================
GENERATED REGEX
===================================================== */


#regexOutput{


    font-family:

    "JetBrains Mono",
    Consolas,
    monospace;


    font-size:22px;


    font-weight:700;


    letter-spacing:.5px;


    background:#080d17;


    color:#8fd3ff;


    padding:16px;


}




/* =====================================================
INPUTS
===================================================== */


input,
textarea,
select{


    background:#0b1220;


    border:

    1px solid rgba(255,255,255,.1);


    color:white;


    transition:.2s;


}



input:focus,
textarea:focus,
select:focus{


    outline:none;


    border-color:

    var(--accent);


    box-shadow:

    0 0 0 3px

    rgba(106,166,255,.15);

}



/* =====================================================
BUTTONS
===================================================== */


.button-row{


    display:flex;

    gap:10px;

    flex-wrap:wrap;

}


button{


    padding:

    12px 18px;


    font-weight:600;


}



button:hover{


    transform:translateY(-1px);

    filter:brightness(1.1);

}



/* =====================================================
CHECKBOX GRID
===================================================== */


.checkbox-grid{


    display:grid;

    grid-template-columns:

    repeat(2,1fr);

    gap:10px;


}


.checkbox-grid label{


    background:#0d1525;


    padding:10px;


    border-radius:10px;


    border:

    1px solid rgba(255,255,255,.05);


}



/* =====================================================
OUTPUT AREAS
===================================================== */


#validationOutput,
#matchesOutput,
#groupsOutput,
#replaceOutput,
#securityOutput,
#optimizationOutput,
#explanationOutput{


    background:#0b1220;


    border-radius:12px;


    padding:16px;


}



/* =====================================================
OPTIMIZER
===================================================== */


.optimizer-summary{


    border-radius:12px;

}



/* =====================================================
SECURITY
===================================================== */


.security-warning{


    background:#131c2d;

}



/* =====================================================
EXPLANATION
===================================================== */


.regex-explanation{


    max-height:500px;

    overflow:auto;

}

.regex-step{
    margin-bottom:15px;
}




/* =====================================================
RESPONSIVE
===================================================== */


@media(max-width:1100px){


.regex-layout{

    grid-template-columns:1fr;

}


.builder-panel{

    position:relative;

}


.builder-panel .card{

    max-height:none;

}


.result-panel{


    grid-template-columns:1fr;


}


.result-panel .card:first-child,
.result-panel .card:last-child{


    grid-column:auto;


}



}


@media(max-width:600px){


.checkbox-grid{

    grid-template-columns:1fr;

}


.card{

    padding:18px;

}


}

/* =====================================================
BUILDER TWO COLUMN
===================================================== */


.builder-two-column{


    display:grid;


    grid-template-columns:

    1fr 1fr;


    gap:20px;


    margin-top:20px;


}



.builder-column{


    background:

    rgba(255,255,255,.03);


    border:

    1px solid rgba(255,255,255,.08);


    border-radius:14px;


    padding:15px;


}



.builder-column h3{


    margin-top:0;


    font-size:16px;


    color:#dbe8ff;


}



/* checkbox inside columns */


.builder-column .checkbox-grid{


    grid-template-columns:

    1fr;


}



.builder-column label{


    display:flex;


    align-items:center;


    gap:8px;


}



.builder-column input[type="checkbox"]{

    width:18px;

    height:18px;

    flex-shrink:0;

}




@media(max-width:900px){


.builder-two-column{


    grid-template-columns:1fr;


}


}

.form-group input,select {
    margin-bottom: 15px;
}

/* =====================================================
FIX CHECKBOX ALIGNMENT
===================================================== */


input[type="checkbox"]{

    width:18px;
    
    height:18px;

    margin:0;

    flex-shrink:0;

    cursor:pointer;

}


.builder-column label,
.checkbox-grid label{

    display:flex;

    align-items:center;

    gap:10px;

    cursor:pointer;

    line-height:1.3;

}


/* Prevent checkbox labels from stretching */

.checkbox-grid label input[type="checkbox"]{

    width:18px;

    height:18px;

}

/* =====================================================
ALIGN BUILDER TWO COLUMNS
===================================================== */


.builder-two-column{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:20px;

    align-items:stretch;

}


.builder-column{

    display:flex;

    flex-direction:column;

}


/* Make checkbox areas equal alignment */

.builder-column .checkbox-grid{

    display:grid;

    grid-template-columns:1fr;

    gap:10px;

}


/* Equal checkbox item height */

.builder-column .checkbox-grid label{

    min-height:42px;

    display:flex;

    align-items:center;

}

.empty-checkbox{

    visibility:hidden;

    pointer-events:none;

}

/* =====================================================
REGEX HISTORY
===================================================== */

.regex-history-wrapper{

    max-height:420px;

    overflow-y:auto;

    overflow-x:auto;

    border:1px solid rgba(255,255,255,.08);

    border-radius:12px;

    background:#0b1220;

}

/* Scrollbar */

.regex-history-wrapper::-webkit-scrollbar{

    width:8px;

    height:8px;

}

.regex-history-wrapper::-webkit-scrollbar-thumb{

    background:#2d4368;

    border-radius:20px;

}

/* Table */

.regex-history-table{

    width:100%;

    border-collapse:collapse;

    border-spacing:0;

    background:transparent;

    color:#fff;

    font-size:14px;

}

/* Header */

.regex-history-table thead th{

    position:sticky;

    top:0;

    z-index:5;

    background:#101827;

    color:#dbe8ff;

    padding:12px;

    text-align:left;

    border-bottom:1px solid rgba(255,255,255,.05);

}

/* Cells */

.regex-history-table td{

    padding:12px;

    text-align:left;

    vertical-align:top;

    background:transparent;

    border-bottom:1px solid rgba(255,255,255,.03);

}

/* Rows */

.regex-history-table tbody tr{

    background:transparent;

}

.regex-history-table tbody tr:hover{

    background:transparent;

}

/* Pattern */

.regex-history-table code{

    display:block;

    font-family:

    "JetBrains Mono",
    Consolas,
    monospace;

    color:#8fd3ff;

    background:none;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

    max-width:420px;

}

/* Actions */

.history-actions{

    white-space:nowrap;

    padding-right:16px;

}

.history-actions button{

    margin-right:8px;

    margin-bottom:4px;

    padding:6px 10px;

    font-size:12px;

}

.history-actions button:last-child{

    margin-right:0;

}

/* Footer */

.history-footer{

    margin-top:15px;

    text-align:right;

}

/* Empty */

.history-empty{

    padding:25px;

    text-align:center;

    color:#9aa8bc;

}

    /* ==========================================
   Regex Cheat Sheet
========================================== */

.table-responsive{

    overflow-x:auto;
    margin-top:35px;

}

.seo-table th,
.seo-table td{

    border: 1px solid #edf2f7;

}

.seo-table{

    width:100%;
    border-collapse:separate;
    border:1px solid #e5e7eb;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 6px 18px rgba(0,0,0,.05);

}

.seo-table thead{

    background:linear-gradient(135deg,#2563eb,#3b82f6);
    color:#fff;

}

.seo-table thead th:first-child{

    border-top-left-radius:14px;

}

.seo-table thead th:last-child{

    border-top-right-radius:14px;

}

.seo-table tbody tr:last-child td:first-child{

    border-bottom-left-radius:14px;

}

.seo-table tbody tr:last-child td:last-child{

    border-bottom-right-radius:14px;

}

.seo-table th{

    padding:18px 22px;
    text-align:left;
    font-size:15px;
    font-weight:700;
    letter-spacing:.3px;

}

.seo-table td{

    padding:16px 22px;
    border-bottom:1px solid #edf2f7;
    vertical-align:middle;
    font-size:15px;
    color:#edf2f7;

}

.seo-table tbody tr{

    transition:.25s;

}

.seo-table tbody tr:last-child td{

    border-bottom:none;

}

/* Regex token */

.seo-table code{

    display:inline-block;
    min-width:58px;
    text-align:center;

    padding:7px 12px;

    background:#eef4ff;
    color:#2563eb;

    border:1px solid #c7dbff;

    border-radius:8px;

    font-family:Consolas, Monaco, monospace;
    font-size:14px;
    font-weight:700;

}

/* Responsive */

@media (max-width:768px){

    .seo-table th,
    .seo-table td{

        padding:14px;

        font-size:14px;

    }

    .seo-table code{

        min-width:48px;
        font-size:13px;

    }

}