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

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

body {
    background: url('bg.png') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: white;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.container {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    z-index: 10;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 11rem;
    flex-shrink: 0;
}

.logo {
    background-color: #22d3ee;
    border: 1px solid #a5f3fc;
    border-radius: 0.375rem;
    padding: 0.375rem 1.5rem;
    font-weight: 800;
    font-size: 1.125rem;
    color: black;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 20;
}

.glass {
    background: rgba(198, 172, 172, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0.5rem;
}

.form {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.form label {
    font-weight: bold;
    font-size: 0.875rem;
    color: white;
}

.form select,
.form input,
.form textarea {
    width: 100%;
    background-color: black;
    color: white;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    margin-top: 0.25rem;
}

textarea {
    font-weight: 600;
    font-size: 0.75rem;
    resize: none;
    color: #22d3ee;
    padding: 0.5rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-group button {
    width: 100%;
    font-weight: bold;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-group button[type="submit"] {
    background-color: black;
    color: white;
}

#stopBtn {
    background-color: #dc2626;
    color: white;
}

.main {
    flex: 1;
    display: flex;
    gap: 0.75rem;
    height: 100%;
}

.bar {
    background-color: #90c3f2;
    margin: 0 3px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: 4px;
    transition: height 0.5s ease, transform 0.3s ease, background-color 0.3s ease;
}

.bar:hover {
    filter: brightness(1.5);
    cursor: default;
}

.bar.highlighted {
    background-color: #d65a5a;
    transform: scaleY(1.05);
}

.bar.moving {
    background-color: #5ad65a;
    transform: scaleY(1.05);
}

.bar.sorted {
    background-color: #4caf50;
    transform: scaleY(1.05);
}

.bar-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: none;
    margin-bottom: 1rem;
    position: absolute;
    user-select: none;
}

.bar-container {
    padding: 1rem;
    display: flex;
    align-items: flex-end;
    gap: 0.3rem;
    width: 70%;
    height: 80vh;
    position: relative;
    overflow: hidden;
}

.code-container {
    padding: 1rem;
    width: 30%;
    height: 80vh;
    overflow: auto;
    background-color: rgba(135, 216, 254, 0.479);
}

.code-container h2 {
    font-weight: bold;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: rgb(10, 3, 80);
}

#algoCode {
    font-size: 15px;
    line-height: 1.5;
    font-family: monospace;
    color: #031156;
    white-space: pre-wrap;
}

#algoCode strong {
    font-weight: bold;
}

/* Responsive styles for mobile screens */
@media (max-width: 480px) {
    .container {
        flex-direction: column;
        padding: 0.5rem;
    }
    .sidebar {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .form {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        height: auto;
        max-width: 600px;
    }
    .form label {
        flex: 1 1 45%;
        min-width: 120px;
        margin-bottom: 0;
    }
    .form select,
    .form input,
    .form textarea {
        width: 100%;
        margin-top: 0.25rem;
    }
    .btn-group {
        flex: 1 1 100%;
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    .btn-group button {
        width: 100%;
    }
    .main {
        flex-direction: column;
        height: auto;
    }
    .bar-container {
        width: 100%;
        height: 40vh;
    }
    .code-container {
        width: 100%;
        height: auto;
        margin-top: 1rem;
        overflow: visible;
    }
}
