/* START General style */
:root{
    --dark-text: #fff;
    --text: #222;
    --dark-hover: #fff;
    --hover: #b1b1b1;
    --dark-bg: #333;
    --bg: #e9e9e9;
    --dark-hero-bg: #2c2e43;
    --hero-bg: #bbb6b6;
}

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

a {
    text-decoration: none;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

input {
    color: rgb(102, 102, 102);
    padding: 0;
    margin: 0;
}

.cell input.active {
    border-color: rgb(252, 93, 14);
}

.cell input.succeeded {
    border: 4px solid rgb(25, 237, 57);
}

body {
    background: var(--bg);
    font-family: cursive, Arial, Helvetica, sans-serif;
}

.dark body{
    background: var(--dark-bg);
}

/* END General style */

/* START Menu style */
/* START Menu-style.General Style */
#nav-bar{
    background-color: var(--bg);
    text-align: center;
    opacity: 0.9;
    z-index: 2;
    justify-content: center;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-grow: 1;
    justify-content: flex-start;
    gap: 50px;
    margin-left: 100px;
    right: 10px;
}

.dark #nav-bar {
    background-color: var(--dark-bg);
}


#nav-bar li {
    position: relative;
    color: var(--text);
    padding: 15px 20px;
    display: inline-block;
    min-width: 105px;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
}

.dark #nav-bar li {
    color: var(--dark-text);
}

#nav-bar a {
    width: 350px;
    display: flex;
    align-items: center;
    text-align: center;
    cursor: default;
}

#nav-bar h2 {
    color: var(--text);
    font-family: cursive;
    padding: 10px;
    font-size: 35px;
    width: max-content;
}

.dark #nav-bar h2 {
    color: var(--dark-text);
}

#nav-bar h2:hover {
    text-decoration: underline;
    cursor: pointer;
}

#nav-icons{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 30px;
}
    
#nav-icons button {
    border: none;
    background: none;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4em;
}

#nav-bar li:hover {
    border-radius: 16px 16px 0 0;
    background-color: var(--hover);
    color: var(--text);
    cursor: pointer;
}

.dark #nav-bar li:hover {
    background-color: var(--dark-hover);
    color: var(--text);
}

#nav-bar li:hover .sub-menu {
    display: block;
}

.sub-menu {
    position: absolute;
    left: 0;
    top: 53px;
    background-color: var(--bg);
    display: none;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 0 0 16px 16px;
}

.dark .sub-menu {
    background-color: var(--dark-bg);
}

.sub-menu li.speed-options:hover {
    /* border-radius: 0 0 16px 16px !important; */
    border-radius: 55% !important;
    opacity: 0.9;
}

i.fa-moon{
    color: #222;
}

i.fa-sun{
    color: #f1f1f1;
}

#nav-bar li:nth-child(n+5){
    display: flex;
}

/* Initial state */
#nav-bar li:nth-child(4) i {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* Hovered state */
#nav-bar li:nth-child(4):hover i {
    transform: rotate(180deg);
}

#nav-bar li:hover .algo-sub-menu {
    display: block;
}

/* END Menu-Style */

/* START main div style */
#main {
    margin-top: 40px;
    text-align: center;
    z-index: 0;
}
/* END main-div.General Style */

/* START main-div.Table style */
#grid {
    margin: auto;
    border-collapse: collapse;
    width: 486px;
    height: 495px;
}

table {
    margin: 1em auto;
}

td {
    height: 30px;
    width: 30px;
    text-align: center;
    padding: 0;
    margin:0px;
}

td:first-child {
    border-left: 0px solid rgb(24, 24, 24);
}

td:nth-child(3n) {
    border-right: 3px solid rgb(0, 0, 0);
}

tr:first-child {
    border-top: 0px solid rgb(24, 24, 24);
}

tr:nth-child(3n) td {
    border-bottom: 0px solid rgb(24, 24, 24);
}

.cell {
    border: 2px solid black;
    transition: scale 0.25s ease;
}

.cell:hover {
    scale: 1.1;
}

.cell input {
    opacity: 0.9;
    display: inline-block;
    border-radius: 8px;
    margin: 0px;
    width: 45px;
    height: 45px;
    text-align: center;
    font-size: 35px;
    outline: none;
    border: 2px solid;
}

/* Class to apply the shake animation */
.shake {
    animation: shake 0.5s ease;
}

/* Keyframes for the shake animation */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

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

/* When invalid input entered by user */
.invalid {
    border: 3px solid red !important;
}

/* END main-div.Table style */

/* Social link */
#right-socials {
    position: absolute;
    right: 1em;
    height: 150px;
    width: 70px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    justify-content: space-around;
    top: 50%;
    transform: translateY(-50%);
}

#right-socials a i {
    transition: scale .3s ease-in-out;
}

#right-socials a i#github-link:hover,
i#linkedin-link:hover {
    scale: 1.1;
}

/* Skeleton styles */
.skeleton {
    background-color: #ddd;
    border-radius: 4px;
    margin: 8px 0;
    opacity: 0.7;
    animation: shimmer 1.5s infinite;
}

.skeleton-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto;
}

.skeleton-text {
    width: 80%;
    height: 14px;
    margin: 8px auto;
}

/* Animation for the shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
}

.social-card {
    display: none;
    position: absolute;
    bottom: 100%;
    left: -150px;
    width: 200px;
    padding: 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid #ddd;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 10;
    font-size: 14px;
    text-align: center;
}

.dark .social-card {
    background: var(--dark-bg);
    color: var(--dark-text)
}

.social-card img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

.social-card a {
    display: block;
    color: #0073e6;
    text-decoration: none;
}

.social-card a:hover {
    text-decoration: underline;
}

#right-socials a {
    margin-right: 20px;
    position: relative;
}

#right-socials a:hover .social-card {
    display: block;
}

/* Footer stylings */
.footer {
    position: fixed;
    padding: 10px;
    bottom: 0;
    width: 100%;
    background: var(--bg);
    text-align: center;
    color: var(--dark-bg);
}

.dark .footer {
    background: var(--dark-bg);
    color: var(--bg);
}

.footer a {
    color: var(--text);
    text-decoration: none;
}

.dark .footer a {
    color: var(--dark-text);
}

.footer a:hover {
    color: #1962eadf;
    text-decoration: underline;
}

.tutorial{
    position: fixed;
    float: inline-start;
    padding-left: 25px;
    cursor: pointer;
}

.line {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.line div {
    width: 25px;
    height: 3px;
    background-color: var(--text);
    margin: 4px 0;
    transition: 0.4s;
}

.dark .line div {
    background-color: var(--dark-text);
}
/* Hamburger Active State */
.change .bar1 {
    transform: rotate(-45deg) translate(-10px, 8px);
}

.change .bar2 {
    opacity: 0;
}

.change .bar3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/*  PARTICLE.JS CSS */
canvas {
    display: block;
    /* vertical-align: bottom; */
}

/* ---- particles.js container ---- */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--hero-bg);
    background-image: url("");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
}

.dark #particles-js {
    background-color: var(--dark-hero-bg);
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-links {
        flex-direction: column;
        align-items: center;
        position: absolute;
        padding:10px;
        top: 20px;
        right: 0;
        gap: 10px;
        width: 100%;
        /* background-color: #a4a4a4b5; */
        background-color: var(--bg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    }

    .dark .nav-links{
        background-color: var(--dark-bg);
    }


    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links li {
        margin: 10px 0;
    }

    .line {
        display: flex;
        margin-right: 20px;
    }
}


@media screen and (max-width:768px) {
    #right-socials{
        position: fixed;
        top: 87%;
        bottom: 10px;
        height: 70px;
        width: 150px;
        flex-direction: row;
        left: 50%;
        transform: translateX(-50%);
    }
  }

/* Toast CSS */
.toast {
    position: absolute;
    top: 25px;
    left: calc(50% - 12em);
    /* transform: translateX(-50%); */
    max-width: 450px;
    background: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: -1px 1px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease-in-out forwards, fadeOut 0.5s ease-in-out forwards 3s;
}

.toast.closing {
    animation: slideOutRight 0.5s ease-in-out forwards;
}

.toast-progress {
    position: absolute;
    display: block;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: #b7b7b7;
    animation: toastProgress 3s ease-in-out forwards;
}

.toast-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-icon {
    padding: 0.35rem 0.5rem;
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: #000000;
    padding: 0.5rem;
}

.toast.toast-success {
    background: #95eab8;
}

.toast.toast-success .toast-progress {
    background-color: #2ecc71;
}

.toast.toast-danger {
    background: #efaca5;
}

.toast.toast-danger .toast-progress {
    background-color: #e74c3c;
}

.toast.toast-info {
    background: #bddaed;
}

.toast.toast-info .toast-progress {
    background-color: #3498db;
}

.toast.toast-warning {
    background: #e7d27c;
}

.toast.toast-warning .toast-progress {
    background-color: #f1ad0f;
}

@keyframes slideInRight {
    0% {
        transform: translateY(-110%);
    }

    75% {
        transform: translateY(70%);
    }

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

@keyframes slideOutRight {
    0% {
        transform: translateY(0%);
    }

    25% {
        transform: translateY(10%);
    }

    100% {
        transform: translateY(110%);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes toastProgress {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}