/** Inits **/
:root {
    --at-spacing-1: .5rem;
    --at-spacing-2: 1rem;
}

#wpcontent {
    padding-right: 20px;
}

#at-panel {
    width: 100%;
    position: relative;
    margin-top: var(--at-spacing-2);
}

#at-panel * {
    outline: none;
}

#at-panel h2,
h3,
ul,
li,
p {
    margin: 0;
    padding: 0;
}

#at-panel .at-field-table p {
    margin-top: 0;
}

#at-panel p {
    margin-bottom: var(--at-spacing-1);
    line-height: unset;
}

#at-panel a:hover,
#at-panel a:active,
#at-panel a:focus {
    outline: inherit;
    box-shadow: inherit;
}

/** Utils **/

#at-panel .at-mt-1 {
    margin-top: var(--at-spacing-1);
}

#at-panel .at-mb-1 {
    margin-bottom: var(--at-spacing-1);
}

#at-panel .at-mt-2 {
    margin-top: var(--at-spacing-2);
}

#at-panel .at-mb-2 {
    margin-bottom: var(--at-spacing-2);
}

#at-panel .at-pt-1 {
    padding-top: var(--at-spacing-1);
}

#at-panel .at-pb-1 {
    padding-bottom: var(--at-spacing-1);
}

#at-panel .at-pt-2 {
    padding-top: var(--at-spacing-2);
}

#at-panel .at-pb-2 {
    padding-bottom: var(--at-spacing-2);
}

/* Disable text selection for labels within the form */
#at-panel-form label {
    user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.at-field-descr {
    margin-top: var(--at-spacing-1);
    font-size: 12px;
    opacity: .8;
}

.active {
    display: block !important;
}

.delete {
    margin-left: 10px;
    color: #cc1818;
    cursor: pointer;
}

.delete:hover {
    color: #FF0000;
}

.loading {
    opacity: .7;
}

/* Text & Password */
.at-text-ipt,
.at-password-ipt {
    width: 100%;
    margin: 0;
    font-size: 14px;
    border-radius: 0 !important;
    border-color: #d0d2d7 !important;
    box-shadow: none !important;
    padding: 2px 10px !important;
}

/* Password Toggle */
.at-inputs-container {
    display: flex;
}

.at-inputs-container .at-password-ipt {
    border-right-width: 0 !important;
}

.at-password-btn {
    font: normal normal normal 14px/1 FontAwesome;
    color: #ffffff;
    border: 0;
    margin: 0;
    width: 50px;
    background-color: #3ac57a;
    border-bottom: 2px solid rgb(0, 0, 0, .2);
    cursor: pointer;
}

/* Image Upload */
.at-img-upload {
    display: flex;
}

.at-img-upload .at-text-ipt {
    border-right-width: 0 !important;
}

.at-upload-img-ipt {
    font: normal normal normal 14px/1 FontAwesome;
    color: #ffffff;
    border: 0;
    margin: 0;
    width: 50px;
    background-color: #3ac57a;
    border-bottom: 2px solid rgb(0, 0, 0, .2);
    cursor: pointer;
}

/* Search */
.at-search-ipt {
    margin: 0;
    font-size: 14px;
    border-radius: 0 !important;
    border-color: #d0d2d7 !important;
    box-shadow: none !important;
    padding: 2px 10px !important;
}

/* Number */
.at-number-ipt {
    margin: 0;
    font-size: 14px;
    border-radius: 0 !important;
    border-color: #d0d2d7 !important;
    box-shadow: none !important;
    padding: 2px 10px !important;
}

/* Switch Button */
.at-switch-btn {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.at-switch-btn input {
    display: none;
}

.at-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.at-switch-btn input:checked+.at-switch {
    background-color: #3ac57a;
}

.at-switch:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.at-switch-btn input:checked+.at-switch:before {
    transform: translateX(16px);
}

/* File upload Button */
.import-settings-container {
    position: relative;
    display: flex;
    gap: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 70px;
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #555;
    color: #444;
    cursor: pointer;
    transition: background .2s ease-in-out, border .2s ease-in-out;
}

.import-settings-container:hover {
    background: #eee;
    border-color: #111;
}

.at-upload-file-ipt {
    margin-right: 20px;
    border: none;
    background-color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    color: #111;
    cursor: pointer;
    transition: background .2s ease-in-out;
}

.at-upload-file-ipt::file-selector-button {
    background-color: #3ac57a;
    color: #fff;
    border-radius: 10px;
    border-width: none;
    cursor: pointer;
}


/* Repeatables */
.at-coll-container {
    background-color: #ffffff;
    border: 1px solid #CCCCCC;
}

.at-coll-container:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.at-coll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    user-select: none;
}

.at-coll-action {
    user-select: none;
}

.at-coll-action *:not(:last-child) {
    margin: var(--at-spacing-1);
}

.at-coll-action .at-action-move {
    cursor: move;
}

.at-coll-action .delete {
    color: #cc1818;
    font-weight: 400;
    text-decoration: none;
}

.at-coll-action .delete:hover {
    color: #FF0000;
}

.at-coll-title {
    font-size: 15px;
    font-weight: 500;
}

.at-coll-body {
    padding: 15px;
    background-color: #fdfdfd;
    border-top: 1px solid #E4E4E4;
}

.at-coll-body div:not(:last-child) {
    border-bottom: 1px solid #E4E4E4;
}

/* Select */
.at-select {
    width: 80%;
    padding: 2px 10px !important;
    border: 1px solid #e4e4e4 !important;
    box-shadow: none !important;
}

/* Textarea */
.at-textarea {
    width: 100%;
    margin: 0;
    font-size: 14px;
    border-radius: 0 !important;
    border-color: #d0d2d7 !important;
    box-shadow: none !important;
    padding: 10px !important;
}

/* Tick List */
.at-tick-list ul {
    margin: 0;
}

.at-tick-list ul li {
    margin-bottom: var(--at-spacing-1);
}

/* Add Button */
.add-button {
    padding: 6px 12px;
    background-color: transparent;
    border: 2px solid #007cba;
    color: #007cba;
    cursor: pointer;
}

/** panel **/

#at-panel .at-panel-right h3 {
    margin: 0;
    padding: 0;
    font-size: 15px;
}

#at-panel .at-panel-tabs ul li a i {
    width: 12px;
    text-align: center;
    margin-right: 7px;
}

.at-panel-container {
    display: grid;
    grid-template-columns: 215px 1fr;
    max-width: 900px;
    background-color: #fff;
    border: 1px solid #E4E4E4;
}

.at-panel-left {
    border-right: 1px solid #E4E4E4;
    align-self: start;
    position: sticky;
    top: 0;
}

.at-panel-header {
    border-bottom: 1px solid #E4E4E4;
    padding: 20px;
}

.at-panel-header h2,
.at-form-header h2 {
    font-size: 19px;
}

/** Tabs **/

.at-panel-tabs {
    background-color: #f8f8f8;
}

.at-panel-tab a {
    display: block;
    padding: 11px 15px;
    color: #111111;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    outline: none;
    box-shadow: none;
    border-bottom: 1px solid #E4E4E4;
}

.at-panel-tab.active a,
.at-panel-tab a:hover {
    color: #fff;
    background-color: #3ac57a;
}

/** Fields **/

.at-field-section {
    display: none;
    opacity: 0;
}

.at-field-section.active {
    display: block;
    opacity: 1;
}

.at-form-header {
    padding: 20px;
    border-bottom: 1px solid #E4E4E4;
}

.at-field-table {
    width: 100%;
    border-left: 1px solid #E4E4E4;
}

.at-field-table tbody tr {
    display: grid;
    grid-template-columns: 200px 1fr;
}

.at-field-table tbody tr.table-content {
    grid-template-columns: 1fr;
}

.at-field-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #E4E4E4;
}

.at-field-table tbody tr td:has(h3, p) {
    margin: 0;
}

.at-field-table tbody tr td {
    padding: 20px;
}

.at-mini-title {
    font-size: 14px;
    font-weight: 500;
}

/* Repeater Term */
.coll-term-search, .coll-post-search {
    margin-bottom: var(--at-spacing-1);
}

.coll-term-results, .coll-post-results {
    padding-bottom: var(--at-spacing-1);
    margin-bottom: var(--at-spacing-1);
    border-bottom: 1px solid #cccccc;
}

.coll-term-results ul, .coll-post-results ul {
    margin: 0;
}

.coll-term-results ul li, .coll-post-results ul li {
    padding: 5px 10px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.coll-term-results ul li:not(:last-child), .coll-post-results ul li:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.coll-term-selected ul li, .coll-post-selected ul li {
    padding: 5px 10px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
}

.coll-term-selected ul li:not(:last-child), .coll-post-selected ul li:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.coll-term-selected .delete, .coll-post-selected .delete {
    float: right;
}

/* Post Search */
.post-search {
    margin-bottom: var(--at-spacing-1);
}

.post-results {
    padding-bottom: var(--at-spacing-1);
    margin-bottom: var(--at-spacing-1);
    border-bottom: 1px solid #cccccc;
}

.post-results ul {
    margin: 0;
}

.post-results ul li {
    padding: 5px 10px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.post-results ul li:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.post-selected ul li {
    padding: 5px 10px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
}

.post-selected ul li:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.post-selected .delete {
    float: right;
}

/* Term Search */

.term-search {
    margin-bottom: var(--at-spacing-1);
}

.term-results {
    padding-bottom: var(--at-spacing-1);
    margin-bottom: var(--at-spacing-1);
    border-bottom: 1px solid #cccccc;
}

.term-results ul {
    margin: 0;
}

.term-results ul li {
    padding: 5px 10px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.term-results ul li:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.term-selected ul li {
    padding: 5px 10px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
}

.term-selected ul li:not(:last-child) {
    margin-bottom: var(--at-spacing-1);
}

.term-selected .delete {
    float: right;
}

/** All CSS **/

#at-term-field,
#at-dw-faq-field {
    display: none;
}

.save-changes {
    padding: .8rem;
}

.save-changes input {
    width: 100%;
    font-weight: 500;
}

.at-status {
    font-weight: 500;
    font-size: 15px;
}

.at-badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-weight: 700;
    line-height: 1.1;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.at-badge-success {
    color: #ffffff;
    background-color: #28a745;
}

.at-badge-danger {
    color: #ffffff;
    background-color: #dc3545;
}

.at-btn {
    display: inline-block;
    padding: 5px 10px;
    font-weight: 500;
    background-color: transparent;
    cursor: pointer;
    box-shadow: none;
}

.at-btn-primary {
    color: #007cba;
    border: 2px solid #007cba;
    box-shadow: none;
}

.at-btn-primary:hover,
.at-btn-primary:focus {
    color: #ffffff;
    background-color: #007cba;
}

.at-btn-success {
    color: #28a745;
    border: 2px solid #28a745;
    box-shadow: none;
}

.at-btn-success:hover,
.at-btn-success:focus {
    color: #ffffff;
    background-color: #28a745;
}

.at-btn-danger {
    color: #dc3545;
    border: 2px solid #dc3545;
    box-shadow: none;
}

.at-btn-danger:hover,
.at-btn-danger:focus {
    color: #ffffff;
    background-color: #dc3545;
}

/** max 782px */
@media screen and (max-width: 782px) {
    #wpcontent {
        padding-right: 10px;
    }

    .at-panel-container {
        display: block;
    }

    .at-panel-tabs ul {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .at-panel-tabs ul .at-panel-tab:not(:nth-last-child(2)) {
        border-right: 1px solid #E4E4E4;
    }

    .at-panel-tabs ul li:last-child {
        display: none;
    }

    .at-panel-left {
        top: 0;
        position: relative;
    }

    .at-field-table tbody tr {
        grid-template-columns: 1fr;
    }

    .at-field-table tbody tr td {
        padding: 12px 10px;
    }

    .save-changes {
        margin-top: var(--at-spacing-1);
        padding: 0;
        display: block !important;
    }

    .save-changes button[type="submit"] {
        border: 0;
        outline: 0;
        width: 100%;
        padding: 7px 12px;
        background-color: #3ac57a;
        color: #ffffff;
        font-size: 15px;
        font-weight: 500;
        border-radius: 2px;
    }
}