/**
 * Settings Page Admin Styles
 *
 * Styles for the Wallet Up Login Customizer settings page
 *
 * @package WalletUp\LoginCustomizer
 * @since 2.4.2
 */

/* Diagnostics Actions Styles - Default (Light Theme) */
.wallet-up-lc-diagnostics-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    max-width: 250px;
}

.wallet-up-lc-diagnostics-actions .button {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 8px 12px;
}

/* Description text styles - Default (Light Theme) */
.description.info-tip {
    color: #0073aa; /* Standard WP info blue */
    font-style: italic;
}

.description.success-tip {
    color: var(--wallet-up-lc-success);
    font-style: italic;
}

.description.warning-tip {
    color: var(--wallet-up-lc-danger);
    font-style: italic;
}

/* Logo preview - Default (Light Theme) */
.logo-preview {
    max-width: 100px;
    max-height: 100px;
    margin-top: 10px;
    border: 1px solid var(--wallet-up-lc-border);
    border-radius: 4px;
    padding: 5px;
}

/* Force login warning - Default (Light Theme) */
.force-login-warning {
    color: var(--wallet-up-lc-danger);
    font-style: italic;
    margin-top: 10px;
}

.force-login-warning.hidden {
    display: none;
}

/* Custom login URL preview - Default (Light Theme) */
#custom-login-url-preview {
    background: var(--wallet-up-lc-bg-tertiary);
    color: var(--wallet-up-lc-text-secondary);
    padding: 5px;
    display: inline-block;
    margin-top: 5px;
    border-radius: 3px;
}

#copy-login-url {
    margin-left: 10px;
}

/* Settings management description spacing */
.settings-action-item .description {
    margin-top: 10px;
}

/* Form table adjustments */
.form-table .description {
    margin-top: 5px;
}

/* Loading message template - hidden by default */
#loading-message-template {
    display: none;
}

/* Loading message item styles - Default (Light Theme) */
.loading-message {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-message input {
    flex: 1;
    /* Apply base theme colors for inputs */
    background: var(--wallet-up-lc-bg-primary);
    border: 1px solid var(--wallet-up-lc-border);
    color: var(--wallet-up-lc-text-primary);
}

.loading-message .remove-loading-message {
    color: var(--wallet-up-lc-danger);
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    padding: 0 5px;
}

.loading-message .remove-loading-message:hover {
    color: #a00; /* Darker red hover retained */
}

/* Settings panels - Default (Light Theme) */
.settings-panel {
    background: var(--wallet-up-lc-bg-primary);
    padding: 20px;
    margin: 20px 0;
    border-radius: var(--wallet-up-lc-radius);
    box-shadow: var(--wallet-up-lc-shadow-sm);
}

.settings-panel h2 {
    margin-top: 0;
    color: var(--wallet-up-lc-text-primary);
}

.settings-panel h3 {
    margin-top: 30px;
    padding-top: 20px;
    /* Use border token for thematic lines */
    border-top: 1px solid var(--wallet-up-lc-border);
    color: var(--wallet-up-lc-text-primary);
}

/* Settings actions grid - Default (Light Theme) */
.settings-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.settings-action-item {
    padding: 15px;
    background: var(--wallet-up-lc-bg-secondary);
    border: 1px solid var(--wallet-up-lc-border);
    border-radius: 3px;
}

.settings-action-item button {
    width: 100%;
    margin-bottom: 10px;
}

.settings-action-item .dashicons {
    margin-right: 5px;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .settings-actions {
        grid-template-columns: 1fr;
    }

    #copy-login-url {
        display: block;
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Custom Dropdown Styling - Default (Light Theme) */
.js-enhanced-dropdown {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important; 
    top: -9999px !important;
}

.custom-dropdown-container {
    position: relative; 
    width: 100%;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.select-styled {
    padding: 12px 16px;
    padding-right: 40px;
    background: var(--wallet-up-lc-bg-primary);
    border: 2px solid var(--wallet-up-lc-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    color: var(--wallet-up-lc-text-primary);
    transition: var(--wallet-up-lc-transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    min-height: 44px; 
    display: flex;
    align-items: center;
    gap: 12px; 
}

.select-styled:hover {
    border-color: var(--wallet-up-lc-border-hover);
    background: var(--wallet-up-lc-bg-secondary);
}

.select-styled.active {
    border-color: var(--wallet-up-lc-brand);
    background: var(--wallet-up-lc-bg-primary);
    box-shadow: 0 0 0 4px rgba(103, 79, 191, 0.08),
                0 1px 2px rgba(0, 0, 0, 0.02);
    transform: translateY(-1px);
    border-radius: 10px 10px 0 0; 
}

.select-styled:after {
    content: '';
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-color: var(--wallet-up-lc-text-tertiary) transparent transparent transparent;
    position: absolute;
    top: 50%;
    right: 18px;
    margin-top: -2px;
    transition: var(--wallet-up-lc-transition);
    pointer-events: none;
}

.select-styled.active:after {
    transform: translateY(-50%) rotate(180deg);
    border-color: var(--wallet-up-lc-brand) transparent transparent transparent;
}

/* Option Icons (Assuming these are local plugin images - paths are not changed) */
.dropdown-icon {
    width: 55px;
    height: 59px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0; 
}

.icon-standard { background-color: #f0f0f0; }
.icon-vivid { background-color: #8000ff; }
.icon-zenith { background-color: #ff00e1; }
.icon-soiree { background-color: #161633; }
.icon-cybergrid { background-color: #aeff00; }


.select-options {
    position: absolute;
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--wallet-up-lc-bg-primary);
    border: 2px solid var(--wallet-up-lc-border);
    border-radius: 10px;
    box-shadow: var(--wallet-up-lc-shadow-lg);
    z-index: 9990;    
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}


.select-options[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.select-options li {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--wallet-up-lc-transition);
    border-bottom: 1px solid var(--wallet-up-lc-border);
    color: var(--wallet-up-lc-text-primary);
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 12px; 
}

.select-options li:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.select-options li:hover {
    background: var(--wallet-up-lc-bg-secondary);
    color: var(--wallet-up-lc-brand);
    padding-left: 20px;
}

.select-options li.selected {
    background: var(--wallet-up-lc-bg-tertiary);
    color: var(--wallet-up-lc-brand);
    font-weight: 600;
}

.icon-standard {
    background-image: url('../../img/standard-zi2.png');
    background-color: #f0f0f0; 
}

.icon-vivid {
    background-image: url('../../img/vivid-zi2.png');
    background-color: #8000ff;
}

.icon-zenith {
    background-image: url('../../img/zenith-zi2.png');
    background-color: #ff00e1;
}

.icon-soiree {
    background-image: url('../../img/soiree-zi2.png'); 
    background-color: #161633;
}

.icon-cybergrid {
    background-image: url('../../img/cybergrid-zi2.png'); 
    background-color: #aeff00;
}

/* === DARK THEME OVERRIDES === */

@media (prefers-color-scheme: dark) {
    
    /* Diagnostics Actions */
    .wallet-up-lc-diagnostics-actions {
        border-top: 1px solid var(--wallet-up-lc-border);
    }
    
    /* Description text styles */
    .description.info-tip {
        color: #79a1dc; /* Lightened blue */
    }

    .description.warning-tip,
    .force-login-warning {
        color: var(--wallet-up-lc-danger); /* Use danger token */
    }
    
    /* Logo preview */
    .logo-preview {
        border: 1px solid var(--wallet-up-lc-border);
    }

    /* Custom login URL preview */
    #custom-login-url-preview {
        background: var(--wallet-up-lc-bg-tertiary);
        color: var(--wallet-up-lc-text-secondary);
    }
    
    /* Loading message item styles */
    .loading-message input {
        background: var(--wallet-up-lc-bg-primary);
        border: 1px solid var(--wallet-up-lc-border);
        color: var(--wallet-up-lc-text-primary);
    }

    /* Settings panels */
    .settings-panel {
        background: var(--wallet-up-lc-bg-secondary);
        box-shadow: var(--wallet-up-lc-shadow-sm);
    }

    .settings-panel h2, .settings-panel h3 {
        color: var(--wallet-up-lc-text-primary);
    }
    
    .settings-panel h3 {
        border-top: 1px solid var(--wallet-up-lc-border);
    }
    
    /* Settings actions grid */
    .settings-action-item {
        background: var(--wallet-up-lc-bg-tertiary);
        border: 1px solid var(--wallet-up-lc-border);
    }

    /* Custom Dropdown Styling */
    .select-styled {
        background: var(--wallet-up-lc-bg-primary);
        border: 2px solid var(--wallet-up-lc-border);
        color: var(--wallet-up-lc-text-primary);
        box-shadow: var(--wallet-up-lc-shadow-sm);
    }

    .select-styled:hover {
        border-color: var(--wallet-up-lc-border-hover);
        background: var(--wallet-up-lc-bg-secondary);
    }

    .select-styled.active {
        background: var(--wallet-up-lc-bg-primary);
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), /* Use a lightened brand color for glow */
                    var(--wallet-up-lc-shadow-sm);
    }

    .select-styled:after {
        border-color: var(--wallet-up-lc-text-tertiary) transparent transparent transparent;
    }
    
    .select-options {
        background: var(--wallet-up-lc-bg-primary);
        border: 2px solid var(--wallet-up-lc-border);
        box-shadow: var(--wallet-up-lc-shadow-lg);
    }

    .select-options li {
        border-bottom: 1px solid var(--wallet-up-lc-border);
        color: var(--wallet-up-lc-text-primary);
    }

    .select-options li:hover {
        background: var(--wallet-up-lc-bg-secondary);
        color: var(--wallet-up-lc-brand-light); /* Use light brand color for better visibility */
    }

    .select-options li.selected {
        background: var(--wallet-up-lc-bg-tertiary);
        color: var(--wallet-up-lc-brand);
    }
    
    /* Adjust text and background colors for icon placeholders */

.icon-standard {
    background-image: url('../../img/standard-zi2.png');
    background-color: #f0f0f0; 
}

.icon-vivid {
    background-image: url('../../img/vivid-zi2.png');
    background-color: #8000ff;
}

.icon-zenith {
    background-image: url('../../img/zenith-zi2.png');
    background-color: #ff00e1;
}

.icon-soiree {
    background-image: url('../../img/soiree-zi2.png'); 
    background-color: #161633;
}

.icon-cybergrid {
    background-image: url('../../img/cybergrid-zi2.png'); 
    background-color: #aeff00;
}
}