/* Levels screen styles */
#levels-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #000000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    position: relative;
}

/* Same starry background as title screen */
#levels-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    opacity: 0.3;
}

.levels-container {
    position: relative;
    z-index: 5;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    margin: 0 auto;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.levels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.levels-header h2 {
    color: var(--text-light);
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#levels-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.levels-loading,
.no-levels,
.levels-error {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 18px;
    opacity: 0.7;
}

.levels-error {
    color: var(--danger-color);
}

.level-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.level-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.level-header h3 {
    color: var(--primary-light);
    font-size: 20px;
    font-weight: 600;
}

.level-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.level-description {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.8;
}

.level-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 15px;
}

.level-card .action-button {
    width: 100%;
}

/* Level stats and like/dislike styles */
.level-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.like-button,
.dislike-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 4px;
}

.like-button:hover,
.dislike-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.like-button.liked {
    color: #4CAF50;
}

.dislike-button.disliked {
    color: #F44336;
}

.like-button.liked:hover {
    color: #66BB6A;
}

.dislike-button.disliked:hover {
    color: #EF5350;
}

/* =========== Search bar & feature button styles =========== */
.levels-search-container {
    padding: 10px 20px;
}
.levels-search-container input.levels-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.2);
    color: white;
    font-size: 14px;
    outline: none;
}

.feature-button {
    background: linear-gradient(to bottom, #FFD700, #FFC107);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-right: 8px;
}
.feature-button:hover {
    filter: brightness(1.1);
}

/* Sort controls styles */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.sort-controls span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-right: 8px;
}

.sort-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sort-button.active {
    background: var(--primary-color);
    color: white;
}

/* Level upload dialog styles */
#level-upload-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.upload-modal {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    color: white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-modal h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--warning-color);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    resize: vertical;
}

.form-group textarea {
    min-height: 100px;
}

.upload-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.upload-actions button {
    flex: 1;
}