/**
 * Password visibility toggle styles
 * Shared across login and registration pages
 */

/* Password Field with Toggle Button */
.password-field-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
    overflow: hidden;
}

.password-toggle:hover {
    color: #6f6f6f;
    background-color: rgba(111, 111, 111, 0.1);
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 2px rgba(111, 111, 111, 0.3);
}

.password-toggle i {
    font-size: 1.2rem;
    position: absolute;
    transition: all 0.3s ease;
}

.password-toggle .fa-eye {
    opacity: 1;
    transform: scale(1);
}

.password-toggle .fa-eye-slash {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.password-toggle.active .fa-eye {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.password-toggle.active .fa-eye-slash {
    opacity: 1;
    transform: scale(1) rotate(0);
    color: #ffffff;
}

/* Password toggle timer countdown */
.visibility-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.password-toggle.timer-active {
    background-color: rgba(160, 32, 240, 0.1);
}

.visibility-countdown svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.visibility-countdown circle {
    fill: none;
    stroke-width: 3;
}

.visibility-countdown .circle-bg {
    stroke: rgba(160, 32, 240, 0.2);
}

.visibility-countdown .circle-timer {
    stroke: #4f4d4e;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
    stroke-dasharray: 100.53;  /* 2 * PI * r where r=16 */
}

.visibility-countdown .countdown-number {
    position: relative;
    z-index: 12;
    font-family: monospace;
    color: #4f4d4e;
    font-size: 13px;
    font-weight: bold;
}

.visibility-countdown.ending .circle-timer {
    stroke: #ff4d4d;
}

.visibility-countdown.ending .countdown-number {
    color: #ff4d4d;
}

/* Cool ripple effect on click */
.toggle-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(111, 111, 111, 0.4) 0%, rgba(160, 32, 240, 0) 70%);
    border-radius: 50%;
    transform: scale(0);
    opacity: 1;
    transition: all 0.5s ease-out;
    pointer-events: none;
}

.password-toggle.clicked .toggle-ripple {
    transform: scale(3);
    opacity: 0;
}

/* Adjust form control padding for password fields */
.password-field-container .form-control {
    padding-right: 50px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-warning {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.visibility-countdown.ending {
    animation: pulse-warning 0.5s infinite;
}

/* New warning bounce animation for the eye icon */
@keyframes bounce-warning {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
    50% { transform: translateY(0); }
    70% { transform: translateY(-2px); }
}

.password-toggle.warning-bounce .fa-eye-slash {
    animation: bounce-warning 1s infinite;
    color: #ff6b6b; /* Change color to reddish to indicate warning */
}
