#grid{
    display: grid;
    gap: 1px;
    background-color: #313244; /* Grid border color */
    border: 1px solid #313244;
    border-radius: 4px;
    overflow: hidden;
}

.none{
    display: none !important;
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    font-size: 20px;
    z-index: 9999;
}

#loading-overlay.none {
    display: none;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


button{
    border-radius: 8px;
    padding: 10px 15px;
    background-color: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
button:hover {
    background-color: #45475a;
}
.sel-btn{
    background-color: #89b4fa;
    color: #11111b;
    border-color: #89b4fa;
    font-weight: bold;
}
.sel-btn:hover {
    background-color: #b4befe;
}



header{
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #181825;
    color: #f5e0dc;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    border-bottom: 1px solid #313244;
}
header .logo-container {
    margin-left: 20px;
    display: flex;
    align-items: center;
}
header .logo {
    height: 50px;
    border-radius: 5px;
    background-color: white; /* Contrast for the logo */
    padding: 2px;
}
header nav {
    display: flex;
    gap: 20px;
    margin-right: 20px;
}
header nav a {
    color: #cdd6f4;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}
header nav a:hover {
    color: #89b4fa;
}
footer{
    width: 100%;
    background-color: #181825;
    color: #a6adc8;
    position: fixed;
    bottom: 0px;
    left: 0px;
    height: 60px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    box-shadow: 0 -4px 6px rgba(0,0,0,0.2);
    border-top: 1px solid #313244;
    z-index: 100;
}
footer a {
    color: #89b4fa;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}
footer a:hover {
    color: #b4befe;
}
body{
    min-height:100vh;
    background-color: #0f111a;
    color: #cdd6f4;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.main{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width:100%;
    margin-bottom:60px;
}
/* .main>div{
    width: 100%;
} */

#first-info {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: #181825;
    border: 1px solid #313244;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    max-width: 400px;
    width: 100%;
}

#first-info>div{
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#first-info>div>input{
    margin-left: 20px;
    border: 1px solid #45475a;
    background-color: #1e1e2e;
    color: #cdd6f4;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#first-info>div>input:focus{
    border-color: #89b4fa;
    box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.3);
}

#first-info>div>button{
    width: 100%;
    background: linear-gradient(135deg, #89b4fa, #cba6f7);
    color: #11111b;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.1s;
}

#first-info>div>button:hover{
    opacity: 0.9;
}

#first-info>div>button:active{
    transform: scale(0.98);
}
#second-part{
    display: flex;
    flex-wrap: wrap;
    margin:20px;
    align-items: center;
    justify-content: center;
    gap:20px;
}
#grid>div{
    background-color: #1e1e2e;
    transition: background-color 0.2s;
}
#grid>div:hover {
    filter: brightness(1.2);
}
#second-part>.controls>div{
    display: flex;
    flex-direction: row;
    gap:10px;
    margin: 10px;;
}
#reload{
    position: absolute;
    top:10px;

    left:1.5px;
    z-index:10;
    width:150px;
    border-radius: 15px;
    margin:12px;
    background-color: rgb(252, 99, 44) ;
    color:whitesmoke;
    padding:10px;
    text-align: center;
    border: 1px solid black;
}
#total-ways{
    text-align: center;
    padding: 10px;
    margin:10px;
    border-bottom: 1px solid black;
    font-size: larger;
    font-weight: 400;

}
#results{
    width: 96%;
    margin-left: 2%;
    border: 1px solid #313244;
    background-color: #11111b;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    justify-content: space-evenly;
}
#results > div {
    gap: 1px;
    background-color: #313244;
    border: 1px solid #313244;
}
#results>div>div{
    background-color: #1e1e2e;
}

#btn-submit{
    background: linear-gradient(135deg, #a6e3a1, #94e2d5);
    color: #11111b;
    width: 100%;
    font-size: large;
    font-weight: bold;
    border: none;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#btn-submit:hover{
    opacity: 0.9;
}

#btn-submit:active{
    transform: scale(0.98);
}