


.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}



.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-muted);
}

.label-optional {
    font-weight: 400;
    font-size: 0.85em;
    opacity: 0.7;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-light);
    padding: 12px 16px;
    font-size: 1em;
    transition: all 0.2s ease;
    width: 100%;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.form-group textarea {
    min-height: 80px;
    resize: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}


.form-group textarea::-webkit-scrollbar {
    width: 6px;
}

.form-group textarea::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.form-group textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.form-group textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group select option {
    background: #0f172a;
    color: var(--text-light);
}

.hidden-input {
    display: none;
}

.hidden-input.active {
    display: block;
    margin-top: 8px;
    animation: slideDown 0.2s ease-out;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}


.toggle-group-wrapper {
    justify-content: flex-start;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 11px 16px;
    height: 100%;
}

.toggle-label {
    font-size: 0.95em;
    color: var(--text-light);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background-color: var(--primary);
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}


.segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 4px;
}

.segment-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-btn:hover {
    color: var(--text-light);
}

.segment-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


.terms-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.terms-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
    gap: 16px;
    padding: 0 8px;
}

.terms-grid-alignment {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
    gap: 16px;
}

.grid-span-2 {
    grid-column: span 2;
}

.col-header {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terms-rows-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.term-row {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
    gap: 16px;
    align-items: center;
    animation: rowEnter 0.2s ease-out forwards;
    transform-origin: top center;
    opacity: 0;
}

.term-row.removing {
    animation: rowExit 0.2s ease-in forwards;
    pointer-events: none;
}

.term-row input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    color: #ffffff !important;
    padding: 10px 14px;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.term-row input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.term-row input:focus {
    border-color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    outline: none;
}

.btn-delete-row {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-delete-row:hover {
    background: #ef4444;
    color: var(--text-light);
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}



@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rowEnter {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rowExit {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-8px);
    }
}


#create-set-modal.modal-overlay {
    padding-top: var(--header-height); 
    background: var(--bg-dark);
    align-items: stretch;
    justify-content: center;
    padding-bottom: 0;
    z-index: 10000;
}


.modal-card.modal-card-wide {
    max-width: 1200px;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    margin: 0 auto;
}

.modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-form .modal-footer {
    padding-bottom: 24px;
    flex-shrink: 0;
}


.modal-body.split-layout {
    display: flex;
    flex-direction: row;
    padding: 0;
    gap: 0;
    flex: 1;
    overflow: hidden; 
    max-height: none;
}

.split-sidebar {
    width: 340px;
    flex-shrink: 0;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.split-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}


.section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85em;
    opacity: 0.8;
    margin-bottom: -8px; 
}

.main-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.main-header-row .section-title {
    margin: 0;
    opacity: 1;
    font-size: 1.2em;
    text-transform: none;
    letter-spacing: 0;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.85em;
    height: auto;
}

.btn-small .material-symbols-rounded {
    font-size: 18px;
}


.split-sidebar::-webkit-scrollbar,
.split-main::-webkit-scrollbar {
    width: 6px;
}

.split-sidebar::-webkit-scrollbar-track,
.split-main::-webkit-scrollbar-track {
    background: transparent;
}

.split-sidebar::-webkit-scrollbar-thumb,
.split-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.split-sidebar::-webkit-scrollbar-thumb:hover,
.split-main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
