/**
 * Password Security Check - Frontend Styles
 */

/* Password strength meter */
.psc-strength-meter {
    margin-top: 8px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

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

.psc-strength-bar.weak {
    background: linear-gradient(135deg, #dc3545, #c82333);
    width: 25%;
}

.psc-strength-bar.medium {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    width: 50%;
}

.psc-strength-bar.strong {
    background: linear-gradient(135deg, #28a745, #218838);
    width: 75%;
}

.psc-strength-bar.very-strong {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    width: 100%;
}

/* Message container */
.psc-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    display: none;
}

.psc-message.info {
    background: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

.psc-message.success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.psc-message.warning {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.psc-message.error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Password field states */
input[type="password"].psc-safe {
    border-color: #28a745 !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%2328a745" viewBox="0 0 16 16"><path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px !important;
}

input[type="password"].psc-unsafe {
    border-color: #dc3545 !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23dc3545" viewBox="0 0 16 16"><path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px !important;
}

/* Loading animation */
@keyframes psc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.psc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: psc-spin 1s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

/* Submit button states */
button.psc-disabled,
input[type="submit"].psc-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

/* WooCommerce specific styles */
.woocommerce form .psc-message {
    margin-bottom: 0;
    margin-top: 5px;
}

.woocommerce form .psc-strength-meter {
    margin-bottom: 10px;
}

/* BuddyPress specific styles */
#buddypress .psc-message {
    margin: 5px 0;
}

#buddypress .psc-strength-meter {
    margin: 5px 0 10px 0;
}

/* Ultimate Member specific styles */
.um-form .psc-message {
    margin: 5px 0;
    font-size: 12px;
}

.um-form .psc-strength-meter {
    margin: 5px 0 10px 0;
}

/* MemberPress specific styles */
.mepr-form .psc-message {
    margin: 5px 0;
}

.mepr-form .psc-strength-meter {
    margin: 5px 0 10px 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .psc-message {
        font-size: 12px;
        padding: 6px 10px;
    }

    input[type="password"].psc-safe,
    input[type="password"].psc-unsafe {
        background-position: right 8px center;
        padding-right: 30px !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .psc-strength-meter {
        background: #343a40;
    }

    .psc-message.info {
        background: #031633;
        color: #6ea8fe;
        border-color: #084298;
    }

    .psc-message.success {
        background: #051b11;
        color: #75b798;
        border-color: #0f5132;
    }

    .psc-message.warning {
        background: #332701;
        color: #ffecb5;
        border-color: #664d03;
    }

    .psc-message.error {
        background: #2c0b0e;
        color: #ea868f;
        border-color: #842029;
    }
}

/* Password visibility toggle (optional enhancement) */
.psc-password-toggle {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.psc-password-toggle:hover {
    opacity: 1;
}

.psc-password-wrapper {
    position: relative;
}

/* Tooltip for password requirements */
.psc-requirements {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 12px;
    min-width: 250px;
    display: none;
}

.psc-requirements.show {
    display: block;
}

.psc-requirements ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.psc-requirements li {
    padding: 3px 0;
    color: #666;
}

.psc-requirements li.met {
    color: #28a745;
}

.psc-requirements li.met::before {
    content: "✓ ";
    font-weight: bold;
}

.psc-requirements li.unmet::before {
    content: "✗ ";
    color: #dc3545;
    font-weight: bold;
}