﻿/* ==========================================================================
   IMPORTS & VARIABLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Emilys+Candy&display=swap');

:root {
    --font-body: "Emilys Candy", serif;
    --font-heading: "Emilys Candy", serif;
    --font-script: "Emilys Candy", serif;
    --color-bg: #fafafa;
    --color-text: #333;
    --color-primary: #2f855a;
    --color-accent: #276749;
    --color-border: #c6f6d5;
    --color-highlight-bg: #e6fffa;
    --color-emoji-bg: #f7fffd;
    --color-total-bg: #00ffcc;
    --color-show-all-bg: #dde4f5;
    --color-pill-bg: #f0fff4;
    --color-success: #48bb78;
    --color-error: #f56565;
    --radius-card: 1rem;
    --radius-pill: 999px;
    --radius-highlight: 50px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.highlight-count {
  font-size: 0.8em;
  margin-left: 4px;
  opacity: 0.8;
}

input, button, textarea, select {
    font-size: 16px; /* 👈 minimum to prevent mobile zoom */
}


body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

    a:hover {
        color: var(--color-accent);
        text-decoration: underline;
    }

input, button {
    font-family: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

.container {
    width: 92%;
    max-width: 960px;
    margin: 0 auto;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.hidden {
    display: none !important;
}

.error {
    color: var(--color-error);
}

.success {
    color: var(--color-success);
    margin: .5rem 0;
}

.btn-block {
    display: block;
    width: 100%;
}

.toast-link {
    color: #fff;
    text-decoration: underline;
    margin-left: .5rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-block;
    padding: .65rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    transition: background .2s;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #48bb78, #38a169);
    }

.medium-btn {
    padding: .75rem 2rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.btn-outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    background: #fff;
    transition: background .2s, color .2s;
}

    .btn-outline:hover {
        background: var(--color-primary);
        color: #fff;
    }

.danger {
    color: var(--color-error);
    border-color: var(--color-error);
}

.btn-outline.reset,
button.reset {
    border-color: #ed8936;
    color: #ed8936;
}

    .btn-outline.reset:hover,
    button.reset:hover {
        background: #ed8936;
        color: #fff;
    }

.btn-outline.danger:hover,
button.danger:hover {
    background: red;
    color: #fff;
}

/* ==========================================================================
   BACK BUTTON
   ========================================================================== */
.back-btn,
.card-back-btn {
    display: inline-block;
    font-size: .9rem;
    color: var(--color-primary);
    text-decoration: none;
}

.back-btn {
    margin-bottom: 1rem;
}

.card-back-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

/* ==========================================================================
   SITE HEADER & FOOTER
   ========================================================================== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2%;
}

.nav a {
    margin-left: 1rem;
    color: #555;
    font-weight: 500;
    font-size: 1.2rem;
}

    .nav a.active,
    .nav a:hover {
        color: var(--color-accent);
    }

.site-footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer-nav a {
    margin: 0 .5rem;
    color: #555;
}

    .footer-nav a:hover {
        color: var(--color-primary);
    }

/* ==========================================================================
   HERO, FEATURES & ABOUT (HOME)
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, #e4ffe7, #eafffb);
    padding: 3rem .5rem;
    text-align: center;
}

    .hero h1 {
        font-family: var(--font-heading);
        font-size: 2.3rem;
        color: var(--color-accent);
    }

    .hero p {
        font-size: 1.125rem;
        margin: 1rem 0 2rem;
        color: #4a5568;
    }

.features {
    padding: 3rem 0;
}

    .features h2 {
        text-align: center;
        margin-bottom: 2rem;
        color: var(--color-accent);
    }

.feature-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.feature {
    background: #fff;
    border-radius: .5rem;
    padding: 2rem;
    text-align: center;
    width: 220px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

    .feature .icon {
        font-size: 2rem;
        margin-bottom: .5rem;
    }

    .feature h3 {
        margin-bottom: .5rem;
        color: var(--color-primary);
    }

.about {
    padding: 2rem 0;
    text-align: center;
}

    .about h2 {
        color: var(--color-accent);
        margin-bottom: 1rem;
    }

/* ==========================================================================
   CARD BASE & HEADER
   ========================================================================== */
.card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.card-header {
    text-align: center;
    margin-bottom: 1rem;
}

    .card-header .logo {
        font-family: var(--font-heading);
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--color-primary);
    }

.logo,
.highlight-name {
    font-family: var(--font-script);
    font-size: 1.5rem;
}

/* ==========================================================================
   DASHBOARD / SHARED CARD
   ========================================================================== */
.highlight-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-highlight-bg);
    padding: .3rem;
    margin-bottom: 1rem;
}

    .highlight-bar.top {
        border-radius: var(--radius-highlight) 0 0 var(--radius-highlight);
    }

    .highlight-bar.bottom {
        border-radius: 0 var(--radius-highlight) var(--radius-highlight) 0;
    }

.highlight-avatar {
    width: 64px;
    height: 64px;
    border: 3px solid var(--color-border);
    border-radius: 50%;
}

.highlight-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-inline: auto;
}

.highlight-text {
    font-family: var(--font-body);
    font-size: 1.6rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-inline-start: 60px;
}

.highlight-emoji {
    font-size: 2.5rem;
}

.action-boxes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.total-box,
.show-all {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: var(--radius-card);
    font-family: var(--font-heading);
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--color-border);
}

.total-box {
    background: var(--color-total-bg);
}

.show-all {
    background: var(--color-show-all-bg);
}

    .show-all .icon {
        margin-left: .25rem;
    }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 1rem;
    margin: 1rem 0;
    justify-items: center;
}

.emoji-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    border: 2px solid var(--color-highlight-bg);
    border-radius: var(--radius-card);
    background: var(--color-emoji-bg);
    min-height: 64px;
}

    .emoji-box.empty {
        border-style: dashed;
        background: transparent;
    }

.emoji-char {
    font-size: 1.5rem;
}

.emoji-count {
    font-size: .9rem;
    color: #555;
    margin-top: .25rem;
}

.link-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin: 1.5rem 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--color-pill-bg);
    border: 1px solid var(--color-border);
    padding: .5rem 1rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--color-accent);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

    .pill .icon {
        font-size: 1.25rem;
    }

.post-card-nav {
    text-align: center;
    margin-top: 1rem;
}

    .post-card-nav .btn {
        margin: 0 .5rem;
    }

/* ==========================================================================
   AUTH & SETTINGS FORMS
   ========================================================================== */
.auth-card,
.settings-card {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

    .auth-card h2,
    .settings-card h2 {
        text-align: center;
        color: var(--color-primary);
        margin-bottom: 1.25rem;
        font-family: var(--font-heading);
    }

    .auth-card label,
    .settings-card label {
        display: block;
        margin-top: 1rem;
        font-weight: 600;
    }

    .auth-card input,
    .settings-card input {
        width: 100%;
        padding: .65rem;
        border: 1px solid #ccc;
        border-radius: .45rem;
        margin-top: .4rem;
    }

    .auth-card button,
    .settings-card button {
        width: 100%;
        margin-top: 1.5rem;
        font-size: 1.4rem;
        border-radius: 100px;
    }

/* ==========================================================================
   USERNAME INPUT GROUP
   ========================================================================== */
.username-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: .45rem;
    overflow: hidden;
    margin-bottom: .5rem;
}

    .username-input-group .prefix {
        background: #3aa468;
        color: #fff;
        padding: .65rem;
        font-size: 1rem;
    }

    .username-input-group input {
        border: none;
        padding: .65rem;
        flex: 1;
        outline: none;
    }

.username-status {
    font-size: .85rem;
    margin: .25rem 0 1rem;
}

.status-available {
    color: var(--color-success);
}

.status-taken,
.status-error {
    color: var(--color-error);
}

/* ==========================================================================
   PLANT PAGE
   ========================================================================== */
.plant-card {
    max-width: 360px;
    margin: 3rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    backdrop-filter: blur(10px);
    background: linear-gradient(145deg, #ffffff, #f7f7f7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.plant-prompt {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.owner-info {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .owner-info .avatar-lg {
        border: 4px solid var(--color-highlight-bg);
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        width: 80px;
        height: 80px;
    }

    .owner-info h3 {
        margin-top: 0.5rem;
        color: var(--color-accent);
        font-size: 1.25rem;
        font-weight: 600;
    }

.emoji-tabs {
    display: flex;
    gap: 0.2rem;
    margin-bottom: 0.5rem;
    justify-content: space-around;
}

.tab-btn {
    padding: 0.2rem;
    background: var(--color-pill-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tab-btn.active {
        background: var(--color-primary);
        color: #fff;
        transform: scale(1.1);
    }

.emoji-panel {
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 200px;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 5px;
}

    .emoji-panel.active {
        display: flex;
    }

.emoji-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    border: 2px solid var(--color-highlight-bg);
    background: var(--color-emoji-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

    .emoji-btn.selected {
        background: var(--color-border);
        transform: scale(1.1);
    }

.emoji-panel::-webkit-scrollbar {
    width: 5px;
}

.emoji-panel::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 10px;
}

.slot-panel {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.slot-circle {
    width: 40px;
    height: 40px;
    border: 2px dashed var(--color-highlight-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #555;
}

#plant-btn {
    padding: 0.75rem 2rem;
    font-size: 1.25rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.2s;
    background: var(--color-primary);
    color: #fff;
    border: none;
    width: 100%;
}

    #plant-btn:hover {
        background: var(--color-primary-dark);
    }
/* ==========================================================================
   GARDEN PAGE
   ========================================================================== */
.garden-top {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar-tree-centered {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* smaller gap */
    padding: 2px;
}

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

.tree-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tree-wrapper .tree {
        font-size: 3rem;
        line-height: 1;
    }

    .tree-wrapper .tree-emoji {
        position: absolute;
        font-size: 1.5rem;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

.small-flower-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); /* smaller flowers */
    gap: .5rem;
    max-height: 700px;
    overflow-y: auto;
    margin-top: 1rem;
    justify-items: center;
}

.small-flower {
    background: #f9f9f9;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .4rem;
    width: 40px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.small-flower-emoji {
    font-size: 1.2rem;
}

.small-flower-count {
    font-size: 0.65rem;
    color: var(--color-text);
    margin-top: 0.2rem;
}


/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(0.8);
    padding: 1rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: .5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    z-index: 1000;
    text-align: center;
}

    .toast.show {
        transform: translate(-50%,-50%) scale(1);
        opacity: 1;
    }

/* ==========================================================================
   Avatar: force 80×80 circle everywhere
   ========================================================================== */
.avatar-lg,
.avatar-preview,
.garden-avatar-header {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50% !important;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    padding: 3px;
}
