/**
 * Taiwan Security Password Strength Meter Styles
 */

.taiwan-security-password-meter {
    margin-top: 8px;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

/* Password strength bar */
.password-strength-bar {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

/* Strength levels with colors */
.password-strength-fill.strength-weak {
    background-color: #dc3232;
    background-image: linear-gradient(45deg, #dc3232 0%, #e74c3c 100%);
}

.password-strength-fill.strength-fair {
    background-color: #ffb900;
    background-image: linear-gradient(45deg, #ffb900 0%, #f39c12 100%);
}

.password-strength-fill.strength-good {
    background-color: #00a0d2;
    background-image: linear-gradient(45deg, #00a0d2 0%, #3498db 100%);
}

.password-strength-fill.strength-strong {
    background-color: #46b450;
    background-image: linear-gradient(45deg, #46b450 0%, #27ae60 100%);
}

.password-strength-fill.strength-perfect {
    background-color: #00a32a;
    background-image: linear-gradient(45deg, #00a32a 0%, #27ae60 100%);
}

/* Strength label */
.password-strength-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #50575e;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

/* Neutral state for empty password */
.password-strength-label:not([class*="strength-"]) {
    color: #646970;
    text-transform: none;
    font-weight: 400;
    font-size: 12px;
    font-style: italic;
}

/* Dynamic label colors based on strength */
.password-strength-label.strength-weak {
    color: #dc3232;
}

.password-strength-label.strength-fair {
    color: #ffb900;
}

.password-strength-label.strength-good {
    color: #00a0d2;
}

.password-strength-label.strength-strong {
    color: #46b450;
}

.password-strength-label.strength-perfect {
    color: #00a32a;
}

/* Requirements list */
.password-requirements {
    margin-top: 8px;
}

.requirement {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    transition: color 0.2s ease;
    font-size: 12px;
}

.requirement-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.requirement-text {
    color: #50575e;
    flex: 1;
}

/* Requirement states */
.requirement-unmet .requirement-icon {
    background-color: #dc3232;
    color: #ffffff;
}

.requirement-unmet .requirement-text {
    color: #646970;
}

.requirement-met .requirement-icon {
    background-color: #46b450;
    color: #ffffff;
}

.requirement-met .requirement-text {
    color: #135e96;
    font-weight: 500;
}

/* WordPress admin styling compatibility */
.wp-admin .taiwan-security-password-meter {
    max-width: 25em;
}

/* Profile page specific styling */
.user-pass1-wrap .taiwan-security-password-meter,
.user-pass-wrap .taiwan-security-password-meter {
    margin-left: 0;
    margin-right: 0;
}

/* Registration page specific styling */
.login form .taiwan-security-password-meter {
    margin-top: 12px;
}

/* Responsive design */
@media screen and (max-width: 782px) {
    .taiwan-security-password-meter {
        font-size: 12px;
    }
    
    .requirement {
        font-size: 11px;
    }
    
    .requirement-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}

/* Focus states for accessibility */
.taiwan-security-password-meter:focus-within .password-strength-bar {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px #007cba;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .password-strength-bar {
        background-color: #000000;
        border: 1px solid #ffffff;
    }
    
    .password-strength-fill {
        border: 1px solid #000000;
    }
    
    .requirement-icon {
        border: 1px solid #000000;
    }
}

/* Dark mode support (for themes that support it) */
@media (prefers-color-scheme: dark) {
    .taiwan-security-password-meter {
        color: #e0e0e0;
    }
    
    .password-strength-bar {
        background-color: #2c3338;
    }
    
    .password-strength-label {
        color: #e0e0e0;
    }
    
    /* Dark mode neutral state */
    .password-strength-label:not([class*="strength-"]) {
        color: #a7aaad;
    }
    
    /* Dark mode strength label colors (slightly muted for better contrast) */
    .password-strength-label.strength-weak {
        color: #f56565;
    }
    
    .password-strength-label.strength-fair {
        color: #ed8936;
    }
    
    .password-strength-label.strength-good {
        color: #4299e1;
    }
    
    .password-strength-label.strength-strong {
        color: #68d391;
    }
    
    .password-strength-label.strength-perfect {
        color: #48bb78;
    }
    
    .requirement-text {
        color: #c3c4c7;
    }
    
    .requirement-unmet .requirement-text {
        color: #8c8f94;
    }
    
    .requirement-met .requirement-text {
        color: #72aee6;
    }
}

/* Animation for strength meter fill */
@keyframes strengthFill {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.password-strength-fill {
    transform-origin: left;
    animation: strengthFill 0.3s ease-out;
}

/* Hover effects for interactive elements */
.requirement:hover .requirement-text {
    color: #135e96;
}

.requirement-met:hover .requirement-text {
    color: #0073aa;
}

/* Print styles */
@media print {
    .taiwan-security-password-meter {
        display: none;
    }
}

/* Current Password Field Styles */
.taiwan-security-current-password-row,
.taiwan-security-current-password-div {
    margin-bottom: 20px;
}

.taiwan-security-current-password-row th {
    vertical-align: top;
    padding-top: 15px;
}

.taiwan-security-current-password-row td {
    position: relative;
}

.taiwan-security-current-password-div .user-pass0-wrap {
    margin-bottom: 20px;
}

.taiwan-security-current-password-div .user-pass0-wrap label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    color: #23282d;
}

/* Current password field styling */
input[name="pass0"],
input[id="pass0"] {
    width: 100%;
    max-width: 25em;
    margin-bottom: 5px;
    padding: 3px 8px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background-color: #fff;
    color: #2c3338;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[name="pass0"]:focus,
input[id="pass0"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: 2px solid transparent;
}

/* Error state styling */
input[name="pass0"].error,
input[id="pass0"].error {
    border-color: #dc3232;
    box-shadow: 0 0 0 1px #dc3232;
}

/* Field error message */
.taiwan-security-field-error {
    color: #dc3232 !important;
    font-size: 13px !important;
    margin-top: 5px !important;
    display: block;
    line-height: 1.4;
}

/* Password notice styling */
.taiwan-security-password-notice {
    margin: 15px 0 20px 0 !important;
    padding: 12px !important;
    border-left: 4px solid #72aee6 !important;
    background-color: #f0f6fc !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.taiwan-security-password-notice p {
    margin: 0 !important;
    color: #1d2327;
    line-height: 1.5;
}

/* Password requirement context styling */
.taiwan-security-current-password-row .description,
.taiwan-security-current-password-div .description {
    color: #646970;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Mobile responsive styles */
@media screen and (max-width: 782px) {
    .taiwan-security-current-password-row th,
    .taiwan-security-current-password-row td {
        display: block;
        width: 100%;
        padding: 0;
    }
    
    .taiwan-security-current-password-row th {
        margin-bottom: 10px;
    }
    
    input[name="pass0"],
    input[id="pass0"] {
        max-width: 100%;
    }
    
    .taiwan-security-password-notice {
        margin: 10px 0 15px 0 !important;
        padding: 10px !important;
    }
}

/* WordPress table layout compatibility */
.wp-admin table.form-table .taiwan-security-current-password-row th {
    width: 200px;
    padding-right: 10px;
}

.wp-admin table.form-table .taiwan-security-current-password-row td {
    padding-left: 10px;
    padding-right: 10px;
}

/* User edit page specific styling */
.user-edit-php .taiwan-security-current-password-row,
.profile-php .taiwan-security-current-password-row {
    border-bottom: 1px solid #c3c4c7;
}

/* Animation for field insertion */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.taiwan-security-current-password-row,
.taiwan-security-current-password-div {
    animation: slideIn 0.3s ease-out;
}

/* Focus management for accessibility */
.taiwan-security-current-password-row:focus-within,
.taiwan-security-current-password-div:focus-within {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Clear WordPress default styling conflicts */
.taiwan-security-current-password-row .wp-pwd input[type="password"],
.taiwan-security-current-password-div .wp-pwd input[type="password"] {
    margin: 0;
    width: 100%;
} 