/* ================================================
   Modals - Retro Terminal Style
   ================================================ */
.kookoawpf-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kookoawpf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.kookoawpf-modal-content {
    position: relative !important;
    width: 400px !important;
    max-width: 90% !important;
    background: var(--kookoawpf-bg) !important;
    border: 1px solid var(--kookoawpf-green) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 10px rgba(57,255,20,0.1) !important;
    z-index: 1 !important;
    font-family: var(--kookoawpf-font) !important;
    overflow: visible !important;
}

.kookoawpf-modal-sm { width: 320px; }

.kookoawpf-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid var(--kookoawpf-border) !important;
    background: var(--kookoawpf-bg-light) !important;
    border-radius: 8px 8px 0 0 !important;
}

.kookoawpf-modal-header h3 {
    margin: 0 !important;
    font-size: 16px !important;
    color: var(--kookoawpf-green) !important;
    font-family: var(--kookoawpf-font) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.kookoawpf-modal-close {
    background: none !important;
    border: none !important;
    font-size: 32px !important;
    cursor: pointer !important;
    color: var(--kookoawpf-text-muted) !important;
    padding: 4px 6px !important;
    line-height: 1 !important;
    min-width: 32px !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.kookoawpf-modal-close:hover {
    color: var(--kookoawpf-green) !important;
}

.kookoawpf-modal-body {
    padding: 20px !important;
    overflow: visible !important;
}

.kookoawpf-modal-body::-webkit-scrollbar { width: 10px; }
.kookoawpf-modal-body::-webkit-scrollbar-track { background: var(--kookoawpf-bg); }
.kookoawpf-modal-body::-webkit-scrollbar-thumb { background: var(--kookoawpf-green-dim); border-radius: 5px; }
.kookoawpf-modal-body::-webkit-scrollbar-thumb:hover { background: var(--kookoawpf-green); }
.kookoawpf-modal-body { scrollbar-color: var(--kookoawpf-green-dim) var(--kookoawpf-bg); }

.kookoawpf-modal-body label {
    display: block !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    color: var(--kookoawpf-green) !important;
    font-family: var(--kookoawpf-font) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    line-height: normal !important;
}

.kookoawpf-modal-body input[type="text"],
.kookoawpf-modal-body select {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid var(--kookoawpf-green) !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background: var(--kookoawpf-bg-light) !important;
    color: #ffffff !important;
    font-family: var(--kookoawpf-font) !important;
    accent-color: var(--kookoawpf-green) !important;
    box-shadow: 0 0 0 1px var(--kookoawpf-green-dim) !important;
    line-height: normal !important;
    height: auto !important;
    /* WP 7.0 Modern admin theme bumped default input min-height to 40px.
       Lock our modal inputs to retro-dark compact size, independent of WP version. */
    min-height: 0 !important;
}
.kookoawpf-modal-body select {
    padding-right: 32px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath d='M5 6l5 5 5-5 2 1-7 7-7-7z' fill='%2339FF14'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
}

.kookoawpf-modal-body select option {
    background: var(--kookoawpf-bg-light) !important;
    color: #ffffff !important;
    padding: 4px 8px !important;
}

.kookoawpf-modal-body select option:hover,
.kookoawpf-modal-body select option:focus {
    background: var(--kookoawpf-green-dim) !important;
    color: var(--kookoawpf-green) !important;
}

.kookoawpf-modal-body select option:checked,
#kookoawpf-folder-parent-select option:checked,
#kookoawpf-bulk-folder-select option:checked {
    background: var(--kookoawpf-green-dim) linear-gradient(0deg, var(--kookoawpf-green-dim) 0%, var(--kookoawpf-green-dim) 100%) !important;
    color: var(--kookoawpf-green) !important;
}

.kookoawpf-modal-body input[type="text"]:hover,
.kookoawpf-modal-body select:hover {
    border-color: var(--kookoawpf-green) !important;
    box-shadow: 0 0 0 1px var(--kookoawpf-green-dim), 0 0 8px var(--kookoawpf-green-glow) !important;
}
.kookoawpf-modal-body input[type="text"]:focus,
.kookoawpf-modal-body select:focus {
    border-color: var(--kookoawpf-green) !important;
    box-shadow: 0 0 0 1px var(--kookoawpf-green-dim), 0 0 8px var(--kookoawpf-green-glow) !important;
    outline: none !important;
}

.kookoawpf-modal-body input[type="text"]::placeholder {
    color: var(--kookoawpf-text-muted) !important;
}

.kookoawpf-modal-body p {
    color: var(--kookoawpf-text) !important;
    font-family: var(--kookoawpf-font) !important;
}

/* ================================================
   Custom Dropdown (replaces native <select>)
   ================================================ */
.kookoawpf-custom-select {
    position: relative !important;
    width: 100% !important;
    font-family: var(--kookoawpf-font) !important;
    font-size: 14px !important;
    user-select: none !important;
}

.kookoawpf-custom-select-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 8px 12px !important;
    background: var(--kookoawpf-bg-light) !important;
    border: 1px solid var(--kookoawpf-border-light) !important;
    border-radius: 4px !important;
    color: #ffffff !important;
    font-family: var(--kookoawpf-font) !important;
    font-size: 14px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    line-height: normal !important;
    height: auto !important;
}

.kookoawpf-custom-select-trigger:hover {
    border-color: var(--kookoawpf-green) !important;
    box-shadow: 0 0 0 1px var(--kookoawpf-green-dim), 0 0 8px var(--kookoawpf-green-glow) !important;
}

.kookoawpf-custom-select.kookoawpf-cs-open .kookoawpf-custom-select-trigger {
    border-color: var(--kookoawpf-green) !important;
    box-shadow: 0 0 0 1px var(--kookoawpf-green-dim), 0 0 8px var(--kookoawpf-green-glow) !important;
}

.kookoawpf-custom-select-arrow {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: var(--kookoawpf-green) !important;
    transition: transform 0.2s !important;
}

.kookoawpf-custom-select.kookoawpf-cs-open .kookoawpf-custom-select-arrow {
    transform: rotate(180deg) !important;
}

.kookoawpf-custom-select-options {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    background: var(--kookoawpf-bg) !important;
    border: 1px solid var(--kookoawpf-green-dim) !important;
    border-top: none !important;
    border-radius: 0 0 4px 4px !important;
    z-index: 200002 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.kookoawpf-custom-select.kookoawpf-cs-open .kookoawpf-custom-select-options {
    display: block !important;
}

.kookoawpf-custom-select-option {
    padding: 7px 12px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    font-family: var(--kookoawpf-font) !important;
    font-size: 13px !important;
    transition: background 0.1s, color 0.1s !important;
    background: var(--kookoawpf-bg) !important;
    line-height: normal !important;
}
.kookoawpf-custom-select-option.kookoawpf-cs-font-preview {
    font-family: inherit !important;
    font-size: 16px !important;
}

.kookoawpf-custom-select-option:hover {
    background: var(--kookoawpf-green-dim) !important;
    color: var(--kookoawpf-green) !important;
}

.kookoawpf-custom-select-option.kookoawpf-cs-selected {
    color: var(--kookoawpf-green) !important;
    background: var(--kookoawpf-green-glow) !important;
}

.kookoawpf-custom-select-options { scrollbar-color: var(--kookoawpf-green-dim) var(--kookoawpf-bg); }
.kookoawpf-custom-select-options::-webkit-scrollbar { width: 10px; }
.kookoawpf-custom-select-options::-webkit-scrollbar-track { background: var(--kookoawpf-bg); }
.kookoawpf-custom-select-options::-webkit-scrollbar-thumb { background: var(--kookoawpf-green-dim); border-radius: 5px; }
.kookoawpf-custom-select-options::-webkit-scrollbar-thumb:hover { background: var(--kookoawpf-green); }

/* Small variant for rule selects */
.kookoawpf-rule-row .kookoawpf-custom-select-trigger {
    padding: 5px 8px;
    font-size: 13px;
}

.kookoawpf-rule-row .kookoawpf-custom-select {
    font-size: 13px;
    min-width: 100px;
}

.kookoawpf-rule-row .kookoawpf-custom-select-option {
    padding: 5px 8px;
    font-size: 12px;
}

.kookoawpf-modal-footer {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding: 14px 20px !important;
    border-top: 1px solid var(--kookoawpf-border) !important;
    background: var(--kookoawpf-bg-light) !important;
    border-radius: 0 0 8px 8px !important;
    overflow: visible !important;
}

.kookoawpf-modal-footer .button {
    font-family: var(--kookoawpf-font) !important;
    border: 3px solid var(--kookoawpf-border-light) !important;
    background: var(--kookoawpf-bg) !important;
    color: var(--kookoawpf-text) !important;
    /* WP 7.0 Modern admin theme bumped default .button min-height to 40px.
       Lock our modal buttons to retro-dark compact size, independent of WP version. */
    min-height: 0 !important;
    height: auto !important;
    padding: 6px 14px !important;
    line-height: 1.4 !important;
    font-size: 13px !important;
}

.kookoawpf-modal-footer .button:hover {
    border: 3px solid var(--kookoawpf-green-dim);
    background: var(--kookoawpf-green-soft) !important;
    color: var(--kookoawpf-bg) !important;
}

.kookoawpf-modal-footer .button-primary {
    background: var(--kookoawpf-green-dim) !important;
    border: 3px solid var(--kookoawpf-green) !important;
    color: var(--kookoawpf-bg) !important;
    font-weight: 700;
    text-shadow: none;
}

.kookoawpf-modal-footer .button-primary:hover {
    background: var(--kookoawpf-green) !important;
    border: 3px solid #1d2327 !important;
    box-shadow: 0 0 8px var(--kookoawpf-green-glow-strong);
}

.kookoawpf-modal-footer .button-primary:disabled,
.kookoawpf-modal-footer .button-primary[disabled] {
    background: var(--kookoawpf-green-dim) !important;
    border: 3px solid var(--kookoawpf-green) !important;
    color: var(--kookoawpf-bg) !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.kookoawpf-btn-danger {
    background: var(--kookoawpf-red) !important;
    border: 3px solid var(--kookoawpf-red) !important;
    color: #fff !important;
}

.kookoawpf-btn-danger:hover {
    background: #da3633 !important;
    border: 3px solid #da3633 !important;
    box-shadow: 0 0 8px rgba(248, 81, 73, 0.3);
}

/* ================================================
   Color Palette
   ================================================ */
.kookoawpf-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.kookoawpf-color-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.kookoawpf-color-separator {
    width: 100%;
    height: 1px;
    background: #30363d;
    margin: 4px 0;
}

.kookoawpf-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.kookoawpf-color-swatch[data-color="#FFFFFF"],
.kookoawpf-color-swatch[data-color="#ffffff"] {
    border-color: var(--kookoawpf-border-light);
}

.kookoawpf-color-swatch[data-color="#000000"] {
    border-color: var(--kookoawpf-green);
}

.kookoawpf-color-swatch:hover {
    transform: scale(1.2);
    border-color: var(--kookoawpf-green);
    box-shadow: 0 0 8px var(--kookoawpf-green-glow);
}

.kookoawpf-color-swatch.kookoawpf-color-active {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px var(--kookoawpf-bg), 0 0 0 5px #ffffff;
}


.kookoawpf-color-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--kookoawpf-border-light);
    background: var(--kookoawpf-bg-hover);
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.kookoawpf-color-hex {
    width: 90px !important;
    padding: 6px 8px !important;
    font-family: var(--kookoawpf-font) !important;
    font-size: 13px !important;
    background: var(--kookoawpf-bg) !important;
    color: var(--kookoawpf-green) !important;
    border: 1px solid var(--kookoawpf-border-light) !important;
    border-radius: 4px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kookoawpf-color-hex:focus {
    border-color: var(--kookoawpf-green) !important;
    outline: none !important;
    box-shadow: 0 0 4px var(--kookoawpf-green-glow) !important;
}

.kookoawpf-color-apply-btn {
    background: var(--kookoawpf-bg) !important;
    color: var(--kookoawpf-green) !important;
    border: 3px solid var(--kookoawpf-green-dim) !important;
    font-family: var(--kookoawpf-font) !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    cursor: pointer;
    border-radius: 4px !important;
    transition: all 0.15s;
}

.kookoawpf-color-apply-btn:hover {
    background: var(--kookoawpf-green-dim) !important;
    border: 3px solid var(--kookoawpf-green) !important;
    color: #fff !important;
}

.kookoawpf-color-reset-row {
    text-align: center;
    margin-top: 10px;
}

.kookoawpf-color-reset-link {
    font-family: var(--kookoawpf-font);
    font-size: 11px;
    color: var(--kookoawpf-green-dim);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.15s;
    cursor: pointer;
}

.kookoawpf-color-reset-link:hover {
    color: var(--kookoawpf-green);
    text-decoration: underline;
}

/* ================================================
   Icon Picker Modal
   ================================================ */
.kookoawpf-icon-picker-body {
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.kookoawpf-icon-picker-body::-webkit-scrollbar { width: 10px; }
.kookoawpf-icon-picker-body::-webkit-scrollbar-track { background: var(--kookoawpf-bg); }
.kookoawpf-icon-picker-body::-webkit-scrollbar-thumb { background: var(--kookoawpf-green-dim); border-radius: 5px; }
.kookoawpf-icon-picker-body::-webkit-scrollbar-thumb:hover { background: var(--kookoawpf-green); }
.kookoawpf-icon-picker-body { scrollbar-color: var(--kookoawpf-green-dim) var(--kookoawpf-bg); }

.kookoawpf-icon-category {
    margin-bottom: 12px;
}

.kookoawpf-icon-category-label {
    font-family: var(--kookoawpf-font);
    font-size: 11px;
    color: var(--kookoawpf-green);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--kookoawpf-border);
}

.kookoawpf-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.kookoawpf-icon-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.15s;
    background: var(--kookoawpf-bg);
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
    font-style: normal;
}

.kookoawpf-icon-option:hover {
    border-color: var(--kookoawpf-green);
    background: var(--kookoawpf-bg-hover);
    transform: scale(1.15);
    box-shadow: 0 0 8px var(--kookoawpf-green-glow);
}

.kookoawpf-icon-reset-row {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--kookoawpf-border);
    text-align: center;
}

#kookoawpf-icon-reset {
    background: var(--kookoawpf-bg) !important;
    color: var(--kookoawpf-text-muted) !important;
    border: 3px solid var(--kookoawpf-border-light) !important;
    font-family: var(--kookoawpf-font) !important;
    font-size: 12px !important;
    cursor: pointer;
}

#kookoawpf-icon-reset:hover {
    border: 3px solid var(--kookoawpf-green) !important;
    color: var(--kookoawpf-green) !important;
}

/* ================================================
   Notices - Terminal Style
   ================================================ */
.kookoawpf-notice {
    position: fixed;
    top: 36px;
    left: 50%;
    z-index: 200002;
    padding: 11px 22px 11px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--kookoawpf-font);
    color: var(--kookoawpf-text);
    background: var(--kookoawpf-bg-light);
    border: 1px solid var(--kookoawpf-border);
    border-left: 3px solid var(--kookoawpf-green);
    opacity: 0;
    transform: translate(-50%, -14px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 6px 24px rgba(0,0,0,0.45), 0 0 12px var(--kookoawpf-green-glow);
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kookoawpf-notice-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.kookoawpf-notice-success {
    border-left-color: var(--kookoawpf-green);
    box-shadow: 0 6px 24px rgba(0,0,0,0.45), 0 0 12px var(--kookoawpf-green-glow);
}

.kookoawpf-notice-error {
    border-left-color: var(--kookoawpf-red);
    box-shadow: 0 6px 24px rgba(0,0,0,0.45), 0 0 12px rgba(248, 81, 73, 0.2);
}

.kookoawpf-notice-warning {
    border-left-color: var(--kookoawpf-orange);
    box-shadow: 0 6px 24px rgba(0,0,0,0.45), 0 0 12px rgba(255, 107, 53, 0.2);
}

/* ================================================
   Keyboard Shortcuts Modal
   ================================================ */
.kookoawpf-modal-shortcuts-content {
    width: 360px !important;
    max-width: 95% !important;
    padding: 20px 24px !important;
}
.kookoawpf-modal-shortcuts-content h3 {
    color: #FF9500 !important;
    margin-bottom: 12px !important;
}
.kookoawpf-modal-shortcuts-content .kookoawpf-modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
}
.kookoawpf-shortcuts-table {
    width: 100% !important;
    border-collapse: collapse !important;
}
.kookoawpf-shortcuts-table td {
    padding: 7px 0 !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 13px !important;
    border-bottom: 1px solid #30363d !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: none !important;
    line-height: normal !important;
}
.kookoawpf-shortcuts-table td:first-child {
    color: #39FF14 !important;
    padding-right: 20px !important;
}
.kookoawpf-shortcuts-table td:last-child {
    text-align: right !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}
.kookoawpf-shortcuts-table tr:last-child td {
    border-bottom: none !important;
}
.kookoawpf-shortcuts-sep td {
    padding: 0 !important;
    border-bottom: 1px solid #39FF14 !important;
}

/* Loading state for modal buttons (import, etc.) */
.kookoawpf-modal .kookoawpf-btn-loading {
    background: #39FF14 !important;
    color: #0d1117 !important;
    border-color: #39FF14 !important;
    cursor: wait;
    opacity: 0.8;
}
