/**
 * RESTRICTED PAGE TEMPLATES: Admin theme
 *
 * Shared header, subheader, boxes and fields for the Settings and Templates tabs.
 * Colors follow Admin Help Docs' variables when it is active, with matching fallbacks.
 */

:root {
    --deadbolt-color-header-bg: var( --helpdocs-color-header-bg, #1D2327 );
    --deadbolt-color-header-font: var( --helpdocs-color-header-font, #FFFFFF );
    --deadbolt-color-header-tab: var( --helpdocs-color-header-tab, #475467 );
    --deadbolt-color-header-tab-link: var( --helpdocs-color-header-tab-link, #98A2B3 );
    --deadbolt-color-accent: var( --helpdocs-color-doc-accent, #0783BE );
    --deadbolt-color-button: var( --helpdocs-color-button, #0783BE );
    --deadbolt-color-button-font: var( --helpdocs-color-button-font, #FFFFFF );
    --deadbolt-color-button-hover: var( --helpdocs-color-button-hover, #066998 );
    --deadbolt-radius: 8px;
}

/* Header */

#deadbolt-header {
    margin: 0 0 0 -20px !important;
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var( --deadbolt-color-header-bg );
    padding: 20px 30px;
}

#deadbolt-header .logo {
    height: 32px !important;
    width: auto !important;
}

#deadbolt-header .logo.is-inverted {
    filter: invert( 100% );
}

#deadbolt-header h1 {
    color: var( --deadbolt-color-header-font ) !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 3px 0;
    padding: 0;
}

#deadbolt-header .tabs-wrapper {
    display: flex;
    gap: 5px;
    align-items: center;
}

#deadbolt-header a.deadbolt-tab {
    background: transparent;
    color: var( --deadbolt-color-header-tab-link );
    border: none !important;
    border-radius: 6px;
    text-decoration: none;
    padding: 10px 15px !important;
    font-size: 12px !important;
    line-height: 1 !important;
}

#deadbolt-header a.deadbolt-tab-active,
#deadbolt-header a.deadbolt-tab:hover {
    background: var( --deadbolt-color-header-tab ) !important;
    color: var( --deadbolt-color-header-font ) !important;
}

#deadbolt-header a.deadbolt-tab-active {
    font-weight: 500;
}

/* Subheader */

#deadbolt-subheader {
    margin: 0 0 20px -20px !important;
    display: flex;
    gap: 2rem;
    align-items: center;
    background: #fff !important;
    color: #333 !important;
    padding: 20px 30px;
    box-shadow: 0 1px 2px rgba( 16, 24, 40, .1 );
    min-height: 40px;
}

#deadbolt-subheader .subheader-left {
    display: flex;
    gap: 2rem;
    align-items: center;
}

#deadbolt-subheader .subheader-right {
    margin-left: auto;
    display: flex;
    gap: 15px;
    align-items: center;
}

#deadbolt-subheader h2.tab-title {
    font-size: 21px;
    font-weight: 400;
    margin: 0 !important;
    padding: 0 !important;
}

#deadbolt-subheader .deadbolt-button {
    display: inline-flex;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 12px !important;
}

#deadbolt-subheader a.deadbolt-external-link {
    gap: 6px;
}

#deadbolt-subheader .deadbolt-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

#deadbolt-version {
    font-size: 12px;
    color: #667085;
    margin-right: 10px;
}

#deadbolt-save-reminder {
    display: none;
    background: linear-gradient( 90deg, #dc3545 0%, #b02a37 100% );
    color: #fff;
    padding: 5px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba( 220, 53, 69, .25 );
    animation: deadboltPulse 2s ease-in-out infinite;
}

@keyframes deadboltPulse {
    0%   { box-shadow: 0 4px 14px rgba( 220, 53, 69, .25 ); }
    50%  { box-shadow: 0 6px 24px rgba( 220, 53, 69, .6 ); }
    100% { box-shadow: 0 4px 14px rgba( 220, 53, 69, .25 ); }
}

#deadbolt-save-note {
    font-weight: 600;
}

#deadbolt-save-note.is-success {
    color: #00a32a;
}

#deadbolt-save-note.is-error {
    color: #d63638;
}

/* Templates list: our header replaces the default title and Add New button */

.post-type-deadbolt_tpl .wrap > h1.wp-heading-inline,
.post-type-deadbolt_tpl .wrap > .page-title-action {
    display: none;
}

.post-type-deadbolt_tpl .wrap {
    margin-top: 0;
}

/* Content wrap */

.deadbolt-wrap.wrap {
    margin: 0;
    padding: 0 30px 30px 10px;
}

.deadbolt-content-wrap {
    margin-top: 40px !important;
}

/* Boxes */

.deadbolt-settings-grid {
    display: grid;
    grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
    gap: 24px;
    align-items: start;
}

@media ( max-width: 900px ) {
    .deadbolt-settings-grid {
        grid-template-columns: 1fr;
    }
}

.deadbolt-box {
    background: #fff;
    border-radius: var( --deadbolt-radius );
    box-shadow: 0 1px 2px rgba( 16, 24, 40, .1 );
}

.deadbolt-box-header {
    border-bottom: 1px solid #eaecf0;
    padding: 20px;
}

.deadbolt-box-header h2 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px;
    font-weight: 500;
    color: #1d2939;
}

.deadbolt-box-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
}

/* Fields */

.deadbolt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deadbolt-field > label {
    font-size: 13px;
    font-weight: 500;
    color: #344054;
}

.deadbolt-field input[type="text"],
.deadbolt-field input[type="url"],
.deadbolt-field select,
.deadbolt-table select {
    width: 100%;
    max-width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    background: #fff;
    box-shadow: none;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.deadbolt-field select,
.deadbolt-table select {
    height: 36px;
    line-height: 1;
}

.deadbolt-field input:focus,
.deadbolt-field select:focus,
.deadbolt-table select:focus {
    border-color: #84caff;
    box-shadow: 0 0 0 3px rgba( 132, 202, 255, .25 );
    outline: none;
}

.deadbolt-section-desc {
    margin: 0;
    font-size: 13px;
    color: #667085;
}

.deadbolt-inline-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 400 !important;
}

.deadbolt-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.deadbolt-inline-actions select {
    flex: 1 1 200px;
    width: auto;
}

.deadbolt-checkboxes {
    display: grid;
    grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
    gap: 8px 16px;
}

.deadbolt-checkboxes label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

@media ( max-width: 900px ) {
    .deadbolt-checkboxes {
        grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
    }
}

#deadbolt-upload-filename {
    display: none;
    font-family: Consolas, Monaco, monospace;
    font-weight: 600;
    padding: 4px 8px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Post types table */

.deadbolt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.deadbolt-table th {
    text-align: left;
    font-weight: 500;
    color: #667085;
    padding: 0 8px 8px;
    border-bottom: 1px solid #eaecf0;
}

.deadbolt-table td {
    padding: 8px;
    border-bottom: 1px solid #f2f4f7;
    vertical-align: middle;
}

.deadbolt-table th:first-child,
.deadbolt-table td:first-child {
    width: 60px;
    text-align: center;
}

.deadbolt-table td code {
    font-size: 11px;
    margin-left: 4px;
}

/* Buttons */

.deadbolt-button {
    background: var( --deadbolt-color-button ) !important;
    color: var( --deadbolt-color-button-font ) !important;
    line-height: 1 !important;
    padding: 8px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    text-decoration: none;
    font-size: .8rem !important;
    font-weight: 500 !important;
    transition: background .3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.deadbolt-button:hover,
.deadbolt-button:focus {
    background: var( --deadbolt-color-button-hover ) !important;
}

.deadbolt-button:disabled {
    background: #d5d5d5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    opacity: .7;
}

.deadbolt-button.deadbolt-button-saving .dashicons {
    margin: 0 5px 0 -2px;
}

.deadbolt-button.deadbolt-button-secondary {
    background: #f6f7f7 !important;
    color: #1d2327 !important;
    border-color: #d0d5dd !important;
}

.deadbolt-button.deadbolt-button-secondary:hover {
    background: #e1e4e6 !important;
}

.deadbolt-button.deadbolt-button-danger {
    background: #fff !important;
    color: #d63638 !important;
    border: 1px solid #d63638 !important;
}

.deadbolt-button.deadbolt-button-danger:hover {
    background: #d63638 !important;
    color: #fff !important;
}

/* Notes */

.deadbolt-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0f6fc;
    border-left: 4px solid var( --deadbolt-color-accent );
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin: 0 0 20px;
    box-shadow: 0 1px 2px rgba( 16, 24, 40, .06 );
}

.deadbolt-note p {
    margin: 0;
    font-size: 13px;
    color: #344054;
}

.deadbolt-note .dashicons {
    color: var( --deadbolt-color-accent );
}

.deadbolt-note-warning {
    background: #fef9e7;
    border-left-color: #dba617;
}

.deadbolt-note-warning .dashicons {
    color: #dba617;
}

/* Tooltips */

.deadbolt-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
    color: #98a2b3;
    cursor: help;
}

.deadbolt-tooltip:hover,
.deadbolt-tooltip:focus {
    color: var( --deadbolt-color-accent );
    outline: none;
}

.deadbolt-tooltip .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.deadbolt-tooltip-text {
    position: absolute;
    bottom: calc( 100% + 8px );
    left: 50%;
    z-index: 100;
    width: max-content;
    max-width: 260px;
    padding: 8px 10px;
    background: #1d2327;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba( 16, 24, 40, .25 );
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transform: translate( -50%, 4px );
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}

.deadbolt-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #1d2327;
}

.deadbolt-tooltip:hover .deadbolt-tooltip-text,
.deadbolt-tooltip:focus .deadbolt-tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translate( -50%, 0 );
}

/* Spinner */

.deadbolt-spin {
    animation: deadboltSpin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes deadboltSpin {
    0% { transform: rotate( 0deg ); }
    100% { transform: rotate( 360deg ); }
}

/* Notices */

.deadbolt-admin-screen #wpbody-content > .notice,
.deadbolt-admin-screen #wpbody-content > .deadbolt-restore-note {
    margin: 0 30px 0 10px;
}

.deadbolt-admin-screen .wrap > .notice {
    margin: 0 0 20px;
}

#deadbolt-create-page[hidden] {
    display: none;
}