/*
 * Styles for the Sysad Styler plugin
 * Version 8.3 (Info Box Color Update)
 */

/* ============================================= */
/* == Technology Pills Styles                 == */
/* ============================================= */

.tech-container {
    background-color: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 15px 20px 25px;
    margin-top: 2em;
    margin-bottom: 2em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tech-container h1,
.tech-container h2,
.tech-container h3,
.tech-container h4,
.tech-container h5,
.tech-container h6 {
    margin-top: 0 !important;
    margin-bottom: 30px;
}

.tech-container .tech-pills-wrapper {
    text-align: center;
}

.tech-container .tech-pill {
    display: inline-block;
    background-color: #28a745;
    color: #ffffff;
    padding: 10px 22px;
    margin: 6px 5px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}

.tech-container .tech-pill:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tech-container .tech-pill.pill-style-blue {
    background-color: #e0f2fe;
    color: #0369a1;
}

.tech-container .tech-pill.pill-style-blue:hover {
    box-shadow: 0 4px 8px rgba(0, 91, 150, 0.1);
}

/* ============================================= */
/* == Before/After Diagram Styles             == */
/* ============================================= */

.diagram-box {
    border: 1px solid;
    border-left-width: 5px;
    border-radius: 8px;
    padding: 20px;
    margin: 2em 0;
    overflow: hidden;
}

.diagram-box.diagram-before {
    background-color: #fff6f6;
    border-color: #fecaca;
    border-left-color: #e57373;
}

.diagram-box.diagram-before h2 {
    color: #374151;
    margin-top: 0;
}

.diagram-box.diagram-after {
    background-color: #f0fdf6;
    border-color: #bbf7d0;
    border-left-color: #2fbf71;
}

.diagram-box.diagram-after h2 {
    color: #166534;
    margin-top: 0;
}

.diagram-box .sysad-diagram-content {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    margin: 20px 0;
    white-space: pre !important;
}

.diagram-box .sysad-diagram-content code {
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.4;
    color: #000;
    background: none;
    border: none;
    padding: 0;
    font-size: 1em;
    white-space: inherit !important;
}


/* ============================================= */
/* == Content Blocks (Info, Threat, Table)    == */
/* ============================================= */

/* --- Info Box Style --- */
.sysad-info-box {
    background-color: #f0fdf6; /* Lighter green to match new border */
    border: 1px solid #bbf7d0;
    border-left-width: 5px;
    /* V-- THIS IS THE ONLY LINE THAT CHANGED --V */
    border-left-color: #2fbf71;
    border-radius: 4px;
    padding: 15px 20px;
    margin: 2em 0;
    color: #334155;
}

.sysad-info-box p {
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* --- Threat Scenario Style --- */
.sysad-threat-scenario {
    border-left: 3px solid #d1d5db;
    padding-left: 20px;
    margin: 2em 0 2em 20px;
    color: #4b5563;
}

.sysad-threat-scenario p {
    margin: 0;
    padding: 0;
}

.sysad-threat-scenario strong {
    color: #111827;
}


/* --- Styled Table --- */
.sysad-styled-table-wrapper {
    margin: 2em 0;
    overflow-x: auto;
    border: 1px solid #dee2e6;
}

.sysad-styled-table-wrapper table.sysad-styled-table,
table.sysad-styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.sysad-styled-table-wrapper table.sysad-styled-table th,
.sysad-styled-table-wrapper table.sysad-styled-table td,
table.sysad-styled-table th,
table.sysad-styled-table td {
    padding: 12px 16px;
    text-align: left;
    line-height: 1.6;
    vertical-align: top;
    border: none;
}

/* --- Table Header --- */
.sysad-styled-table-wrapper table.sysad-styled-table thead th,
table.sysad-styled-table thead th {
    background-color: #0078D4;
    color: #ffffff;
    font-weight: 600;
    border-right: 1px solid #ffffff;
}

.sysad-styled-table-wrapper table.sysad-styled-table thead th:last-child,
table.sysad-styled-table thead th:last-child {
    border-right: none;
}

/* --- Table Body --- */
.sysad-styled-table-wrapper table.sysad-styled-table tbody tr,
table.sysad-styled-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.sysad-styled-table-wrapper table.sysad-styled-table tbody tr:last-of-type,
table.sysad-styled-table tbody tr:last-of-type {
    border-bottom: none;
}

.sysad-styled-table-wrapper table.sysad-styled-table tbody td,
table.sysad-styled-table tbody td {
    color: #4b5563;
    border-right: 1px solid #dee2e6;
}

.sysad-styled-table-wrapper table.sysad-styled-table tbody td:last-child,
table.sysad-styled-table tbody td:last-child {
    border-right: none;
}

.sysad-styled-table-wrapper table.sysad-styled-table tbody td:first-child,
table.sysad-styled-table tbody td:first-child {
    font-weight: bold;
    color: #111827;
}

/* ========================================================== */
/* == STYLES FOR A BETTER BACKEND (TINYMCE) EDITING EXPERIENCE == */
/* ========================================================== */
/* 
 * This first rule makes our custom table full-width inside the editor,
 * just like a default WordPress table, for a true WYSIWYG feel.
 */
.mce-content-body .sysad-styled-table {
    width: 100% !important; 
    margin-bottom: 1.5em;
    border-collapse: collapse; /* Ensures borders look clean in the editor */
}

/*
 * CRITICAL FIX FOR EDITING:
 * Make the table and its cells have a visible border INSIDE THE EDITOR ONLY.
 * This allows TinyMCE's table tools to recognize and interact with the 
 * table, making it fully clickable and editable. These borders will NOT 
 * appear on your live website.
 */
.mce-content-body .sysad-styled-table th,
.mce-content-body .sysad-styled-table td {
    border: 1px dashed #cccccc;
}

/* ============================================= */
/* == RESPONSIVE FIX FOR STYLED TABLE         == */
/* ============================================= */

/*
 * On screens smaller than 768px (tablets and phones), this media query activates.
 * It ensures that our styled table becomes horizontally scrollable instead of
 * squishing its content and breaking the layout.
 */
@media screen and (max-width: 768px) {
    
    /* 
     * The wrapper (.sysad-styled-table-wrapper) already has 'overflow-x: auto'.
     * We need to force the table inside it to actually be wider than the screen.
     * Setting a min-width achieves this. The table will try to be at least 700px
     * wide, which is wider than most phone screens, thus triggering the scrollbar.
     */
    .sysad-styled-table-wrapper table.sysad-styled-table {
        min-width: 700px;
    }
    
}