/* ==========================================
   Visual Sitemap Maker - Admin Styles
   ========================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #1d2327;
    background: #f0f0f1;
    margin: 0;
    padding: 20px;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 20px;
    padding: 9px 0 4px;
    line-height: 1.3;
}

hr {
    border: none;
    border-top: 1px solid #c3c4c7;
    margin: 30px 0;
}

/* Buttons */
.button,
.page-title-action {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 2.15384615;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
    background: #f6f7f7;
    border-color: #2271b1;
    color: #2271b1;
    vertical-align: top;
}

.button:hover,
.page-title-action:hover {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.page-title-action {
    margin-left: 10px;
    padding: 0 8px;
    position: relative;
    top: -3px;
}

/* Forms */
.form-table {
    border-collapse: collapse;
    width: 100%;
    clear: both;
    margin: 0 0 20px;
}

.form-table th,
.form-table td {
    padding: 15px 10px 15px 0;
    vertical-align: top;
    text-align: left;
}

.form-table th {
    width: 200px;
    font-weight: 400;
}

.regular-text {
    width: 25em;
    max-width: 100%;
}

input[type="text"],
input[type="url"],
select,
textarea {
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #1d2327;
    background-color: #fff;
}

textarea {
    font-family: inherit;
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: #2271b1;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Tables */
.wp-list-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.wp-list-table th,
.wp-list-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #c3c4c7;
}

.wp-list-table th {
    font-weight: 600;
    background: #f6f7f7;
}

.wp-list-table.striped tbody tr:nth-child(odd) {
    background: #f6f7f7;
}

.wp-list-table a {
    color: #2271b1;
    text-decoration: none;
}

.wp-list-table a:hover {
    text-decoration: underline;
}

/* Notices */
.vsm-notice {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.vsm-notice-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.vsm-notice-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Menu builder */
.vsm-admin {
    max-width: 1200px;
}

.vsm-menu-builder {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.vsm-add-item-form {
    flex: 0 0 350px;
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 20px;
    border-radius: 4px;
}

.vsm-menu-tree-wrap {
    flex: 1 1 auto;
    min-width: 300px;
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 20px;
    border-radius: 4px;
}

.vsm-menu-tree,
.vsm-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vsm-menu-tree {
    min-height: 50px;
}

.vsm-menu-item {
    margin: 5px 0;
    padding: 0;
    position: relative;
}

.vsm-item-bar {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    padding: 10px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 3px;
}

.vsm-item-bar:hover {
    background: #f6f7f7;
}

.vsm-item-sort {
    color: #8c8f94;
    cursor: grab;
}

.vsm-item-icon {
    width: 24px;
    text-align: center;
    color: #1d2327;
}

.vsm-item-title {
    font-weight: 600;
    flex: 1;
}

.vsm-item-url {
    color: #8c8f94;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.vsm-item-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    background: #2271b1;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
}

.vsm-item-actions {
    font-size: 12px;
}

.vsm-item-actions a {
    color: #2271b1;
    text-decoration: none;
}

.vsm-item-actions a:hover {
    text-decoration: underline;
}

.vsm-submenu {
    padding-left: 30px;
    margin-top: 5px;
    position: relative;
}

.vsm-submenu::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 10px;
    width: 2px;
    background: #c3c4c7;
}

/* Modal */
.vsm-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.vsm-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 4px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.vsm-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.vsm-modal-close:hover {
    color: #000;
}

.vsm-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.vsm-icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    cursor: pointer;
    font-size: 18px;
    color: #1d2327;
}

.vsm-icon-option:hover,
.vsm-icon-option.selected {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.vsm-icon-option.hidden {
    display: none;
}

/* Sortable placeholder */
.ui-sortable-placeholder {
    background: #f0f6fc !important;
    border: 2px dashed #2271b1 !important;
    visibility: visible !important;
    height: 40px;
}

.vsm-item-bar.sortable-drag {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.vsm-menu-tree ul {
    min-height: 10px;
}
