/* ================================================
   Dynamic (Smart) Folder Modal & Rule Builder
   ================================================ */

.kookoawpf-modal-dynamic-content {
    max-width: 560px !important;
}

.kookoawpf-dynamic-name-row {
    margin-bottom: 16px;
}

.kookoawpf-dynamic-name-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--kookoawpf-green);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--kookoawpf-font);
}

.kookoawpf-dynamic-name-row input {
    width: 100%;
    padding: 8px 10px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
}

.kookoawpf-dynamic-name-row input:focus {
    border-color: #39FF14;
    outline: none;
    box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.15);
}

.kookoawpf-dynamic-rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262d;
}

.kookoawpf-dynamic-rules-header span {
    color: var(--kookoawpf-green);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--kookoawpf-font);
    font-weight: 600;
}

.kookoawpf-btn-add-rule {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: #161b22 !important;
    border: 3px solid #30363d !important;
    color: #39FF14 !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    /* WP 7.0 Modern theme bumped default .button min-height to 40px.
       Lock to ~36px (WP 6.9.4 standard .button height) via explicit padding,
       independent of WP version. */
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.kookoawpf-btn-add-rule:hover {
    background: #1c2333 !important;
    border: 3px solid #39FF14 !important;
}

#kookoawpf-dynamic-add-rule.kookoawpf-btn-add-rule:disabled,
#kookoawpf-dynamic-add-rule.kookoawpf-btn-add-rule[disabled] {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #39FF14 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#kookoawpf-dynamic-add-rule.kookoawpf-btn-add-rule:disabled:hover,
#kookoawpf-dynamic-add-rule.kookoawpf-btn-add-rule[disabled]:hover {
    opacity: 0.3 !important;
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #39FF14 !important;
}

.kookoawpf-btn-add-rule .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    /* WP 7.0 Modern theme sets .dashicons color to #3c434a (dark grey) by default,
       overriding currentColor inheritance. Force our neon green back. */
    color: #39FF14 !important;
}

.kookoawpf-dynamic-rules-list {
    max-height: none;
    overflow: visible;
}

.kookoawpf-rule-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    flex-wrap: wrap;
}

.kookoawpf-rule-row:hover {
    border-color: #30363d;
}

.kookoawpf-rule-field-select {
    min-width: 130px;
    padding: 5px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: var(--kookoawpf-green);
    font-size: 13px;
    font-family: 'Share Tech Mono', monospace;
    accent-color: var(--kookoawpf-green);
}

.kookoawpf-rule-field-select:focus {
    border-color: #39FF14;
    outline: none;
}

.kookoawpf-rule-value-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.kookoawpf-rule-value-select,
.kookoawpf-rule-value-input {
    flex: 1;
    min-width: 100px;
    padding: 5px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: var(--kookoawpf-green);
    font-size: 13px;
    font-family: 'Share Tech Mono', monospace;
    accent-color: var(--kookoawpf-green);
}

.kookoawpf-rule-value-input[type="number"] {
    background: #161b22 !important;
    color: #ffffff !important;
    border: 1px solid #30363d !important;
    -moz-appearance: textfield;
    -webkit-appearance: textfield;
}

.kookoawpf-rule-value-input[type="number"]::-webkit-outer-spin-button,
.kookoawpf-rule-value-input[type="number"]::-webkit-inner-spin-button,
.kookoawpf-number-spinner input[type="number"]::-webkit-outer-spin-button,
.kookoawpf-number-spinner input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.kookoawpf-number-spinner input[type="number"] {
    -moz-appearance: textfield;
}

/* Custom number spinner wrapper */
.kookoawpf-number-spinner {
    display: flex;
    align-items: stretch;
    position: relative;
}

.kookoawpf-number-spinner input {
    flex: 1;
    border-radius: 4px 0 0 4px !important;
    height: auto;
    padding: 5px 8px !important;
}

.kookoawpf-number-spinner input:focus {
    border-color: var(--kookoawpf-green) !important;
    box-shadow: 0 0 0 1px var(--kookoawpf-green) !important;
    outline: none !important;
}

.kookoawpf-number-spinner-btns {
    display: flex;
    flex-direction: column;
    width: 28px;
    flex-shrink: 0;
}

.kookoawpf-number-spinner-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #161b22;
    border: 1px solid #30363d;
    color: var(--kookoawpf-green);
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    line-height: 1;
}

.kookoawpf-number-spinner-btn:first-child {
    border-radius: 0 4px 0 0;
    border-bottom: none;
}

.kookoawpf-number-spinner-btn:last-child {
    border-radius: 0 0 4px 0;
}

.kookoawpf-number-spinner-btn:hover {
    background: var(--kookoawpf-green);
    color: #0d1117;
}

.kookoawpf-number-spinner-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.kookoawpf-rule-value-select:focus,
.kookoawpf-rule-value-input:focus {
    border-color: #39FF14;
    outline: none;
}

.kookoawpf-rule-field-select option,
.kookoawpf-rule-value-select option {
    background: #161b22;
    color: #ffffff;
}

.kookoawpf-rule-field-select option:hover,
.kookoawpf-rule-value-select option:hover,
.kookoawpf-rule-field-select option:focus,
.kookoawpf-rule-value-select option:focus {
    background: var(--kookoawpf-green-dim);
    color: var(--kookoawpf-green);
}

.kookoawpf-rule-field-select option:checked,
.kookoawpf-rule-value-select option:checked {
    background: var(--kookoawpf-green-dim) linear-gradient(0deg, var(--kookoawpf-green-dim) 0%, var(--kookoawpf-green-dim) 100%);
    color: var(--kookoawpf-green);
}

.kookoawpf-rule-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c9d1d9;
    font-size: 13px;
    cursor: pointer;
}

.kookoawpf-rule-toggle input[type="checkbox"] {
    accent-color: #39FF14;
}

.kookoawpf-date-custom-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
    color: #ffffff;
    font-size: 12px;
}

.kookoawpf-date-custom-row input[type="date"] {
    flex: 1;
    padding: 4px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
}

.kookoawpf-date-custom-row input[type="date"]:focus {
    border-color: #39FF14;
    outline: none;
}

.kookoawpf-rule-remove {
    background: none;
    border: none;
    color: #FF3B30;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.15s, text-shadow 0.15s;
}

.kookoawpf-rule-remove:hover {
    transform: scale(1.3);
    text-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

/* Smart folder button in sidebar */
#kookoawpf-btn-new-dynamic {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #39FF14 !important;
}

#kookoawpf-btn-new-dynamic:hover {
    border-color: #FF9500 !important;
    color: #FF9500 !important;
    background: #1c2333 !important;
}
