/* 🔐 SECRET KEYPAD STYLES 🔐 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff);
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow:
        0 0 15px rgba(255, 0, 110, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ff1a7a, #9547f0, #4a94ff);
    box-shadow:
        0 0 25px rgba(255, 0, 110, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #ff006e rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff, #06ffa5);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ANIMATED WATERMARK BACKGROUND */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 300%;
    height: 300%;
    background-image: url('../assets/ICON.png');
    background-size: 60px 60px;
    background-repeat: repeat;
    background-position: 60px 60px;
    opacity: 0.04;
    z-index: 1;
    animation: watermarkMoveReverse 15s linear infinite;
    pointer-events: none;
    rotate: 45deg;
}

@keyframes watermarkMoveReverse {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(60px, 0px);
    }
}

.container {
    z-index: 10;
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

/* KEYPAD CONTAINER */
.keypad-container {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* LOGO SECTION */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.keypad-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 20px rgba(255, 0, 110, 0.6));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

.keypad-title {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
    margin-bottom: 10px;
    animation: titlePulse 2s ease-in-out infinite;
    text-align: center;
    line-height: 1.2;
    word-spacing: 0.1em;
}

@keyframes titlePulse {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }
}

.keypad-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

/* CODE DISPLAY */
.code-display {
    text-align: center;
    margin-bottom: 40px;
}

.code-dots {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    transition: all 0.3s ease;
}

.dot.filled {
    background: linear-gradient(45deg, #ff006e, #8338ec);
    border-color: #ff006e;
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.6);
    animation: dotFill 0.3s ease-out;
}

@keyframes dotFill {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.status-message {
    font-size: 0.9rem;
    min-height: 20px;
    font-weight: 500;
}

.status-message.error {
    color: #ff4757;
    animation: shake 0.5s ease-in-out;
}

.status-message.success {
    color: #06ffa5;
    animation: successGlow 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes successGlow {

    0%,
    100% {
        text-shadow: 0 0 5px #06ffa5;
    }

    50% {
        text-shadow: 0 0 20px #06ffa5, 0 0 30px #06ffa5;
    }
}

/* KEYPAD GRID */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.key-btn {
    width: 100%;
    height: 60px;
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.key-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.key-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.key-btn:hover::before {
    left: 100%;
}

.key-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.clear-btn {
    background: linear-gradient(145deg, rgba(255, 71, 87, 0.2), rgba(255, 71, 87, 0.1));
    border-color: rgba(255, 71, 87, 0.3);
}

.clear-btn:hover {
    background: linear-gradient(145deg, rgba(255, 71, 87, 0.3), rgba(255, 71, 87, 0.15));
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.2);
}

.submit-btn {
    background: linear-gradient(145deg, rgba(6, 255, 165, 0.2), rgba(6, 255, 165, 0.1));
    border-color: rgba(6, 255, 165, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(145deg, rgba(6, 255, 165, 0.3), rgba(6, 255, 165, 0.15));
    box-shadow: 0 8px 25px rgba(6, 255, 165, 0.2);
}

/* BACK BUTTON */
.back-section {
    text-align: center;
}

.back-btn {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* RESPONSIVE DESIGN */
/* Medium screens - tablets */
@media (max-width: 768px) {
    .keypad-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .keypad-container {
        padding: 30px 20px;
    }

    .keypad-title {
        font-size: 1.4rem;
        line-height: 1.1;
    }

    .key-btn {
        height: 55px;
        font-size: 1.2rem;
    }

    .code-dots {
        gap: 12px;
    }

    .dot {
        width: 18px;
        height: 18px;
    }
}

/* ACCESS OPTIONS */
.access-options {
    margin-top: 25px;
    text-align: center;
}

.access-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.dungeon-link {
    color: #06ffa5;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.dungeon-link:hover {
    color: #fff;
    border-bottom-color: #06ffa5;
    text-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
}

/* Extra small screens - handle very narrow screens */
@media (max-width: 320px) {
    .keypad-title {
        font-size: 1.2rem;
        letter-spacing: -0.5px;
        line-height: 1.1;
    }

    .keypad-container {
        padding: 20px 15px;
    }
}

.dungeon-link:hover {
    color: #3affb5;
    border-bottom-color: #06ffa5;
    text-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
}