/* Hacker Theme Authentication Styling */
:root {
    --primary-color: #00ff00;
    --secondary-color: #003300;
    --text-color: #00ff00;
    --box-shadow: 0 8px 32px rgba(0, 255, 0, 0.2);
    --bg-dark: #000000;
    --matrix-color: #00ff00;
    --glitch-color: #ff0000;
}

.authentication-content {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    color: var(--matrix-color);
}

/* Ensure background images show through the Matrix effect */
.bg-login {
    background-image: url(../assets/images/bg-login-img.webp);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.bg-register {
    background-image: url(../assets/images/bg-register-img.webp);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.bg-forgot-password {
    background-image: url(../assets/images/bg-register-img.webp);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.bg-reset-password {
    background-image: url(../assets/images/bg-register-img.webp);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.authentication-card {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    max-width: 60rem;
    height: 100vh;
}

.authentication-content .container-fluid {
    margin-top: 150px;
    position: relative;
    z-index: 3; /* Ensure form content is above both matrix and background */
}

/* Matrix Rain Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    pointer-events: none;
    font-family: 'Courier New', monospace;
}

.matrix-rain span {
    color: var(--matrix-color);
    text-shadow: 0 0 10px var(--matrix-color);
    animation: matrix-rain-fall linear infinite;
}

@keyframes matrix-rain-fall {
    0% {
        transform: translateY(-100%);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Animated Background */
.circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.circles li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    animation: animate 25s linear infinite;
    bottom: -150px;
    border-radius: 50%;
}

.circles li:nth-child(1) {
    left: 25%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.circles li:nth-child(2) {
    left: 10%;
    width: 20px;
    height: 20px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.circles li:nth-child(3) {
    left: 70%;
    width: 20px;
    height: 20px;
    animation-delay: 4s;
}

.circles li:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-delay: 0s;
    animation-duration: 18s;
}

.circles li:nth-child(5) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

@keyframes animate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

.card {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--matrix-color);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--matrix-color);
    animation: card-pulse 2s infinite;
}

@keyframes card-pulse {
    0% {
        box-shadow: 0 0 15px var(--matrix-color);
    }
    50% {
        box-shadow: 0 0 30px var(--matrix-color);
    }
    100% {
        box-shadow: 0 0 15px var(--matrix-color);
    }
}

.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--matrix-color);
    animation: border-scan 2s linear infinite;
}

@keyframes border-scan {
    0% {
        clip-path: inset(0 0 98% 0);
    }
    25% {
        clip-path: inset(0 98% 0 0);
    }
    50% {
        clip-path: inset(98% 0 0 0);
    }
    75% {
        clip-path: inset(0 0 0 98%);
    }
    100% {
        clip-path: inset(0 0 98% 0);
    }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.card-title {
    color: var(--matrix-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--matrix-color);
    animation: glitch 3s infinite, flicker 0.3s infinite;
}

.card-text {
    color: var(--matrix-color);
    animation: fadeIn 0.5s ease 0.2s both;
    font-family: 'Courier New', monospace;
    opacity: 0.8;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
                     0.025em 0.04em 0 var(--matrix-color);
    }
    15% {
        text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
                     0.025em 0.04em 0 var(--matrix-color);
    }
    16% {
        text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
                     -0.05em -0.05em 0 var(--matrix-color);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
                     -0.05em -0.05em 0 var(--matrix-color);
    }
    50% {
        text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
                     0 -0.04em 0 var(--matrix-color);
    }
    99% {
        text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
                     0 -0.04em 0 var(--matrix-color);
    }
    100% {
        text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff,
                     -0.04em -0.025em 0 var(--matrix-color);
    }
}

.form-control {
    border: 1px solid var(--matrix-color);
    padding: 0.8rem 1rem;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.7);
    color: var(--matrix-color);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px var(--matrix-color);
}

.form-control:focus {
    border-color: var(--matrix-color);
    box-shadow: 0 0 15px var(--matrix-color);
    background: rgba(0, 0, 0, 0.9);
    animation: input-scan 1s linear infinite;
}

@keyframes input-scan {
    0% {
        border-color: transparent;
        border-top-color: var(--matrix-color);
    }
    25% {
        border-color: transparent;
        border-right-color: var(--matrix-color);
    }
    50% {
        border-color: transparent;
        border-bottom-color: var(--matrix-color);
    }
    75% {
        border-color: transparent;
        border-left-color: var(--matrix-color);
    }
    100% {
        border-color: transparent;
        border-top-color: var(--matrix-color);
    }
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--matrix-color);
    padding: 0.8rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--matrix-color);
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--matrix-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--matrix-color);
    background: rgba(0, 255, 0, 0.1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--matrix-color);
    animation: scan-line 2s linear infinite;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--matrix-color);
    opacity: 0;
    transition: 0.3s;
}

@keyframes scan-line {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.btn-primary:hover::after {
    left: 100%;
}

.search-icon {
    color: var(--primary-color);
    z-index: 2;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-label {
    color: #555;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
}

.is-invalid {
    border-color: #dc3545;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.text-danger {
    animation: fadeIn 0.3s ease;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

/* Alert Styling */
.alert {
    animation: slideDown 0.5s ease;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    box-shadow: var(--box-shadow);
}

/* Watermark */
.authentication-content::before {
    content: "DhaMus WA GateWay v9";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 5em;
    color: rgba(0, 255, 0, 0.05);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 5px;
    animation: watermark-pulse 4s infinite;
}

@keyframes watermark-pulse {
    0% { opacity: 0.03; }
    50% { opacity: 0.07; }
    100% { opacity: 0.03; }
}

/* Multiple layers of watermark for better visibility */
.authentication-content::after {
    content: "DhaMus WA GateWay v9";
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 3em;
    color: rgba(0, 255, 0, 0.03);
    white-space: nowrap;
    pointer-events: none;
    z-index: 999;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: watermark-pulse 4s infinite reverse;
}

.card::after {
    content: "DhaMus WA GateWay v9";
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.6em;
    color: rgba(0, 255, 0, 0.1);
    pointer-events: none;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}
