/* --- AI FOR GREEN - THEME & STYLES (FINAL VERSION) --- */

:root {
    /* MÀU SẮC CHỦ ĐẠO */
    --primary: #27ae60;      /* Xanh lá đậm */
    --primary-hover: #219150;
    --primary-light: #e8f5e9; /* Xanh nhạt nền */
    --accent: #f1c40f;       /* Vàng */
    --bg-body: #eff3f6;      /* Xám nhạt nền web */
    --bg-card: #ffffff;
    --text-main: #2c3e50;    
    --text-light: #7f8c8d;
    --border: #e0e6ed;       
    
    /* UI SYSTEM */
    --radius: 16px;          
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-hover: 0 8px 24px rgba(39, 174, 96, 0.15);
}

/* 1. RESET & FONT FIX */
* {
    box-sizing: border-box; margin: 0; padding: 0; outline: none;
    font-family: 'Baloo 2', cursive, sans-serif !important; 
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-top: 85px; 
    font-size: 16px;
    font-weight: 500;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* 2. HEADER & LOGO */
.glass-header {
    position: fixed; top: 0; left: 0; right: 0; height: 75px;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0,0,0,0.03);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 30px; z-index: 1000;
}
.logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo-img { height: 45px; transition: 0.2s; }
.logo:hover .logo-img { transform: scale(1.1) rotate(-5deg); }
.logo-main-text { font-weight: 800; font-size: 1.6rem; color: var(--primary); line-height: 1; }
.logo-sub-text { font-weight: 700; font-size: 1.6rem; color: var(--text-main); line-height: 1; }

/* 3. LAYOUT CHÍNH */
.main-layout {
    display: grid; grid-template-columns: 280px 1fr 320px; gap: 30px;
    max-width: 1300px; margin: 0 auto; padding: 0 20px 40px;
}

/* 4. BUTTONS */
.auth-btn {
    background: var(--primary); color: white; border: none;
    padding: 10px 24px; border-radius: 50px;
    font-weight: 700; font-size: 1.1rem; cursor: pointer;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
    transition: all 0.2s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover {
    background: var(--primary-hover); transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}
.auth-btn:disabled { background: #95a5a6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-large { width: 100%; padding: 16px; font-size: 1.3rem; margin-top: 20px; }
.btn-cancel { background: #f1f2f6; color: #555; border: none; padding: 10px 20px; border-radius: 50px; font-weight: 700; cursor: pointer; }

/* 5. SIDEBAR LEFT (USER INFO) */
.sidebar-left, .sidebar-right { position: sticky; top: 100px; height: fit-content; }
.user-stat-card, .nav-menu, .widget-card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 2px solid white; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 25px;
}
.user-stat-card { padding: 30px; text-align: center; }
.user-avatar-lg {
    width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
    border: 4px solid var(--primary-light); margin-bottom: 10px;
}
#xpBar { background: linear-gradient(90deg, var(--primary), #2ecc71); height: 100%; width: 0%; transition: 0.5s; }
.nav-menu { padding: 15px; }
.nav-item {
    display: flex; align-items: center; gap: 15px; padding: 14px 20px;
    border-radius: 12px; color: var(--text-light); font-weight: 700; font-size: 1.1rem;
    cursor: pointer; transition: 0.2s; margin-bottom: 5px;
}
.nav-item:hover { background: var(--bg-body); color: var(--text-main); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }

/* 6. INPUTS & FORM */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--text-main); }
.post-input {
    width: 100%; padding: 12px 18px;
    background: #fff; border: 2px solid var(--border); border-radius: 12px;
    font-size: 1rem; font-weight: 600; color: var(--text-main);
    transition: all 0.2s;
}
.post-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1); }
input[type="file"].post-input { padding: 10px; background: #f8f9fa; cursor: pointer; }
textarea.post-input { resize: vertical; min-height: 100px; }
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- [NEW] STYLES CHO VẬT LIỆU LIST --- */
.material-control-box { display: flex; gap: 10px; margin-bottom: 15px; }
.material-control-box select { flex-grow: 1; cursor: pointer; }

.btn-add-mat {
    background: var(--primary); color: white; border: none;
    padding: 0 20px; border-radius: 12px; font-weight: 700;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 5px;
}
.btn-add-mat:hover { background: var(--primary-hover); }

.selected-materials-container {
    background: #f8f9fa; border: 2px dashed var(--border);
    border-radius: 12px; padding: 15px; min-height: 60px;
}
.empty-note { text-align: center; color: #999; font-style: italic; font-size: 0.9rem; margin: 0; }

.mat-selected-item {
    display: flex; justify-content: space-between; align-items: center;
    background: white; padding: 10px 15px; border-radius: 8px;
    margin-bottom: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee; animation: slideUp 0.3s ease;
}
.mat-item-info { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-main); }
.mat-item-qty { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 6px; font-size: 0.9rem; }

.btn-remove-mat {
    background: #ffebee; color: #e74c3c; border: none;
    width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.btn-remove-mat:hover { background: #e74c3c; color: white; }

/* CREATE PROJECT HEADER & STEPS */
.form-header-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    padding: 30px; border-radius: var(--radius); color: white; margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(39, 174, 96, 0.2);
}
.form-section {
    background: #fff; border-radius: var(--radius); padding: 30px; margin-bottom: 25px;
    box-shadow: var(--shadow); border: 1px solid white;
}
.project-step {
    background: #fcfcfc; border: 2px solid var(--border);
    border-radius: 14px; padding: 25px; margin-bottom: 20px; position: relative;
}
.remove-step-btn {
    position: absolute; top: 20px; right: 20px; width: 35px; height: 35px; border-radius: 50%;
    border: 2px solid #e74c3c; color: #e74c3c; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
#addStepBtn {
    width: 100%; padding: 18px; border-radius: 14px; background: #f8f9fa; color: var(--primary);
    border: 2px dashed #b2bec3; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* 7. FEED & POST CARD */
.create-post-box { background: white; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 25px; text-align: center; }
.post-card { background: white; border-radius: var(--radius); padding: 25px; box-shadow: var(--shadow); margin-bottom: 25px; animation: slideUp 0.4s ease; }
.action-bar { border-top: 2px solid #f1f2f6; padding-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-action {
    background: transparent; border: none; padding: 8px 16px; border-radius: 20px;
    color: var(--text-light); font-weight: 700; cursor: pointer; display: flex; gap: 8px; align-items: center;
}
.btn-action:hover { background: var(--primary-light); color: var(--primary); }
.btn-action.liked { color: #e74c3c; background: #ffebee; }

/* 8. PROFILE */
.profile-container { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 25px; }
.profile-cover { height: 220px; background-color: #ddd; background-size: cover; background-position: center; position: relative; z-index: 1;}
.edit-cover-btn { position: absolute; bottom: 20px; right: 20px; background: rgba(0,0,0,0.6); color: white; }
.profile-content { padding: 0 30px 30px; text-align: center; position: relative; z-index: 2; background: white; }
.profile-avatar-wrapper { margin-top: -70px; display: inline-block; position: relative; z-index: 3; }
.profile-avatar-main { width: 140px; height: 140px; border-radius: 50%; border: 6px solid white; background: white; object-fit: cover; box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.profile-name-main { font-size: 2rem; margin: 10px 0 5px; color: var(--text-main); }
.profile-info-group { display: flex; justify-content: center; align-items: center; gap: 10px; }
.edit-profile-btn { background: #f1f2f6; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; color: #555; display: flex; align-items: center; justify-content: center; }
.stats-grid-new { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 25px; }
.stat-card-new { background: #f8f9fa; padding: 15px; border-radius: 12px; border: 1px solid var(--border); }
.stat-value-new { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label-new { font-size: 0.9rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; }

/* 9. WIDGETS & LEADERBOARD */
.widget-title { background: #fff; padding: 20px 25px; font-weight: 800; font-size: 1.2rem; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 10px; }
.leaderboard-item { display: flex; align-items: center; padding: 12px 15px; border-radius: 12px; background: #fcfcfc; margin-bottom: 8px; transition: 0.2s; }
.leaderboard-item:hover { background: #fff; transform: translateX(5px); box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.rank-badge { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; margin-right: 12px; background: #f0f2f5; flex-shrink: 0; }
.rank-1 { background: #fef9e7; color: #f1c40f; } .rank-2 { background: #f4f6f7; } .rank-3 { background: #fbf6ec; color: #cd7f32; }
.user-avatar-lb { width: 35px; height: 35px; border-radius: 50%; margin-right: 10px; object-fit: cover; }
.tip-card-content { padding: 20px 25px; background: #f0f9f4; }
.tip-item { display: flex; gap: 15px; }
.tip-icon { width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 2000; backdrop-filter: blur(5px); }
.modal-content { background: white; padding: 30px; border-radius: 20px; width: 90%; max-width: 500px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.modal-header { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 25px; color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.loading-spinner { font-size: 2rem; color: var(--primary); padding: 40px; text-align: center; }
.spin-icon { animation: spin 1s linear infinite; }

/* --- GUIDE OVERLAY STYLES (IMMERSIVE VIEW) --- */
.guide-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 3000; overflow-y: auto;
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.close-guide-btn {
    position: fixed; top: 20px; right: 20px; z-index: 3005;
    background: rgba(0,0,0,0.5); color: white; border: none;
    width: 45px; height: 45px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer; transition: 0.2s;
}
.close-guide-btn:hover { background: #e74c3c; transform: rotate(90deg); }

/* Hero Section */
.guide-hero { position: relative; height: 350px; width: 100%; overflow: hidden; }
.guide-hero img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6); }
.guide-hero-content {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 40px 15% 40px 5%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); color: white;
}
.guide-badge { background: var(--primary); color: white; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; display: inline-block; }
.guide-hero h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.guide-meta { display: flex; gap: 20px; margin-top: 15px; font-size: 1.1rem; }

/* Body Guide */
.guide-body {
    display: grid; grid-template-columns: 300px 1fr; gap: 40px;
    max-width: 1200px; margin: -30px auto 50px; padding: 0 20px;
    position: relative; z-index: 10;
}
.material-card { background: white; padding: 25px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid #eee; }
.material-list li { padding: 10px 0; border-bottom: 1px dashed #eee; display: flex; align-items: center; gap: 10px; color: #555; }
.material-list li:before { content: "\EB7A"; font-family: 'remixicon'; color: var(--primary); }

.start-now-btn {
    width: 100%; margin-top: 20px; padding: 18px;
    background: linear-gradient(45deg, var(--primary), #2ecc71);
    color: white; border: none; border-radius: 14px;
    font-size: 1.2rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4); transition: 0.3s;
}
.start-now-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(39, 174, 96, 0.6); }

/* Timeline Steps */
.steps-timeline { margin-top: 20px; }
.step-item { display: flex; gap: 20px; margin-bottom: 30px; }
.step-number {
    flex-shrink: 0; width: 50px; height: 50px; background: var(--bg-body);
    border: 2px solid var(--primary); color: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800;
}
.step-content { background: white; padding: 20px; border-radius: 16px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); flex-grow: 1; border: 1px solid #f0f0f0; width: 100%; }
.step-content p { font-size: 1.1rem; line-height: 1.6; color: #444; margin-bottom: 15px; }
.step-img { width: 100%; border-radius: 12px; margin-top: 10px; display: block; object-fit: cover; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; padding: 15px; }
    .sidebar-left, .sidebar-right { display: none; }
    .guide-body { grid-template-columns: 1fr; margin-top: 0; padding-top: 20px; }
    .guide-hero { height: 250px; }
    .guide-hero h1 { font-size: 1.8rem; }
    .grid-2-col { grid-template-columns: 1fr; }
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpFade { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { 100% { transform: rotate(360deg); } }