/* Reset for margin and padding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and background */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(to bottom right, #cceeff, #99ccff);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
nav {
    width: 100%;
    background-color: #333;
    padding: 20px 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

.logo {
    font-size: 28px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s, transform 0.3s;
    margin-right: auto;
}

.logo:hover {
    color: #007bff;
    transform: scale(1.1);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 80px;
    justify-content: center;
}

.nav-links li a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    position: relative;
    padding: 8px 30px;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

.nav-links li a:hover {
    background-color: #007bff;
    color: #fff;
    transform: translateY(-3px);
}

.nav-links li a:hover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 123, 255, 0.2);
    border-radius: 5px;
    animation: ripple 0.4s ease-out forwards;
}

/* Ripple animation */
@keyframes ripple {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(5);
        opacity: 0;
    }
}

/* Welcome Section */
#welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 87vh;
    background: linear-gradient(to bottom right, #cceeff, #007bff);
    color: #fff;
    text-align: center;
    padding: 40px 20px;
}

#welcome-section h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

#welcome-section p {
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 600px;
}

#welcome-section button {
    padding: 12px 30px;
    font-size: 18px;
    background-color: #fff;
    color: #007bff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

#welcome-section button:hover {
    background-color: #41e033;
    color: #fff;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 15px;
    text-align: center;
    margin-top: auto;
}

footer p {
    font-size: 14px;
}

/* Mobile */
@media (max-width: 600px) {
    .logo {
        font-size: 22px;
    }

    .nav-container {
        display: flex;
        justify-content: left;
        width: 100%;
        max-width: 500px;
    }

    .nav-links {
        display: block; 
        padding: 0;
        margin: 0;
    }

    .nav-links li {
        display: inline-block; 
        padding: 0;
        margin: 0;
    }

    .nav-links li a {
        padding: 6px 13px; 
        display: inline-block; 
    }

    .nav-links li:not(.mobile-only) {
        display: none;
    }

    .nav-links .mobile-only {
        display: inline-block;
    }

    #welcome-section h1 {
        font-size: 32px;
    }

    #welcome-section p {
        font-size: 16px;
        margin-bottom: 20px;
    }

    #welcome-section button {
        font-size: 16px;
        padding: 10px 20px;
    }

    footer p {
        font-size: 12px;
    }
}



/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
    .logo {
        font-size: 26px;
    }

    .nav-links {
        display: flex;
        gap: 20px;
    }

    #welcome-section h1 {
        font-size: 40px;
    }

    #welcome-section p {
        font-size: 17px;
        margin-bottom: 25px;
    }

    #welcome-section button {
        font-size: 17px;
        padding: 12px 25px;
    }

    footer p {
        font-size: 13px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .nav-links {
        gap: 40px;
    }

    #welcome-section h1 {
        font-size: 48px;
    }

    #welcome-section p {
        font-size: 18px;
        margin-bottom: 30px;
    }

    #welcome-section button {
        font-size: 18px;
        padding: 12px 30px;
    }

    footer p {
        font-size: 14px;
    }
}

/* Algorithm Section */
#algorithm {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    max-width: 1200px;
    margin: auto;
}

.sortContainer {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 90px;
    width: calc(33.333% - 20px);
    min-width: 280px;
    text-align: center;
    transition: transform 0.3s ease-in-out;
}

.sortContainer:hover {
    transform: scale(1.05);
}

.sortContainer h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.sortContainer p {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.sortContainer button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sortContainer button:hover {
    background-color: #0056b3;
}

.section-title {
    width: 100%;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

/* Responsive Design */
@media (max-width: 900px) {
    .sortContainer {
        width: calc(50% - 20px); /* 2 per row on medium screens */
    }
}

@media (max-width: 600px) {
    .sortContainer {
        width: 100%; /* 1 per row on small screens */
    }
}

/* Visualizer Section */
#sortingCanvas {
    background-color: #2e2b2b;
    margin: 20px auto;
    height: 300px;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Default width  */
@media (min-width: 1200px) { 
    #sortingCanvas {
        width: 800px; 
    }
}

@media (max-width: 1199px) { 
    #sortingCanvas {
        width: 700px; /* Medium screens */
    }
}

@media (max-width: 900px) { 
    #sortingCanvas {
        width: 600px; /* Smaller screens */
    }
}

@media (max-width: 600px) { 
    #sortingCanvas {
        width: 90%; /* Mobile */
    }
}

#buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: #41e033;
    transform: scale(1.05); /* Slightly enlarge on hover */
}

/* Slider container styles */
#slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Style for the range input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 300px;
    background: transparent;
    margin: 10px 0;
    height: 6px;
}

/* Styling the slider line */
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: #ccc;
    border-radius: 3px;
}

input[type="range"]::-moz-range-track {
    height: 6px;
    background: #ccc;
    border-radius: 3px;
}

/* Styling the slider ball */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -8px;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

/* Style when hovering over the slider ball */
input[type="range"]:hover::-webkit-slider-thumb {
    background: #33cce0;
}

input[type="range"]:hover::-moz-range-thumb {
    background: #33cce0;
}

/* Style for the number input field */
input[type="number"] {
    width: 80px;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #007bff;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
}

/* Focus state for the number input */
input[type="number"]:focus {
    border-color: #33cce0;
    box-shadow: 0 0 5px rgba(65, 224, 51, 0.6);
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Styling for Title Complexity and Description */
#algorithmTitle {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

#algorithmComplexity {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: #007bff;
    margin-bottom: 10px;
}

#algorithmDescription {
    font-size: 18px;
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}

/* Scrollable Code Box */
#codeContainer {
    max-width: 100%;
    margin: 20px auto;
    background-color: #1e1e1e;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    white-space: pre;
    border: 2px solid #007bff;
}

/* Code Title */
#codeTitle {
    font-size: 24px;
    font-weight: bold;
    color: #00f318;
    text-align: left;
    padding-bottom: 5px;
}

/* Flexbox for Visualizer and Code Container */
.containerVisual {
    display: flex;
    justify-content: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.canvasWrapper {
    width: 60%;
    flex: 1;
}

#codeContainer {
    width: 35%;
    flex: 1;
    background-color: #2c2828;
    padding: 20px;
}

@media (max-width: 900px) {
    .canvasWrapper, #codeContainer {
        width: 100%;
    }
    #codeContainer {
        max-width: 95%;
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .canvasWrapper, #codeContainer {
        width: 100%;
    }
    #codeContainer {
        max-width: 100%;
        font-size: 12px;
    }
}

/* Contact Section Styling */
#contact-section {
    text-align: center;
    padding: 50px 20px;
}

#contact-section h1{
    font-size: 26pt;
}

#contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #007bff;
    border-radius: 5px;
    font-size: 16px;
}

#contact-form textarea {
    height: 150px;
    resize: none;
}

#contact-form button {
    padding: 12px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

#contact-form button:hover {
    background-color: #41e033;
}

/* About Section */
#about-section, #importance-section {
    width: 80%;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
}

#about-section h1, #importance-section h2 {
    color: #007bff;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

#about-section p, #importance-section p {
    color: black;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
}

