*,
*::before,
*::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: "Inter", sans-serif;
}

:root {
    --bk-dark: #0F172A;
    --bg-card: #1e293b;
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --primary: #22C55E;
    --border: #334155;
    font-size: 10px;
}

body {
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bk-dark);
}

/* Header Styles */
header {
    width: auto;
    background-color: var(--bg-card);
    padding: 10px 20px;
    color: var(--text-main);
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;

}

.header-icon {
    width: 35px;
    height: 35px;
    background-color: #1E393F;
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.title {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 5px;
    font-size: 2.5rem;
    font-weight: 700;
}

.phase {
    font-size: 1.1rem;
    font-weight: 400;
    text-align: center;
    padding: 5px 10px;
    margin-left: 5px;
    border-radius: 8px;
    border: solid 1px var(--primary);
    color: var(--primary);
    background-color: #1e393f65;
}

/* Main Content Styles */
.cards {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.card {
    width: 90%;
    background-color: var(--bg-card);
    border-radius: 15px;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 20px;
}

/* Canvas Styles */
.canvas {
    margin-top: 10px;
    height: calc(100vh - 240px);
    min-height: 300px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background-color: #020617;
    background-image:
        linear-gradient(#1e293b 1px, transparent 1px),
        linear-gradient(90deg, #1e293b 1px, transparent 1px);
    background-size: 25px 25px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

canvas#graphCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

#canvas-placeholder {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#canvas-placeholder span {
    font-family: "Fragment Mono", monospace;
    font-size: 1rem;
    opacity: 0.7;
}

/* Upload Component Styles */
.upload {
    position: relative;
    height: 60px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background-color: var(--bg-card);
}

.upload label {
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
}

.note {
    position: absolute;
    top: auto;
    bottom: -25px;
    left: 20px;
    color: var(--text-muted);
    font-size: 1.3rem;
    align-self: left;
    font-family: "Fragment Mono", monospace;
}

.upload svg {
    color: var(--primary);
    stroke-width: 0.25rem;
    width: 30px;
    height: 30px;
}

.icon-text-upload svg {
    stroke-width: 0.18rem;
}

.upload svg#info {
    width: 35px;
    height: 35px;
    cursor: pointer;
}

.icon-text-upload {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Algorithm Selection Styles */
.algorithm-select {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.algorithm {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 1.8rem;
    gap: 10px;
}

.algorithm svg {
    color: var(--primary);
    width: 35px;
    height: 35px;
}

.algorithm-select hr:nth-of-type(1) {
    width: calc(100% + 40px);
    margin-top: 10px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
}

.algorithm-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
}

.algorithm-btn button {
    padding: 10px;
    font-size: 1.7rem;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border: none;
    border-radius: 6px;
}

.active {
    background-color: var(--primary);
    color: var(--text-main);
}

.algorithm-btn button.active svg {
    width: 40px;
    height: 40px;
    transition: all 0.6s ease;
}

.algorithm-btn button svg {
    width: 30px;
    height: 30px;
}

#run-btn {
    width: 100%;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    color: var(--text-main);
    background-color: var(--primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#run-btn svg {
    width: 30px;
    height: 30px;
    color: var(--text-main);
}

.disabled {
    display: flex;
    flex-direction: row;
    opacity: 0.5;
    gap: 5px;
    pointer-events: none;
    cursor: not-allowed;
}

.algorithm-select hr:nth-of-type(2) {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid var(--text-muted);
    border-radius: 50%;
}

/* Code Display Styles */
.code {
    font-family: "JetBrains Mono", monospace;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    height: 350px;
    max-height: 400px;
    padding: 0;
}

code,
pre {
    font-family: 'JetBrains Mono', monospace;
}

.code pre {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 20px;
    margin: 0;
    white-space: pre;
}

#code-display {
    max-height: unset;
    overflow: visible;
    font-size: 1.1rem;
}

#log-display {
    max-height: unset;
    overflow: visible;
    font-size: 1.25rem;
}


/* Algorithm Code Styles */
.code-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.algorithm-code {
    width: 90%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: #4BA5FA;
    background-color: #172032;
    height: 20px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.algorithm-code span {
    font-family: "JetBrains Mono", monospace;
    font-size: 1.6rem;
}

.circles {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.circle {
    background-color: var(--text-main);
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.circle:nth-of-type(1) {
    background-color: #83323B;
}

.circle:nth-of-type(2) {
    background-color: #806A1D;
}

.circle:nth-of-type(3) {
    background-color: #1C7348;
}


/* Log Styles */
.execution-log {
    color: #4ADE80;
}


/* Footer Styles */
footer {
    width: 100%;
    height: 60px;
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.4rem;
    gap: 5px;
    margin-top: 20px;
}

.links {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 5px;
}

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

footer span {
    font-size: 1.3rem;
    margin-bottom: 10px;
}


/* Scrollbar Styles */

/* For WebKit browsers */