/* GLOBAL STYLES */
:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --background-light: #f8f9fa;
    --background-white: #ffffff;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-light);
    color: #343a40;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.education-section {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px;
}

/* HEADER STYLES */
.header-container {
    background-color: var(--background-white);
    padding: 30px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 2.5rem;
    margin-top: 0;
    display: inline-block;
    /* Keeps border-bottom snug */
}

.learn-link {
    /* CHANGED FROM display: inline-block; to display: block; */
    display: block;
    margin: 15px auto 0 auto;
    /* Added margin-top for spacing and auto margins to keep it centered */
    max-width: 250px;
    /* Optional: Constrain width so the block element doesn't stretch across the entire page */
    background-color: var(--success-color);
    /* Green button color */
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 3px 6px rgba(40, 167, 69, 0.3);
}

.learn-link:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* SECTION STYLES */
.education-section section {
    background-color: var(--background-white);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

h2 {
    color: #0056b3;
    /* Darker blue for section titles */
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

h3 {
    color: var(--secondary-color);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 1px dashed #ced4da;
    padding-bottom: 5px;
}

ul {
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
}

/* COMPLEXITY SECTION SPECIFIC STYLES */
#complexity-explanation strong {
    color: var(--primary-color);
    font-weight: 700;
}

.auxiliary-note {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-top: 20px;
    border-radius: 5px;
    font-style: italic;
    font-size: 0.95rem;
}

/* ALGORITHM CARD STYLES */
#algorithm-definitions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 30px;
    /* Padding for the grid container itself */
    background-color: var(--background-light);
    /* Lighter background to contrast with cards */
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
}

#algorithm-definitions h2 {
    grid-column: 1 / -1;
    /* Make the h2 span all columns */
    text-align: center;
    border-left: none;
    padding-left: 0;
    border-bottom: 3px solid #0056b3;
    padding-bottom: 10px;
}

.algorithm-card {
    background-color: var(--background-white);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.algorithm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.algorithm-card h3 {
    color: #dc3545;
    /* Red color for algorithm names */
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #f8d7da;
    padding-bottom: 8px;
}

.algorithm-card p:first-of-type {
    font-style: italic;
    color: #495057;
}

.algorithm-card strong {
    color: #dc3545;
}

/* RESPONSIVENESS */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .education-section {
        padding: 0 15px;
    }

    .education-section section,
    .algorithm-card {
        padding: 20px;
    }
}