/* 
* Quiz App - CSS Teroptimasi
* =============================================
* CATATAN:
* - File ini menggabungkan styles.css dan responsive.css
* - Struktur CSS diorganisir berdasarkan komponen
* - Pendekatan DRY (Don't Repeat Yourself) diterapkan
* - Media queries dikelompokkan berdasarkan ukuran layar
*/

/* =================== */
/* RESET DAN BASE STYLES */
/* =================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
    padding-bottom: 60px; /* Ruang untuk bottom navigation */
    max-width: 100%;
    margin: 0 auto;
}

/* =================== */
/* HEADER STYLES */
/* =================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.profile-icon {
    font-size: 2rem;
    margin-right: 10px;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: bold;
    font-size: 0.9rem;
}

.level {
    font-size: 0.8rem;
    opacity: 0.9;
}

.coin-container {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

.coin-container i {
    color: #ffd700;
    margin-right: 5px;
}

.coin-count {
    font-weight: bold;
}

.back-button {
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
}

.page-title {
    font-size: 1.2rem;
    font-weight: bold;
}

/* =================== */
/* MAIN CONTENT STYLES */
/* =================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.character-container {
    display: flex;
    margin-bottom: 30px;
    justify-content: center;
    align-items: center;
    animation: float 3s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.character {
    width: 200px;
    height: auto;
    object-fit: contain;
}

.play-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-button i {
    margin-right: 10px;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.play-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =================== */
/* BOTTOM NAVIGATION */
/* =================== */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background-color: #fff;
    padding: 10px 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.nav-item.active {
    color: #3498db;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.nav-item span {
    font-size: 0.8rem;
}

/* =================== */
/* CATEGORY PAGE STYLES */
/* =================== */
.category-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 70px;
}

.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.category-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.category-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.category-info {
    padding: 15px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.category-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.4;
}

/* =================== */
/* LEVEL PAGE STYLES */
/* =================== */
.level-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.levels-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px;
}

.level-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.level-number {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.level-status {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Level card states */
.level-card.locked {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.level-card.locked .level-number {
    color: #bdc3c7;
}

.level-card.locked::after {
    content: "\f023";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1.5rem;
    color: #bdc3c7;
    margin-top: 5px;
}

.level-card.completed .level-number {
    color: #2ecc71;
}

.level-card.completed::after {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1rem;
    color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
    padding: 5px;
    border-radius: 50%;
    margin-top: 5px;
}

/* =================== */
/* QUIZ PAGE STYLES */
/* =================== */
.quiz-mode {
    background-color: #f8f9fa;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #3498db;
    color: white;
}

.quiz-info {
    flex: 1;
}

.category-level {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.progress-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #2ecc71;
    width: 0%;
    transition: width 0.5s ease;
}

.quiz-score {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    margin-left: 15px;
}

.quiz-score i {
    color: #ffd700;
    margin-right: 5px;
}

.quiz-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-container {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.4;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    padding: 15px;
    background-color: #f1f2f6;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    border: 2px solid transparent;
}

.option-item:hover {
    background-color: #e8e8e8;
}

.option-item.selected {
    background-color: #d6eaf8;
    border-color: #3498db;
}

.option-item.correct {
    background-color: #d5f5e3;
    border-color: #2ecc71;
}

.option-item.incorrect {
    background-color: #fadbd8;
    border-color: #e74c3c;
}

/* Quiz Exit Button */
.quit-button {
    font-size: 1.2rem;
    background-color: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.quit-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* =================== */
/* RESULT MODAL STYLES */
/* =================== */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s;
}

.result-modal.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s;
}

.result-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 350px;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.result-modal.active .result-content {
    transform: scale(1);
}

.result-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.result-score {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.result-score i {
    color: #ffd700;
    margin-right: 10px;
}

.reward-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.reward-coin, .reward-xp {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.reward-coin i {
    color: #ffd700;
    margin-right: 5px;
}

.reward-xp i {
    color: #9b59b6;
    margin-right: 5px;
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.result-buttons button {
    flex: 1 0 calc(50% - 10px);
    min-width: 120px;
}

/* Tombol actions */
.btn-restart, .btn-home, .btn-next, .btn-select {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-restart {
    background-color: #3498db;
    color: white;
}

.btn-home {
    background-color: #e9e9e9;
    color: #2c3e50;
}

.btn-next {
    background-color: #9b59b6;
    color: white;
}

.btn-next:hover {
    transform: translateY(-2px);
    background-color: #8e44ad;
}

.btn-select {
    background-color: #3498db;
    color: white;
}

.btn-select:hover {
    transform: translateY(-2px);
    background-color: #2980b9;
}

.btn-restart:hover, .btn-home:hover {
    transform: translateY(-2px);
}

.btn-restart i, .btn-home i, .btn-next i, .btn-select i {
    margin-right: 5px;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 40px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

/* =================== */
/* QUIT CONFIRMATION MODAL */
/* =================== */
.quit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s;
}

.quit-modal.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s;
}

.quit-content {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 350px;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.quit-modal.active .quit-content {
    transform: scale(1);
}

.quit-title {
    font-size: 1.4rem;
    color: #e74c3c;
    margin-bottom: 15px;
}

.quit-message {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.quit-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-quit, .btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-quit {
    background-color: #e74c3c;
    color: white;
}

.btn-cancel {
    background-color: #ecf0f1;
    color: #34495e;
}

.btn-quit:hover, .btn-cancel:hover {
    transform: translateY(-2px);
}

.btn-quit i, .btn-cancel i {
    margin-right: 5px;
}

/* =================== */
/* MODAL STYLES */
/* =================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: #f0f0f0;
}

.modal-content h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
    padding-right: 30px;
}

/* =================== */
/* ICON GRID */
/* =================== */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.icon-option {
    aspect-ratio: 1/1;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-option:hover {
    background: #3498db;
    color: white;
    transform: scale(1.1);
}

/* =================== */
/* PROFILE STYLES */
/* =================== */
.profile-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 70px;
}

.profile-header {
    background-color: #f5f7fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    font-size: 3rem;
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    cursor: pointer;
    transition: transform 0.3s;
}

.profile-avatar:hover {
    transform: scale(1.1);
}

.profile-details h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.profile-stats {
    display: flex;
    margin-top: 10px;
}

.stat-item {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.stat-item i {
    margin-right: 5px;
}

.stat-item .coins {
    color: #f39c12;
}

.stat-item .xp {
    color: #9b59b6;
}

.profile-section {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-section h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

/* Profile dropdown */
.profile-dropdown {
    position: absolute;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 180px;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f7fa;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item i {
    margin-right: 10px;
    color: #3498db;
    width: 20px;
    text-align: center;
}

#logoutMenuItem i {
    color: #e74c3c;
}

#resetMenuItem i {
    color: #e67e22;
}

/* =================== */
/* ACHIEVEMENT STYLES */
/* =================== */
.achievement-category {
    margin-bottom: 20px;
}

.achievement-category h3 {
    font-size: 1.1rem;
    color: #3498db;
    margin-bottom: 10px;
    border-bottom: none;
    padding-bottom: 0;
}

.achievement-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.achievement-badge {
    display: flex;
    align-items: center;
    background-color: #f5f7fa;
    border-radius: 8px;
    padding: 10px;
    width: calc(50% - 8px);
    transition: transform 0.2s;
}

.achievement-badge:hover {
    transform: translateY(-3px);
}

.badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 12px;
}

.badge-info {
    flex: 1;
}

.badge-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: #2c3e50;
}

.badge-points {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.no-achievements {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

.no-achievements i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #bdc3c7;
}

/* =================== */
/* LOGIN STYLES */
/* =================== */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 5rem;
    color: #3498db;
    margin-bottom: 10px;
}

.login-title {
    font-size: 1.8rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
}

.login-form {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.form-label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #3498db;
    outline: none;
}

.login-button {
    width: 100%;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-button:hover {
    background-color: #2980b9;
}

/* =================== */
/* INVENTORY & SHOP STYLES */
/* =================== */
.inventory-content,
.shop-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 70px;
}

/* Tabs */
.inventory-tabs,
.shop-tabs {
    display: flex;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    color: #7f8c8d;
}

.tab i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.tab span {
    font-size: 0.9rem;
}

.tab.active {
    background-color: #3498db;
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Grid Layout */
.inventory-grid,
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Empty message */
.inventory-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.inventory-message i {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.inventory-description {
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Inventory Items */
.inventory-item {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.inventory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.item-icon {
    width: 50px;
    height: 50px;
    background-color: #f5f7fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 15px;
    color: #3498db;
}

.item-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.item-icon.active {
    background-color: rgba(52, 152, 219, 0.2);
    border: 2px solid #3498db;
}

.item-info {
    flex: 1;
}

.item-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.item-info p {
    font-size: 0.8rem;
    color: #7f8c8d;
    line-height: 1.4;
}

.item-action {
    margin-left: 10px;
}

.btn-use {
    background-color: #f5f7fa;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #2c3e50;
    transition: background-color 0.2s;
}

.btn-use:hover {
    background-color: #e8e8e8;
}

.btn-use.active {
    background-color: #3498db;
    color: white;
}

/* Shop Items */
.shop-item {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.shop-item .item-icon {
    margin: 0 auto 15px auto;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

.shop-item .item-info {
    text-align: center;
    margin-bottom: 15px;
}

.item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: #f39c12;
}

.item-price i {
    margin-right: 5px;
}

.btn-buy {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-buy:hover {
    background-color: #2980b9;
}

.btn-buy:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Item Detail */
.item-detail-container {
    text-align: center;
    padding: 10px;
}

.item-detail-icon {
    font-size: 4rem;
    color: #3498db;
    margin-bottom: 15px;
}

.item-detail-name {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.item-detail-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.item-detail-stats {
    background-color: #f5f7fa;
    border-radius: 8px;
    padding: 10px;
    display: inline-block;
}

.stat {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat i {
    color: #3498db;
    margin-right: 8px;
}

/* Purchase Modal */
.purchase-details {
    background-color: #f5f7fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.purchase-price {
    font-size: 1.5rem;
    color: #f39c12;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.purchase-price i {
    margin-right: 8px;
}

.purchase-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.purchase-balance i {
    margin-left: 5px;
    color: #f39c12;
}

/* =================== */
/* FEATURE MODAL STYLES */
/* =================== */
.feature-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s;
}

.feature-modal.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s;
}

.feature-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.feature-modal.active .feature-content {
    transform: scale(1);
}

.feature-header {
    padding: 15px 20px;
    background-color: #3498db;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

.close-feature {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-feature:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.feature-body {
    padding: 25px 20px;
    flex: 1;
}

.feature-message {
    text-align: center;
}

.feature-icon {
    font-size: 4rem;
    color: #3498db;
    margin-bottom: 15px;
    display: block;
}

.feature-message p {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
}

.feature-description {
    font-size: 0.9rem !important;
    color: #7f8c8d !important;
    margin-top: 15px !important;
    font-weight: normal !important;
    line-height: 1.5;
}

.feature-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #ecf0f1;
}

.btn-ok {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 40px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-ok:hover {
    transform: translateY(-2px);
    background-color: #2980b9;
}

.btn-ok i {
    margin-right: 5px;
}

/* Modal Color Variants */
#inventoryModal .feature-icon {
    color: #e67e22;
}

#inventoryModal .feature-header {
    background-color: #e67e22;
}

#inventoryModal .btn-ok {
    background-color: #e67e22;
}

#inventoryModal .btn-ok:hover {
    background-color: #d35400;
}

#shopModal .feature-icon {
    color: #9b59b6;
}

#shopModal .feature-header {
    background-color: #9b59b6;
}

#shopModal .btn-ok {
    background-color: #9b59b6;
}

#shopModal .btn-ok:hover {
    background-color: #8e44ad;
}

/* =================== */
/* LOGOUT AND RESET */
/* =================== */
.logout-btn {
    position: absolute;
    top: 0;
    right: -30px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* =================== */
/* MEDIA QUERIES - RESPONSIVE DESIGN */
/* =================== */

/* Small Devices (smartphones, 576px and down) */
@media (max-width: 576px) {
    .main-header {
        padding: 10px;
    }
    
    .profile-icon {
        font-size: 1.8rem;
    }
    
    .username {
        font-size: 0.85rem;
    }
    
    .level {
        font-size: 0.75rem;
    }
    
    .play-button {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .categories-container {
        grid-template-columns: 1fr;
    }
    
    .levels-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option-item {
        padding: 12px;
    }
    
    .result-content {
        padding: 20px;
    }
    
    .result-title {
        font-size: 1.3rem;
    }
    
    .result-score {
        font-size: 2rem;
    }
    
    .reward-coin, .reward-xp {
        font-size: 1rem;
    }
    
    .btn-restart, .btn-home {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .achievement-badge {
        width: 100%;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .profile-stats {
        justify-content: center;
    }
    
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .icon-option {
        font-size: 20px;
    }
    
    .modal-content {
        width: 85%;
        padding: 20px;
        margin: 30% auto;
    }
    
    .quit-buttons {
        flex-direction: column;
    }
    
    .btn-quit, .btn-cancel {
        width: 100%;
    }
    
    .quit-content {
        width: 85%;
        padding: 20px;
    }
    
    .feature-content {
        width: 95%;
    }
    
    .feature-title {
        font-size: 1.2rem;
    }
    
    .feature-message p {
        font-size: 1rem;
    }
    
    .feature-description {
        font-size: 0.85rem !important;
    }
    
    .feature-icon {
        font-size: 3.5rem;
    }
    
    .result-buttons button {
        flex: 1 0 100%;
    }
    
    .shop-grid, .inventory-grid {
        grid-template-columns: 1fr;
    }
    
    .tab i {
        font-size: 1rem;
    }
    
    .tab span {
        font-size: 0.8rem;
    }
}

/* Medium Devices (tablets, 768px and down) */
@media (min-width: 577px) and (max-width: 768px) {
    .categories-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .levels-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .shop-grid, .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 769px) {
    .container {
        max-width: 768px;
        margin: 0 auto;
        border-left: 1px solid #e0e0e0;
        border-right: 1px solid #e0e0e0;
    }
    
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .categories-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .levels-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 768px;
    }
    
    .bottom-nav {
        max-width: 768px;
    }
}

/* Landscape Mode Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .character-container {
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    .character {
        max-height: 150px;
    }
    
    .bottom-nav {
        padding: 5px 0;
    }
    
    .nav-item {
        padding: 5px 10px;
    }
    
    .nav-item i {
        font-size: 1.1rem;
        margin-bottom: 2px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
}
