* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #121212;
    color: #e0e0e0;
}

/* Header */
header {
    background: #121212;
    color: #e0e0e0;
    padding: 20px 0;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 10px;
    font-size: 3.8em;
    color: #ffffff;
}

header input {
    padding: 10px;
    width: 80%;
    max-width: 600px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #1e1e1e;
    color: #ffffff;
}

header input:focus {
    background-color: #333;
}

/* Container */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
    background: #121212;
    color: #ffffff;
}

/* Courses Grid */
.courses {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.course-item {
    position: relative;
    width: 100%;
    max-width: 300px;
    background: #1e1e1e;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease;
    height: 230px;
    flex-direction: column;
    display: flex;
}

.course-item:hover {
    transform: scale(1.05);
}

.course-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.9;
}

/* Course Info Overlay */
.course-info {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    text-align: center;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
    align-items: center;
}

.course-info h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #ffffff;
}

.course-info p {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 10px;
}

.course-info button {
    background-color: #333;
    color: #ffffff;
    font-weight: 600;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 150px;
}

.course-info button:hover {
    background-color: #555;
    color: #fff;
}

/* Generic Button */
.btn {
    background-color: #1c1c1c;
    color: #ffffff;
    font-weight: lighter;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #555;
    transform: scale(1.05);
}

/* Sort Select */
.sort-container {
    display: contents;
    align-items: center;
    font-size: 16px;
    margin: 10px auto;
    margin-top: 0px;
}

.sort-container select {
    background-color: #1c1c1c;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.sort-container select:hover {
    background-color: #555;
    transform: scale(1.05);
}

.sort-container button {
    background-color: #1c1c1c;
    color: #ffffff;
}

/* Back Button */
.back {
    position: absolute;
    padding-left: 20px;
    z-index: 1000;
}

.back-button {
    display: inline-flex;
    align-items: center;
    color: #fff;
    border: none;
    border-radius: 40px;
    padding: 5px 5px;
    text-decoration: none;
    font-size: 25px;
    margin-top: 10px;
    cursor: pointer;
    margin: 10px auto;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #626262;
}

/* Footer */
footer {
    background: #333;
    color: #ffffff;
    padding: 15px 0;
    text-align: center;
    margin-top: auto;
    position: relative;
}

/* Scroll to Top */
.scroll-top-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 20px;
    background-color: #1c1c1c;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    padding: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 10000;
}

.scroll-top-btn:hover {
    background-color: #555;
}

/* Responsive Design */
@media (max-width: 600px) {
    header input {
        width: 100%;
    }

    .course-item {
        width: 100%;
        max-width: none;
    }

    #sortSelect {
        width: 100%;
    }
}
