@font-face {font-family: 'Raleway'; font-style: normal; font-weight: 400;src: local('Raleway Regular'), local('Raleway-Regular'), url('fonts/Raleway-Regular.ttf') format('truetype');}
@font-face {font-family: 'Raleway'; font-style: normal; font-weight: 500; src: local('Raleway Medium'), local('Raleway-Medium'), url('fonts/Raleway-Medium.ttf') format('truetype');}
@font-face {font-family: 'Raleway'; font-style: normal; font-weight: 700; src: local('Raleway Bold'), local('Raleway-Bold'),url('fonts/Raleway-Bold.ttf') format('truetype');}
:root {
    --font-family: 'Raleway', sans-serif;
    --primary-color: #007bff;
    --primary-color-hover: #0056b3;
    --danger-color: #dc3545;
    --danger-color-hover: #c82333;
    --success-color: #28a745;
    --success-color-hover: #218838;
    --bg-main: #f4f7f9;
    --bg-column: #ffffff;
    --bg-controls: #fdfdfd;
    --bg-editor: #f8f9fa;
    --text-color: #333;
    --text-light: #555;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --color-copy: #0d6efd;
    --color-copy-hover: #0b5ed7;
    --color-reverse: #e71212;
    --color-reverse-hover: #a10b0b; 
    --color-reverse-disabled: #918e8e;
    --color-clean: #198754;
    --color-clean-hover: #157347;
}
* {box-sizing: border-box;}
body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-main);
    color: var(--text-color);
    font-size: 16px;
    font-weight: 400;
}
.main-container {
    display: flex;
    gap: 20px; 
    max-width: 100%; 
}
.column {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column; 
}
.column-left {flex: 1; }
.column-right {flex: 1; }
.column-full {
    max-width: 100%;
    display: flex;
    gap: 20px; 
}
.column-right textarea#outputHtml {
    height: 400px; 
    background-color: #e9e9e9;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: normal;
    overflow-x: auto;
}
h1, h2 {color: #333; margin-top: 0;}
h1 {text-align: center; margin-bottom: 20px;}
h2 {
    margin-top: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    font-size: 1.2em;
    text-align: center;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
.tox-tinymce {
    flex-grow: 1;
    min-height: 400px; 
    border: 1px solid #ddd; 
}
.controls {
    margin-top: 20px; 
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: inline-block;
    width: 42%;
}
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 10px 15px;
    margin-bottom:15px;
}
.options-grid label {
    font-weight: normal;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}
.options-grid input[type="checkbox"] {margin-right: 8px;}
.options-grid .option-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    grid-column: 1 / -1;
}
.options-grid .option-item label {
    font-weight: bold;
    margin-bottom: 0;         
    white-space: nowrap;      
    flex-shrink: 0;
}
.options-grid .option-item select {
    width: 100%;
    padding: 6px 8px;         
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;     
    box-sizing: border-box;
}
#divHandlingOption{width: 50%;}
.find-replace-section {margin-top: 15px;}
#findReplacePairsContainer {
    display: flex;
    flex-direction: column; 
    gap: 8px; 
}
#findReplacePairsContainer .find-replace-pair {
    display: flex;
    gap: 8px; 
    align-items: center;
}
#findReplacePairsContainer .find-replace-pair input[type="text"] {
    flex-grow: 1;
    padding: 6px; 
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}
.delete-pair-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em; 
    line-height: 1;
    font-weight: bold;
}
.delete-pair-button:hover { background-color: #c82333; }
#addFindReplacePairButton {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
#addFindReplacePairButton:hover { background-color: #218838; }
.main-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
    align-items: center;
}
#addDomainToReplaceButton
 {
    background-color: #1c3eff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
.action-btn {
    font-family: inherit;
    font-size: 14px;
    background: var(--primary-color, #007bff);
    color: white;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 20px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-out;
    font-weight: 500;
    cursor: pointer;
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.15);
    background-color: var(--primary-color-hover, #0056b3);
}
.action-btn:active {transform: scale(0.95); box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
}
.action-btn:disabled {
    background: #b8c1c9;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
    opacity: 0.7;
}
.action-btn span {display: block; line-height: 1;}
.action-btn img.icon {width: 16px; height: 16px;}
.action-btn .svg-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    margin-right: 10px;
    transition: background-color 0.3s;
}
.action-btn:hover .svg-wrapper {background-color: rgba(255, 255, 255, 0.35);}
button,
select,
input {font-family: var(--font-family);}
.action-btn.btn-copy { background-color: var(--color-copy); }
.action-btn.btn-copy:hover { background-color: var(--color-copy-hover); }
.action-btn.btn-reverse { background-color: var(--color-reverse); }
.action-btn.btn-reverse:hover { background-color: var(--color-reverse-hover); }
.action-btn.btn-reverse:disabled { background-color: var(--color-reverse-disabled); }
.action-btn.btn-clean { background-color: var(--color-clean); }
.action-btn.btn-clean:hover { background-color: var(--color-clean-hover); }
#undoButton {margin-right: auto;}
body .tox.tox-tinymce { margin-bottom: 0; }
.style-controls{
    margin-top: 20px; 
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: inline-block;
    width: 25%;
}
.style-controls h2{margin-top: 0;}
.findandreplace{
    margin-top: 20px; 
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: inline-block;
    width: 33%;
}
.findandreplace h2{margin-top: 0;}
.controls h2{margin-top:0;}
.custom-style-rule {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.custom-style-rule input[type="text"] {
    flex-grow: 1;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}
.delete-style-rule-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    font-weight: bold;
}
.delete-style-rule-button:hover { background-color: #c82333;}
#addCustomStyleRuleButton {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
#addCustomStyleRuleButton:hover {background-color: #218838;}
#addFindReplacePairButton.action-btn-small {
    font-family: inherit;
    font-size: 13px;
    color: white;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-out;
}
#addFindReplacePairButton.action-btn-small img.icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    filter: brightness(0) invert(1);
}
#addDomainToReplaceButton.action-btn-small {
    font-family: inherit;
    font-size: 13px;
    color: white;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-out;
}
#addDomainToReplaceButton.action-btn-small img.icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    filter: brightness(0) invert(1);
}
.btn-add {background-color: var(--success-color, #28a745);}
.btn-add:hover {background-color: var(--success-color-hover, #218838);}
.delete-pair-button {
    background-color: var(--danger-color, #dc3545);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.delete-pair-button:hover {background-color: var(--danger-color-hover, #c82333);}
.delete-pair-button .icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}
.checkbox-label {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 1em;
    font-weight: 400;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    gap: 10px;
}
.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkbox-label .checkmark {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary-color, #007bff);
    border-color: var(--primary-color, #007bff);
}
.checkbox-label .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}
.checkbox-label input:checked ~ .checkmark:after {display: block;}
.checkbox-label .text-label {line-height: 1.3;}