/* ============================================================
   EHSIA – assets/css/components.css
   Buttons, plant selector, loading spinner
   ============================================================ */

/* ── Buttons ──────────────────────────────────────────────── */
.main-menu-btn, .sub-menu-btn {
    padding: 8px 20px; border: 2px solid var(--primary);
    background: var(--white); color: var(--primary);
    border-radius: var(--radius); font-weight: 600;
    cursor: pointer; transition: var(--transition);
    font-size: 14px; text-align: center; min-width: 220px;
    font-family: inherit; box-shadow: 0 2px 6px rgba(23,125,144,0.1);
}
.sub-menu-btn { min-width: 180px; font-size: 13px; padding: 7px 18px; }

.main-menu-btn:hover, .sub-menu-btn:hover {
    background: rgba(23,125,144,0.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(23,125,144,0.2);
}
.main-menu-btn.active, .sub-menu-btn.active {
    background: var(--gradient-primary); color: var(--white);
    box-shadow: var(--shadow); border-color: var(--primary-dark);
}

.btn-camera {
    background: none; border: 1px solid var(--primary); color: var(--primary);
    border-radius: 4px; cursor: pointer; padding: 0 5px; font-size: 14px;
    height: 24px; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.btn-camera:hover { background: var(--primary); color: var(--white); }

/* ── Plant Selector Overlay ───────────────────────────────── */
.plant-selector-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--gradient-primary);
    z-index: 10000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: white; text-align: center;
}
.plant-selector-title h1 {
    font-size: 2.5em; margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.plant-selector-title p { font-size: 1.2em; margin-bottom: 40px; opacity: 0.9; }
.plant-options-container { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; }

.plant-card {
    background: rgba(255,255,255,0.95); color: var(--dark);
    border-radius: 15px; padding: 30px; width: 280px;
    text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 2px solid transparent; transition: all 0.3s ease;
    cursor: pointer; backdrop-filter: blur(5px);
}
.plant-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3); background: white;
}
.plant-card-logo { font-size: 3em; margin-bottom: 15px; font-weight: 800; }
.plant-card h2   { color: var(--primary); font-size: 1.8em; margin-bottom: 5px; }
.plant-card span { color: var(--secondary); font-size: 0.9em; font-weight: 600; }

.back-to-portal-btn {
    margin-top: 40px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white; padding: 10px 20px;
    border-radius: 20px; cursor: pointer;
    font-size: 1rem; font-weight: 500; transition: all 0.3s ease;
}
.back-to-portal-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Loading Spinner ──────────────────────────────────────── */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(10,66,92,0.7);
    z-index: 99999; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: white;
}
.loading-overlay.hidden { display: none; }
.spinner {
    width: 48px; height: 48px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notification ───────────────────────────────────── */
#ehsia-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 99998;
    background: var(--dark); color: white;
    padding: 12px 20px; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); font-size: 14px;
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; max-width: 320px;
}
#ehsia-toast.show { opacity: 1; transform: translateY(0); }
#ehsia-toast.success { background: var(--success); }
#ehsia-toast.error   { background: var(--danger); }
#ehsia-toast.info    { background: var(--primary); }
