/* =========================
   global.css
   ========================= */

/* Reset default browser styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Reward Icon Styling */
.reward-icon {
    width: 40px;
    height: auto;
    margin-right: 5px;
    vertical-align: middle;
}

.reward-icon:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.reward-icon:active {
    transform: scale(0.95);
}

/* 
   ------------------------------------------------
   USER STATS CONTAINER
   ------------------------------------------------
   Changed to column layout so stats appear below
   the logout button (and everything stacks neatly).
*/
.user-stats-container {
    display: flex;
    flex-direction: column; /* Force vertical stacking */
    align-items: center;    /* Center horizontally */
    width: 100%;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    gap: 20px;
    border-radius: 8px;
}

/* User Photo Container */
#user-photo-container {
    display: flex;
    flex-direction: column; /* Stack photo, medals, pet, etc. vertically */
    align-items: center;
    gap: 10px;
}

/* User Photo Styling */
#user-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Avatar Text (Default Initials) */
#avatar-text {
    display: block;
    line-height: 1;
}

/* File Upload Styling */
#photo-upload {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Upload Label Styling */
#upload-label {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

/* Show upload label on hover */
#user-photo:hover #upload-label {
    opacity: 1;
    pointer-events: auto;
}

/* Stats Container 
   - Moved below .photo-actions by stacking in a column
*/
#user-stat-container {
    display: flex;
    flex-direction: column;
    align-items: center;  /* center text if you like, or "flex-start" for left-align */
    gap: 5px;
    margin-top: 10px;     /* Add spacing above stats for clarity */
}

#user-stat-container div {
    font-size: 1rem;
    color: #333;
}

/* Logout Button under Photo */
.photo-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Actions Section */
.actions {
    display: flex;
    gap: 10px;
}

.action-button {
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
}

.action-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Adjustments for Responsive Design */
@media (max-width: 600px) {
    #user-stat-container {
        align-items: center;
    }
}

/* Feedback Button Styling */
.thumb-down {
    background: none;
    border: none;
    color: grey;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.thumb-down:hover {
    color: #555;
    transform: scale(1.1);
}

.thumb-down:active {
    transform: scale(1);
}

/* Body styling */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(120deg, #f0f0f0, #e6ebf0);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Containers */
#auth-container,
#game-container {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    margin: 20px auto;
    background: #fff;
}

/* Form styling */
form {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 1rem;
    color: #555;
    margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
select {
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
}

select {
    appearance: none;
    background-color: #f9f9f9;
    color: #333;
}

button {
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

button:disabled {
    background-color: #94d3a2;
    cursor: not-allowed;
}

/* Password Field Styling */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    width: 100%;
    padding-right: 40px;
}

.password-field .toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    color: #555;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #000;
}

/* Additional styling for user stats container (again) */
#user-stat-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    font-size: 14px;
}

#user-stat-container div {
    color: #555;
}

#user-stats .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    flex: 1;
}

.action-button {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
    flex-grow: 1;
    min-width: 100px;
}

/* Game Container */
#game-container {
    margin-top: 20px;
}

#level-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

main {
    width: 100%;
    text-align: center;
}

#question-container {
    margin-bottom: 20px;
}

#question {
    font-size: 1.5rem;
    color: #444;
}

#options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

#options button {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#options button:hover {
    background-color: #f0f8ff;
    color: #007bff;
    transform: scale(1.03);
}

#options button:focus {
    outline: 2px solid #007bff;
    background-color: #e7f3ff;
    color: #0056b3;
}

#options button:disabled {
    background-color: #f9f9f9;
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

/* Feedback */
#feedback {
    font-size: 1.2rem;
    min-height: 40px;
    margin-bottom: 20px;
}

#feedback.correct {
    color: #28a745;
}

#feedback.incorrect {
    color: #dc3545;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 95%;
    max-width: 400px;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 600px) {
    #options {
        grid-template-columns: 1fr;
    }

    #user-stats {
        flex-direction: column;
        align-items: stretch;
    }

    #user-stats .stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    #user-stats .actions {
        justify-content: center;
    }

    .action-button {
        font-size: 0.9rem;
        padding: 10px;
        flex-grow: unset;
    }
}


/* =========================
   OPTIONAL: Main content wrapper 
   if you want the entire content centered 
   on large screens
   ========================= */
#main-content {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}
