* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1E4D2B;
    background-image: linear-gradient(180deg, #1E4D2B 10%, #16381F 100%);
    background-size: cover;
    min-height: 100vh;
    color: #333;
}

/* Reset and Base Spacing */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.6;
}

    /* Last child spacing cleanup */
    h1:last-child,
    h2:last-child,
    h3:last-child,
    h4:last-child,
    h5:last-child,
    h6:last-child,
    p:last-child {
        margin-bottom: 0;
    }

/* Specific heading sizes with improved spacing */
h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h5 {
    font-size: 1.25rem;
    margin-bottom: 0.875rem;
}

h6 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

/* Paragraph spacing improvements */
p + p {
    margin-top: 1rem;
}

p + h1,
p + h2,
p + h3,
p + h4,
p + h5,
p + h6 {
    margin-top: 2rem;
}

/* Lists */
ul, ol {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

    .header h1 {
        color: #2c5530;
        font-size: 2.5rem;
        margin-bottom: 10px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

    .header p {
        font-size: 1.2rem;
        color: #666;
        margin-bottom: 20px;
    }

.game-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 30px;
}

.quiz-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scoreboard {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

    .scoreboard h2 {
        color: #2c5530;
        margin-bottom: 15px;
    }

.score {
    font-size: 3rem;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.question-container {
    text-align: center;
    min-height: 400px;
}

.question-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #2c5530;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .3s;
        border-radius: 50%;
    }

.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
}

    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(26px);
    }

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Display cell styling */
.display-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.display-label {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 50px;
}

    .display-label.active {
        color: #2e7d32;
    }

    .display-label.hidden {
        color: #c62828;
    }

/* Filters Section */
.filters-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .filter-group label {
        font-weight: 500;
        font-size: 14px;
        color: #555;
    }

    .filter-group input {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }

        .filter-group input:focus {
            outline: none;
            border-color: #4CAF50;
        }

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
}

    .filter-actions .btn {
        width: 100%;
    }

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

    .sortable:hover {
        background-color: #f0f0f0;
    }

/* Results info */
.results-info {
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #2e7d32;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .filters-section {
        grid-template-columns: 1fr;
    }
}

.waste-item {
    background: #f8f9fa;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 30px;
    margin: 30px auto;
    width: 300px;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

    .waste-item:hover {
        transform: scale(1.05);
        border-color: #4CAF50;
        box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    }

    .waste-item.dragging {
        transform: rotate(5deg) scale(1.1);
        cursor: grabbing;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

.waste-item-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.waste-item-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
}

.disposal-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.disposal-bin {
    background: #f8f9fa;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    min-height: 150px;
    transition: all 0.3s ease;
    position: relative;
}

    .disposal-bin.drag-over {
        border-color: #4CAF50;
        background: #e8f5e8;
        transform: scale(1.02);
    }

    .disposal-bin.correct {
        border-color: #4CAF50;
        background: #e8f5e8;
        animation: correctAnswer 0.6s ease;
    }

    .disposal-bin.incorrect {
        border-color: #f44336;
        background: #ffebee;
        animation: incorrectAnswer 0.6s ease;
    }

@keyframes correctAnswer {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes incorrectAnswer {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
}

.bin-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.bin-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}
.feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    transform: translateX(-400px);
    opacity: 0; /* Add this */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Add opacity transition */
    z-index: 1000;
    /* Fix text cutoff */
    max-width: calc(100vw - 40px);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: auto;
    min-width: 250px;
}

    .feedback.show {
        transform: translateX(0);
        opacity: 1; /* Add this */
    }

    .feedback.success {
        background: #4CAF50;
    }

    .feedback.error {
        background: #f44336;
    }

    .feedback.info {
        background: #2196F3;
    }

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .feedback {
        left: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
        min-width: unset;
        padding: 12px 20px;
        font-size: 14px;
    }
}

.game-complete {
    display: none;
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.final-score {
    font-size: 4rem;
    color: #4CAF50;
    margin: 20px 0;
    font-weight: bold;
}

.restart-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin: 20px 10px;
}

    .restart-btn:hover {
        transform: scale(1.05);
    }

.leaderboard {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

    .leaderboard h3 {
        color: #2c5530;
        margin-bottom: 20px;
        text-align: center;
    }

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.view-all-btn {
    display: block;
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .view-all-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }

.summary-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.summary-item {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

    .summary-item.correct {
        border-left-color: #4CAF50;
    }

@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }

    .disposal-options {
        grid-template-columns: 1fr;
    }

    .waste-item {
        width: 100%;
    }
}

/* Make the logout button look like a link */
.footer-link-button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    text-decoration: none;
    display: inline;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
    min-width: 300px;
    max-width: 500px;
}

    .toast.show {
        transform: translateX(0);
    }

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
}

.toast-message {
    font-size: 0.9rem;
    color: #666;
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

    .toast.success .toast-icon {
        color: #4CAF50;
    }

    .toast.success .toast-title {
        color: #2e7d32;
    }

.toast.error {
    border-left: 4px solid #f44336;
}

    .toast.error .toast-icon {
        color: #f44336;
    }

    .toast.error .toast-title {
        color: #c62828;
    }

.toast.warning {
    border-left: 4px solid #ff9800;
}

    .toast.warning .toast-icon {
        color: #ff9800;
    }

    .toast.warning .toast-title {
        color: #e65100;
    }

.toast.info {
    border-left: 4px solid #2196F3;
}

    .toast.info .toast-icon {
        color: #2196F3;
    }

    .toast.info .toast-title {
        color: #1565c0;
    }

@media (max-width: 768px) {
    .toast {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
}

.user-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 77, 43, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    z-index: 900;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.welcome-text {
    color: white;
    font-weight: 500;
    font-size: 1rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

    .footer-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

/* Adjust container to account for footer */
.container {
    padding-bottom: 80px; /* Add space for footer */
}

/* Ensure game-complete doesn't get hidden by footer */
.game-complete {
    margin-bottom: 80px;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .welcome-text {
        font-size: 0.9rem;
    }

    .footer-link {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}