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

/* Base styles */
:root {
    --background: #1A1B26;
    --primary: #2E3440;
    --primary-light: #434C5E;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #B8A4FF;
    --primary-dark: #231E39;
    --bar-color: #9D8EC7;
    --bar-highlight: #B8A4FF;
    --navbar-height: 64px;
    --background-color: #1A1B26;
    --border-color: rgba(146, 141, 171, 0.2);
    --text-color: #FFFFFF;
    --accent-color: #B8A4FF;
    --hover-color: rgba(146, 141, 171, 0.1);
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(31, 28, 44, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(146, 141, 171, 0.2);
    height: 64px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.menu-icon svg {
    color: var(--text-primary);
    width: 24px;
    height: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.brand-icon {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
}

.brand-icon circle {
    fill: var(--accent);
    stroke: none;
}

.brand:hover .brand-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-link svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    transition: stroke 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-link:hover svg {
    stroke: var(--accent);
}

/* Sidebar */
.sidebar {
    position: fixed !important;
    top: var(--navbar-height) !important;
    left: -250px !important;
    width: 250px !important;
    height: calc(100vh - var(--navbar-height)) !important;
    background: rgba(31, 28, 44, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-right: 1px solid rgba(184, 164, 255, 0.1) !important;
    transition: 0.3s !important;
    z-index: 999 !important;
}

.sidebar.open {
    left: 0 !important;
}

.sidebar-header {
    display: flex !important;
    justify-content: flex-end !important;
    padding: 1rem !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
}

.close-menu {
    cursor: pointer !important;
    color: var(--bar-highlight) !important;
}

.close-menu:hover {
    opacity: 0.8 !important;
}

.sidebar-content {
    padding: 3rem 1rem 1rem 1rem !important;
}

.sidebar-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.sidebar-link {
    display: block !important;
    padding: 0.75rem 1rem !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
}

.sidebar-link:hover {
    background: rgba(184, 164, 255, 0.1) !important;
    color: var(--bar-highlight) !important;
}

.sidebar-link.active {
    background: rgba(184, 164, 255, 0.15) !important;
    color: var(--bar-highlight) !important;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: var(--navbar-height); /* Add margin to account for fixed navbar */
    min-height: calc(100vh - var(--navbar-height));
}

.home-content {
    text-align: center;
    max-width: 800px;
    padding: 2rem;
}

.greeting {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, 
        var(--primary-light) 0%,
        var(--accent) 50%,
        var(--primary) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.visualization-container {
    width: 100%;
    height: 500px;
    background: rgba(146, 141, 171, 0.05);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
}

.main {
    width: 95%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    padding: 0;
}

.num {
    flex: 1;
    min-width: 0;
    max-width: 40px;
    background: var(--bar-color);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    opacity: 0.85;
}

.current {
    background: var(--bar-highlight);
    box-shadow: 0 0 8px var(--bar-highlight);
    opacity: 1;
}

.selections {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.rightselection {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease, background 0.3s ease;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .visualization-container {
        height: 400px;
    }

    .main {
        width: 98%;
    }

    .num {
        max-width: 20px;
    }

    .main {
        padding: 1.5rem;
    }
    
    .home-content {
        padding: 1.5rem;
    }
    
    .cards {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .greeting {
        font-size: 3rem;
    }
    
    .description {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 480px) {
    .visualization-container {
        height: 300px;
    }

    .num {
        max-width: 10px;
    }

    .main {
        padding: 1rem;
    }
    
    .home-content {
        padding: 1rem;
    }
    
    .cards {
        gap: 1rem;
        padding: 0;
    }
    
    .greeting {
        font-size: 2.5rem;
    }
    
    .description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

/* Controls */
.selections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    align-items: center;
}

.rightselection {
    display: flex;
    gap: 1rem;
}

.button-67 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
}

.button-67:hover {
    color: var(--accent);
}

.rangeslider {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.slider {
    width: 100%;
    height: 4px;
    background: rgba(146, 141, 171, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#slidervalue {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.algorithms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    padding: 2rem;
}

.algorithm-card {
    background: rgba(31, 28, 44, 0.7);
    border: 1px solid rgba(146, 141, 171, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.algorithm-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(31, 28, 44, 0.2);
    border-color: rgba(146, 141, 171, 0.4);
}

.algorithm-card h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.algorithm-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.algorithm-card .button-67 {
    background-color: rgba(184, 164, 255, 0.1);
    border: 1px solid rgba(184, 164, 255, 0.2);
    transition: all 0.3s ease;
}

.algorithm-card .button-67:hover {
    background-color: rgba(184, 164, 255, 0.2);
    border-color: rgba(184, 164, 255, 0.4);
}

a{
    text-decoration: none;
    font-family: "Poppins",sans-serif;
    color: white;
}

.card-container {
	background-color: #231E39;
	border-radius: 5px;
	box-shadow: 0px 10px 20px -10px rgba(0,0,0,0.75);
	color: #B3B8CD;
	padding-top: 30px;
	width: 350px;
	max-width: 100%;
	text-align: center;
}

button.primary {
	background-color: #03BFCB;
	border: 1px solid #03BFCB;
	border-radius: 3px;
	color: #231E39;
	font-family: "Poppins",sans-serif!important;
	font-weight: 500;
	padding: 10px 25px;
}

.skills {
	background-color: #1F1A36;
	text-align: left;
	padding: 15px;
	margin-top: 30px;
}

button.primary:hover{
    background-color: white;
    color: black;
    cursor: pointer;
    transition: 0.2s ease-in;
}

h3 {
	margin: 10px 0;
}

h6 {
	margin: 5px 0;
	text-transform: uppercase;
}

p {
	font-size: 14px;
	line-height: 21px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: rgba(31, 28, 44, 0.95);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(146, 141, 171, 0.1);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close:hover {
    transform: rotate(90deg);
}

.sortname {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.complexity {
    margin: 2rem 0;
}

.complexity table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.complexity th,
.complexity td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(146, 141, 171, 0.2);
}

.complexity th {
    font-weight: 600;
    color: var(--accent);
}

.ref {
    margin: 2rem 0 1rem;
}

.ref-links {
    list-style: none;
    padding: 0;
}

.ref-links li {
    margin-bottom: 0.5rem;
}

.ref-links a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.ref-links a:hover {
    opacity: 0.8;
}

/* Sorting Controls */
.selections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    align-items: center;
}

.rightselection {
    display: flex;
    gap: 1rem;
}

.button-67 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
}

.button-67:hover {
    color: var(--accent);
}

.rangeslider {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.slider {
    width: 100%;
    height: 4px;
    background: rgba(146, 141, 171, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#slidervalue {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Home Content */
.home-content {
    text-align: center;
    padding: 2rem;
}

.greeting {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.explore-btn {
    background: rgba(184, 164, 255, 0.1);
    color: var(--bar-highlight);
    border: 1px solid var(--bar-highlight);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.explore-btn:hover {
    background: var(--bar-highlight);
    color: var(--background);
}