@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
    --main: #ff5252;
    --blue-main: #4285f4;
    --green-main: #0B8494;
    --red-main: #dc3545;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
}

/* Basic Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
}

.conditions-modal-content {
    position: relative;
    background: #fff;
    margin: 5vh auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow-y: auto; /* enable overall scrolling */
}

.conditions-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.conditions-modal-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.conditions-modal-body {
    margin: 10px;
    flex: 1;
}

/* Condition Row Styles */
.condition-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    position: relative;
}

.conditions-modal-body .condition-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    position: relative;
}

/* Button Styles */
.btn {
    background: var(--blue-main);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background-color 0.2s;
}

.conditions-modal-body .btn {
    margin: 10px 10px 10px 0;
}

.btn:hover {
    background: #3367d6;
}

/* Number Badge */
.condition-number {
    width: 28px;
    height: 28px;
    background: white;
    color: #125B9A;
    border-radius: 50%;
    border: 1px solid #125B9A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

select, input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
    min-width: 180px;
}

.or-group {
    margin: 16px 0;
    padding: 16px;
    background: var(--gray-100);
    border-radius: 4px;
}

.conditions-modal-body .or-group {
    background: var(--gray-100);
    border-radius: 4px;
    padding: 16px;
    margin: 16px 0;
}

.and-group {
    margin: 16px 0;
    padding-left: 20px;
    border-left: 3px solid var(--green-main);
}

.conditions-modal-body .and-group {
    margin: 16px 0;
    padding-left: 20px;
    border-left: 3px solid var(--green-main);
}

.or-separator {
    background: var(--red-main);
    color: white;
    padding: 4px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin: 16px 0;
    display: inline-block;
}

/* Operator Select */
.operator-select {
    padding: 6px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

/* Remove Button */
.remove-btn {
    background: var(--red-main);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.remove-btn:hover {
    background: #c82333;
}

/* Group Container */
.condition-container {
    position: relative;
}

/* AND/OR Labels */
.logic-label {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

/* Helper Text */
.helper-text {
    background: var(--gray-100);
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.conditions-modal-body .helper-text {
    margin: 0 0 20px 0;
}

.helper-text ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.helper-text li {
    margin-bottom: 5px;
}

/* JSON Output */
#jsonOutput {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-100);
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
}

.conditions-modal-body #jsonOutput {
    margin: 20px 0;
}

/* Add Condition Button */
.add-btn {
    background: #fff;
    color: #ff6e79;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ff6e79;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
}
.add-btn:hover {
    color: #f72b2b;
    background: #fff;
    border: 2px solid #f72b2b;

}

/* New Section Styles */
.section-container {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: 8px;
}

.conditions-modal-body .section-container {
    margin: 20px 0;
}

.section-column {
    flex: 1;
    padding: 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-400);
    transition: .4s;
    border-radius: 11px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--green-main);
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.section-content {
    margin-top: 16px;
}

.section-content.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.section-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--blue-main);
}

.delete-icon {
    color: var(--red-main);
    cursor: pointer;
    transition: color 0.2s;
}

.delete-icon:hover {
    color: #c82333;
}

/* Add new title styles */
.logic-title {
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logic-title::before {
    content: "";
    width: 6px;
    height: 32px;
    background: #125B9A;
    border-radius: 3px;
}

.logic-title span {
    background:  #125B9A;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logic-title.then::before {
    background: #0B8494;
}

.logic-title.then span {
    background:  #0B8494;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Material Icons */
.material-icons {
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}

/* Field Select Styles */
.field-select {
    min-width: 160px;
}

/* Value Input Styles */
.value-input {
    flex: 1;
    max-width: 200px;
}

/* Modal Header Styles */
.conditions-modal-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px 8px 0 0;
    margin: 0;
}

/* Router Label Section */
.router-label-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: 8px;
}

.router-label-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.router-label-input {
    width: 100%;
    max-width: 400px;
}

/* Modal Footer */
.conditions-modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    margin-top: auto;
    z-index: 10;
    width: auto;
    border-radius: 0 0 8px 8px;
}

.conditions-modal-footer-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: var(--gray-500);
}

.btn-primary {
    background: #3b4b56;
}

.btn-secondary:hover {
    background: #4a4e52;
}

.btn-primary.save-condition {
    background: #ff6e79 !important;
    color: #fff;
}

.btn-primary.save-condition:hover{
  background: #ff5252 !important;
  color: #fff;
}