/*CODE COMPLETED*/

/*Popup Animation*/
@keyframes popupAnimationOpen {
    0% { top: 45%; transform: translate(-50%, -50%) scale(0.95); opacity: 0; visibility: hidden; }
    100% { top: 50%; transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
}

@keyframes popupAnimationClose {
    0% { top: 50%; transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
    100% { top: 55%; transform: translate(-50%, -50%) scale(0.95); opacity: 0; visibility: hidden; }
}

/*Links CSS*/
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0 40px 40px 40px;
    border-radius: 20px;
    border: solid 2px rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg,
            rgba(50, 50, 50, 0.5),
            rgba(0, 0, 0, 0.5));
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
}

.popup.show {
    animation: popupAnimationOpen 0.5s forwards;
}

.popup.hide {
    animation: popupAnimationClose 0.5s forwards;
}

#popupBackgroundBlur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    z-index: 50;
}

#noiseTexture2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 700' width='700' height='700' opacity='0.1'><defs><filter id='nnnoise-filter' x='-20%' y='-20%' width='140%' height='140%' filterUnits='objectBoundingBox' primitiveUnits='userSpaceOnUse' color-interpolation-filters='linearRGB'><feTurbulence type='fractalNoise' baseFrequency='0.2' numOctaves='4' seed='15' stitchTiles='stitch' x='0%' y='0%' width='100%' height='100%' result='turbulence'></feTurbulence><feSpecularLighting surfaceScale='11' specularConstant='0.9' specularExponent='20' lighting-color='%23ffffff' x='0%' y='0%' width='100%' height='100%' in='turbulence' result='specularLighting'><feDistantLight azimuth='3' elevation='103'></feDistantLight></feSpecularLighting></filter></defs><rect width='700' height='700' fill='transparent'></rect><rect width='700' height='700' fill='%23ffffff' filter='url(%23nnnoise-filter)'></rect></svg>");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 70;
}

.popup,
#popupBackgroundBlur,
#noiseTexture2 {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.5s;
}

.popup.show,
#popupBackgroundBlur.show,
#noiseTexture2.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/*Links Title*/
.popup-title {
    font-weight: bold;
    text-align: center;
    color: #FFFFFF;
    font-size: 40px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/*Links Position*/
.popup-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/*Links Design*/
.popup a {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-direction: column;
    text-decoration: none;
    font-size: 18px;
    gap: 16px;
    color: rgba(255, 255, 255, 1);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.025),
            rgba(0, 0, 0, 0.05));
    box-shadow:
        5px 5px 20px rgba(0, 0, 0, 0.6),
        -5px -5px 20px rgba(255, 255, 255, 0.25);
    border: solid 2px rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    width: clamp(150px, 20vw, 200px);
    height: 120px;
    transition: 0.75s;
}

/*Social Media Icons*/
.popup a i {
    font-size: 36px;
    display: block;
}

.popup a:hover {
    border: solid 2px rgba(255, 255, 255, 1);
    border-radius: 15px;
    transform: scale(1.1);
    transition: 0.25s;
}

/*Ko-fi*/
.popup a[href*="ko-fi"] {
    color: #FF6433;
}

.popup a[href*="ko-fi"]:hover {
    background-color: #FF6433;
    box-shadow: 0 0 30px #FF6433;
    color: #FFF;
}

/*Webtoon*/
.popup a[href*="webtoons"] {
    color: #00DC64;
}

.popup a[href*="webtoons"]:hover {
    background-color: #00DC64;
    box-shadow: 0 0 30px #00DC64;
    color: #FFF;
}

/*X/Twitter*/
.popup a[href*="x.com"] {
    color: #FFFFFF;
}

.popup a[href*="x.com"]:hover {
    background-color: #000000;
    box-shadow: 0 0 30px #FFFFFF;
    color: #FFF;
}

/*Instagram*/
.popup a[href*="instagram"] {
    color: #C13584;
}

.popup a[href*="instagram"]:hover {
    background-color: #C13584;
    box-shadow: 0 0 30px #C13584;
    color: #FFF;
}

/*Pinterest*/
.popup a[href*="pinterest"] {
    color: #BD081C;
}

.popup a[href*="pinterest"]:hover {
    background-color: #BD081C;
    box-shadow: 0 0 30px #BD081C;
    color: #FFF;
}

/*Linktree*/
.popup a[href*="linktr.ee"] {
    color: #138E3E;
}

.popup a[href*="linktr.ee"]:hover {
    background-color: #138E3E;
    box-shadow: 0 0 30px #138E3E;
    color: #FFF;
}

#popupBackgroundBlur.show {
    display: block;
    opacity: 1;
}

.popup.show {
    display: block;
    opacity: 1;
}

/*Close Button*/
#closePopup {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    padding: 0;
    transform-origin: center;
    transition: 0.75s ease-out;
    z-index: 110;
}

#closePopup::before,
#closePopup::after {
    content: "";
    position: absolute;
    width: 45px;
    height: 6px;
    background-color: #FFFFFF;
    border-radius: 6px;
    transition: 0.75s;
}

#closePopup::before {
    transform: rotate(45deg);
}

#closePopup::after {
    transform: rotate(-45deg);
}

#closePopup:hover::before,
#closePopup:hover::after {
    background-color: #FFF4DB;
    box-shadow:
        0 0 30px #b4b4b4,
        -2px -2px 8px rgb(255, 255, 255, 0.15),
        2px 2px 5px rgba(255, 255, 255, 0.15);
    transition: 0.25s;
}

#closePopup:hover {
    transform: rotate(90deg) scale(1.2);
    transition: 0.5s;
}