:root {
    --bg-dark: #1a1a1a;
    --bg-darker: #121212;
    --bg-container: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-green: #2ecc71;
    --accent-green-hover: #27ae60;
    --border-color: #3d3d3d;
    --input-bg: #3d3d3d;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column-reverse;
}
.sidebar {
    /* width: 280px; */
    background-color: var(--bg-darker);
    border-top: 4px solid var(--accent-green);
    /* box-shadow: 2px 0 10px var(--shadow-color); */
    padding: 20px;
    overflow-y: auto;

    height: 100dvh;
    flex:1;
}
.main-content {
    /* margin-left: 280px; Same as sidebar width */
    /* width: calc(100% - 280px); */
    width: 100dvw;
    min-height: 100dvh;
    padding-left: 30px;
    padding-right: 30px;
    padding-bottom: 60px;
    box-sizing: border-box;
    background-color: var(--bg-container);
    /* border-radius: 10px 0 0 10px; */
    /* box-shadow: 0 0 10px var(--shadow-color); */
    text-align: center;
    position: relative;
    flex:1;
}

.info-bar {
    background-color: var(--bg-darker);
    box-shadow: 0 2px 5px var(--shadow-color);
    border-radius: 0px;
    /* margin: -30px -30px 20px -30px; */
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 2;
    height: 51px; /* Fixed height for the info bar */
    overflow: hidden; /* Ensures child elements stay within bounds */
}

.info-btn {
    background-color: var(--bg-dark);
    /* border-left: 1px solid var(--border-color); */
    /* border-right: 1px solid var(--border-color); */
    color: white;
    /* border: none;*/
    padding: 0px 20px; /* Horizontal padding only */
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    /* height: min(12dvh, 50px);  */
    height: clamp(30px, 8dvh, 50px); 
    min-width: 80px; /* Minimum width for the button */
    margin: 0; /* Remove any default margins */

}
a.info-btn {
    /* Makes a tag info-btns more like buttons */
    display: inline-block;
    text-decoration: none;
    text-align: center;
    line-height: clamp(30px, 8dvh, 50px); /* should be the same as info-btn height */
    box-sizing: border-box;
    border-radius: 5px;
}
.info-btn:hover {
    background-color: var(--accent-green-hover);
    transform: none;
    box-shadow: none;
}

h1 {
    color: var(--accent-green);
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

button {
    background-color: var(--accent-green);
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* button:not(.info-btn, .sidebarToggleBtn):hover {
    background-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
} */

.word-display {
    margin-top: 30px;
    margin-right: auto;
    padding: 20px;
    background-color: var(--bg-darker);
    border-radius: 5px;
    border-left: 4px solid var(--accent-green);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    font-size: clamp(24px, 3.33vw, 36px);

}
@media (aspect-ratio >= 0.82) {
    body {
        flex-direction: row;
    }
    .word-display {
        max-width: 780px;
        margin-left: auto;
        margin-right: auto;
    }
    .sidebar{
        border-right: 4px solid var(--accent-green);
        border-top: none; 
        width: min(28dvw, 240px);
        flex:none;
    }
    .main-content {
    }
}

.word {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.details {
    color: var(--text-secondary);
    font-size: clamp(14px, 2.33vw, 18px);
}

.loading {
    color: var(--text-secondary);
    font-style: italic;
}

.input-section {
    margin: 20px 0;
}

input[type="text"] {
    padding: 12px;
    font-size: clamp(16px, 2vw, 24px);
    background-color: var(--input-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 5px;
    /* width: 250px; */
    margin-right: 10px;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.3);
}

.feedback {
    /* margin: 20px 0; */
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: clamp(15px, 1.8vw, 19px);

}

.feedback.correct {
    background-color: rgba(46, 204, 113, 0.2);
    color: #d4edda;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.feedback.incorrect {
    background-color: rgba(231, 76, 60, 0.2);
    color: #f8d7da;
    border: 1px solid rgba(231, 76, 60, 0.3);
}



.sidebar h3 {
    margin: 0 0 20px 0;
    color: var(--accent-green);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.2);
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Filter buttons in sidebar */
.filter-btn {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2px;
}

.filter-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
}

.filter-btn.selected,
.filter-btn.selected:hover {
    background-color: var(--accent-green);
    color: white;
    border-color: var(--accent-green-hover);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.sidebar-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Additional dark theme improvements */
p {
    color: var(--text-secondary);
}

.quiz-stats {
    background-color: var(--bg-darker);
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.quiz-stats p {
    margin: 5px 0;
    color: var(--text-primary);
}

.quiz-stats span {
    color: var(--accent-green);
    font-weight: bold;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* @media (max-width: 768px) {
    /* body {
        flex-direction: column;
    } */
    
    /* .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 4px solid var(--accent-green);
    } */
    
    /* .container {
        margin: 20px;
        margin-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    } 
} */

/* Animation for correct/incorrect feedback */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.feedback {
    animation: fadeIn 0.3s ease-out;
}
