﻿/* ========================================= */
/* === 1. GLOBAL VARIABLES & LAYOUT ====== */
/* (Ginagamit sa lahat ng pages ng app)      */
/* ========================================= */

:root {
    --app-bg: #F0F8F5;
    --header-bg: #006A38;
    --card-bg: #F0F8F4;
    --text-dark: #004D2C;
    --text-green: #009846;
    --btn-blue: #1A73E8;
    --btn-green: #00A651;
    --orange-bg: #FFF0E5;
    --orange-text: #E06C20;
    --red-target: #E53935;
}

body {
    /* Subtle gradient background para sa desktop view */
    background: linear-gradient(to bottom right, #e0f2f1, #cfd8dc);
    display: flex;
    align-items: center; /* Centered vertically para sa desktop */
    justify-content: center; /* Centered horizontally */
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Mobile-Locked Container */
.app-container {
    background-color: var(--app-bg);
    width: 100%;
    max-width: 400px;
    height: 100vh; /* Default sakop buong screen kapag naka-mobile */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

/* MAGIC TRICK: "Phone Bezel" effect kapag nasa Desktop/Malaking screen */
@media (min-width: 600px) {
    .app-container {
        /* I-LOCKED NATIN ANG SIZE DITO PARA HINDI MAGING MATABA (Tablet look) */
        width: 375px; /* Standard phone width */
        height: 812px; /* Standard phone height */
        max-height: 90vh; /* Safety check kung maliit ang laptop screen */
        border-radius: 40px; /* Kurba ng cellphone */
        border: 12px solid #222; /* Frame/Bezel ng cellphone */
    }
}

/* TIKTOK-STYLE GET APP BUTTON (Nasa labas ng phone) */
.desktop-get-app-btn {
    position: fixed;
    top: 30px;
    right: 40px;
    background-color: white;
    color: var(--text-dark);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s ease;
}

    .desktop-get-app-btn:hover {
        background-color: var(--btn-green);
        color: white;
        transform: translateY(-3px);
    }

/* Itago ang button na ito kapag naka-mobile phone na talaga */
@media (max-width: 768px) {
    .desktop-get-app-btn {
        display: none;
    }
}

/* Top Header */
.top-header {
    background-color: var(--header-bg);
    color: white;
    padding: 20px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.water-badge {
    background-color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Main Content (The internally scrolling area) */
.dashboard-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 120px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .dashboard-content::-webkit-scrollbar {
        display: none;
    }

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 12px 0 20px 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 10;
}

.nav-link-custom {
    color: #6B7280;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

    .nav-link-custom i {
        font-size: 1.3rem;
    }

    .nav-link-custom.active {
        color: var(--btn-green);
    }

/* Floating Action Button */
.fab-btn {
    position: absolute;
    /* INI-ANGAT NATIN PARA HINDI PUMATONG SA BOTTOM MENU SA DESKTOP VIEW */
    bottom: 105px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--btn-blue);
    color: white;
    font-size: 1.6rem;
    border: none;
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}


/* ========================================= */
/* === 2. HOME PAGE SPECIFICS ========== */
/* (Plant Progress at Daily Eco-Tip lang)    */
/* ========================================= */

/* Plant Section */
.plant-icon-wrap {
    height: 90px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 20px;
}

    .plant-icon-wrap img {
        height: 40px;
    }

.progress-labels {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.custom-progress-bar {
    height: 10px;
    background-color: #D1D5DB;
    border-radius: 5px;
    margin: 8px 0;
}

.progress-subtext {
    font-size: 0.75rem;
    color: var(--btn-green);
    text-align: center;
    margin-bottom: 16px;
}

.badge-solid-green {
    background-color: var(--btn-green);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 12px;
}

.badge-outline-green {
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid var(--btn-green);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 12px;
}

/* Eco-Tip Section */
.eco-tip-icon {
    background-color: var(--btn-green);
    color: #FFD54F;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

.eco-tip-text h3 {
    color: var(--text-dark);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.eco-tip-text p {
    color: var(--btn-green);
    font-size: 0.85rem;
    margin: 0;
}


/* ========================================= */
/* === 3. SHARED CARDS & MISSIONS ====== */
/* (Ginagamit sa Home, Missions, at Leaderboard) */
/* ========================================= */

/* Common Card Styling (White rounded box) */
.eco-card,
.mission-card {
    background-color: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 1px;
}

.missions-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.timer-pill {
    background-color: var(--orange-bg);
    color: var(--orange-text);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Mission Status Circles */
.icon-red-circle {
    width: 28px;
    height: 28px;
    border: 4px solid var(--red-target);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .icon-red-circle::after {
        content: '';
        width: 8px;
        height: 8px;
        background-color: var(--red-target);
        border-radius: 50%;
    }

.icon-green-circle {
    width: 28px;
    height: 28px;
    background-color: var(--btn-green);
    border-radius: 50%;
}

/* Mission Texts */
.mission-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.mission-info p {
    font-size: 0.8rem;
    color: var(--btn-green);
    margin: 0;
}

/* Water Reward Buttons */
.btn-blue-reward {
    background-color: var(--btn-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
}

.btn-green-reward {
    background-color: var(--btn-green);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
}

/* Category Tags / Pill Outlines (Shared for Missions & Leaderboard) */
.mission-category-tag,
.eco-pill-outline {
    border: 1px solid var(--btn-green);
    color: var(--btn-green);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 4px;
}


/* ========================================= */
/* === 4. LEADERBOARD PAGE SPECIFICS === */
/* (Crowns, Avatars, at Points Rankings)     */
/* ========================================= */

.rank-crown {
    font-size: 1.5rem; /* Pinaliit nang konti mula 1.8rem */
    min-width: 30px; /* Para hindi maipit ng ibang elements */
    text-align: center;
}

/* Crown Colors */
.crown-1 {
    color: #F5B041;
}
/* Gold */
.crown-2 {
    color: #B2BABB;
}
/* Silver */
.crown-3 {
    color: #CD7F32;
}
/* Bronze */

/* Bright Green Avatar Circles */
.avatar-circle {
    width: 42px; /* Pinaliit mula 50px */
    height: 42px;
    background-color: #00C853;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; /* MAGIC: Pipigilan nitong ma-squish yung bilog kapag maliit ang screen */
}

/* Player Name */
.player-name {
    font-size: 0.95rem; /* Binabaan nang konti mula 1.05rem */
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px 0;
    white-space: nowrap; /* Para hindi bumaba yung text kung mahaba ang pangalan */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Points Alignment */
.player-points {
    text-align: right;
    min-width: 65px; /* Gamit ay min-width imbes na fixed width */
    flex-shrink: 0; /* Para laging buo ang points at hindi maipit */
}

.points-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.points-text {
    font-size: 0.7rem;
    color: var(--btn-green);
    display: block;
}

/* ========================================= */
/* === 5. FOREST PAGE SPECIFICS ======== */
/* ========================================= */

/* Top Stats Card */
.forest-stats-card {
    background-color: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.stat-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.stat-item p {
    font-size: 0.75rem;
    color: var(--btn-green);
    margin: 0;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background-color: #E5E7EB; /* Light gray line */
}

/* Tree Grid Layout */
.tree-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dalawang pantay na columns */
    gap: 15px; /* Spacing sa pagitan ng cards */
    padding-bottom: 20px;
}

/* Individual Tree Card */
.tree-card {
    background-color: white;
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Gagamit muna tayo ng FontAwesome icons habang wala pang totoong pictures */
.tree-icon-placeholder {
    font-size: 4.5rem;
    margin-bottom: 15px;
}

/* Badges para sa Stages */
.stage-badge-green {
    background-color: var(--btn-green);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.stage-badge-orange {
    background-color: #D68910; /* Orange para sa Stage 2 */
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}

/* Tree Name & Description */
.tree-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.tree-card p {
    font-size: 0.7rem;
    color: var(--btn-green);
    margin: 0;
}

/* ========================================= */
/* === 6. USER PROFILE PAGE SPECIFICS ==== */
/* ========================================= */

/* Large Profile Avatar Header */
.profile-header-card {
    text-align: center;
    padding: 30px 10px 20px 10px;
}

/* Updated Player Icon Circle (Large for Profile) */
.player-icon-profile-xl {
    width: 80px;
    height: 80px;
    background-color: var(--header-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #FFD54F;
    font-size: 2.5rem;
    margin: 0 auto 15px auto;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* "Edit Profile" style button */
.btn-edit-profile {
    background-color: transparent;
    color: var(--btn-green);
    border: 1px solid var(--btn-green);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 18px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 8px;
    text-decoration: none;
}

/* Section Title for each group (Stats, Achievements, Account) */
.profile-section-label {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 600;
    margin: 25px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Stats Section Layout */
.profile-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-card-inline {
    background-color: white;
    border-radius: 12px;
    padding: 12px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.stat-icon-wrap {
    font-size: 1.3rem;
    color: var(--btn-green);
}

.stat-card-inline h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.stat-card-inline p {
    font-size: 0.7rem;
    color: #6B7280;
    margin: 0;
}

/* Achievements Section Badges */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.achievement-tile {
    background-color: white;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.achievement-icon-wrap {
    font-size: 1.5rem;
    color: #F5B041;
}

.achievement-tile h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.achievement-tile p {
    font-size: 0.7rem;
    color: var(--btn-green);
    margin: 0;
}

/* Account Options List */
.account-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-tile {
    background-color: white;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: var(--text-dark);
}

.option-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-icon-wrap {
    font-size: 1.2rem;
    color: #6B7280;
}

.option-tile span {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ========================================= */
/* === 7. AUTH PAGES SPECIFICS (LOG/REG) == */
/* ========================================= */

/* Buong screen na dark green */
.auth-screen {
    background-color: var(--header-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Yung box sa gitna */
.auth-card {
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 35px 25px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Seed Icon */
.auth-icon-wrap {
    font-size: 2.5rem;
    color: #CFFF62; /* Kulay ng seed (light green na ngayon) */
    margin-bottom: 10px;
}

.auth-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 25px 0;
}

/* Form Inputs */
.auth-form-group {
    text-align: left;
    margin-bottom: 15px;
}

    .auth-form-group label {
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        margin-bottom: 6px;
        display: block;
    }

.auth-input-dark {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: none;
    background-color: #E2E8F0;
    color: var(--text-dark);
    font-size: 0.9rem;
    box-sizing: border-box;
}

    .auth-input-dark:focus {
        outline: 2px solid var(--btn-green);
    }

/* Primary Green Button */
.btn-auth-solid {
    width: 100%;
    background-color: var(--btn-green);
    color: white;
    padding: 12px;
    border-radius: 6px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 166, 81, 0.3);
}

/* White Google Button */
.btn-auth-google {
    width: 100%;
    background-color: white;
    color: var(--text-dark);
    padding: 12px;
    border-radius: 6px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Footer Links */
.auth-footer-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    margin-top: 25px;
}

.auth-footer-link {
    color: white;
    font-weight: 700;
    text-decoration: underline;
}

/* ========================================= */
/* === 8. ADMIN DASHBOARD STYLES (DESKTOP) === */
/* ========================================= */

/* Cards para sa Analytics */
.admin-stat-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    /* Hover effect para umangat yung card */
    .admin-stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

.stat-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* Cards para sa Missions at Users */
.admin-mission-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

    .admin-mission-card:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    }

/* Tag style para sa category (Water, Energy, etc.) */
.mission-category-tag {
    font-weight: 600;
    background-color: transparent;
    display: inline-block;
}

/* Badge hover effect para sa Admin Logout Button */
header a .badge {
    transition: background-color 0.2s ease;
}

    header a .badge:hover {
        background-color: #7C3AED !important; /* Mas dark na purple kapag hinover */
    }

/* ========================================= */
/* === 9. NEW SIDEBAR NAVIGATION STYLES ===  */
/* ========================================= */

/* Style for individual vertical sidebar links */
.nav-link-sidebar {
    padding: 10px 0;
    border-radius: 12px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    /* Hover effect para sa Sidebar link */
    .nav-link-sidebar:hover {
        background-color: rgba(0, 166, 81, 0.05); /* Very light green on hover */
        color: var(--btn-green) !important;
    }

/* ========================================= */
/* === 10. MODERN ADMIN TABLES           === */
/* ========================================= */

.modern-table-wrapper {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden; /* Ito yung nagpapa-round sa mismong table sa loob */
}

.modern-table {
    margin-bottom: 0;
}

    .modern-table thead {
        background-color: #F8FAFC;
        border-bottom: 2px solid #E5E7EB;
    }

    .modern-table th {
        color: #6B7280;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 16px 20px;
        border: none;
    }

    .modern-table td {
        padding: 16px 20px;
        vertical-align: middle;
        color: var(--text-dark);
        border-bottom: 1px solid #F3F4F6;
    }

    .modern-table tbody tr {
        transition: background-color 0.2s ease;
    }

        .modern-table tbody tr:hover {
            background-color: #F0FDF4; /* Very light green kapag tinapatan ng mouse */
        }
